diff options
| author | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2012-11-18 13:35:42 -0500 | 
|---|---|---|
| committer | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2012-11-18 13:35:42 -0500 | 
| commit | 1b8181bf0d6e9137e6b9ccdbe414aec37377a1a9 (patch) | |
| tree | 33e5f3aa5abff1f41314cf8f6afbd2c2c40e4bfd /word-aligner/ttables.cc | |
| parent | 7c4665949fb93fb3de402e4ce1d19bef67850d05 (diff) | |
major restructure of the training code
Diffstat (limited to 'word-aligner/ttables.cc')
| -rw-r--r-- | word-aligner/ttables.cc | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/word-aligner/ttables.cc b/word-aligner/ttables.cc new file mode 100644 index 00000000..45bf14c5 --- /dev/null +++ b/word-aligner/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"); +} + | 
