diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-29 21:06:33 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-29 21:06:33 +0000 |
commit | 446fde8f67d4ad8c2699a8e9327a8988c3380723 (patch) | |
tree | d0e968a2dbb84dab205f6df17c6ffab1331fd55f /training/ttables.cc | |
parent | 252d628d38b792acbd98e2f74e129994cc9fe3b4 (diff) |
move model 1 code
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@665 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'training/ttables.cc')
-rw-r--r-- | training/ttables.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/training/ttables.cc b/training/ttables.cc new file mode 100644 index 00000000..45bf14c5 --- /dev/null +++ b/training/ttables.cc @@ -0,0 +1,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)] = 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"); +} + |