-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.h
More file actions
64 lines (44 loc) · 1.74 KB
/
util.h
File metadata and controls
64 lines (44 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _UTIL_H_
#define _UTIL_H_
#include <fstream>
#include <memory>
#include <vector>
#include <boost/program_options.hpp>
#include "definitions.h"
using namespace std;
namespace po = boost::program_options;
class Dictionary;
class TranslationTable;
Instance ConstructInstance(
const AlignedTree& parse_tree,
const String& target_string,
const Alignment& alignment);
// Reads a parse tree from a file in ptb format.
AlignedTree ReadParseTree(istream& tree_stream, Dictionary& dictionary);
// Reads a target sentence from file.
String ReadTargetString(istream& string_stream, Dictionary& dictionary);
pair<Rule, double> ReadRule(istream& grammar_stream, Dictionary& dictionary);
istream& operator>>(istream& in, Alignment& alignment);
void ReadInternalStructure(
istream& in, AlignedTree& tree, Dictionary& dictionary, int tree_index);
void ConstructGHKMDerivation(AlignedTree& tree,
const String& target_string,
const Alignment& alignment);
void WriteTargetString(ostream& out,
const String& target_string,
Dictionary& dictionary);
void WriteSCFGRule(ostream& out, const Rule& rule, Dictionary& dictionary);
void WriteSTSGRule(ostream& out, const Rule& rule, Dictionary& dictionary);
ostream& operator<<(ostream& out, const Alignment& alignment);
string GetOutputFilename(
const string& output_directory,
const string& extension,
const string& iteration = "");
void LoadTranslationTables(
po::variables_map vm,
shared_ptr<TranslationTable>& forward_table,
shared_ptr<TranslationTable>& reverse_table,
Dictionary& Dictionary);
vector<Instance> LoadInternalState(
po::variables_map vm, Dictionary& dictionary);
#endif