blob: 2ea960f08878d7028fd65395625e7ec0b90db847 (
plain)
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
|
#include "ttables.h"
#include <cassert>
#include "dict.h"
using namespace std;
using namespace std::tr1;
void TTable::DeserializeProbsFromText(std::istream* in) {
int c = 0;
while(*in) {
string e;
string f;
double p;
(*in) >> e >> f >> p;
if (e.empty()) break;
++c;
ttable[TD::Convert(e)][TD::Convert(f)] = prob_t(p);
}
cerr << "Loaded " << c << " translation parameters.\n";
}
void TTable::SerializeHelper(string* out, const Word2Word2Double& o) {
assert(!"not implemented");
}
void TTable::DeserializeHelper(const string& in, Word2Word2Double* o) {
assert(!"not implemented");
}
|