diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-03 20:04:10 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-03 20:04:10 +0300 |
commit | ccbcc14ed863dc903bb8b2d84f5989ef806a0e75 (patch) | |
tree | 54af4d7b63bb27e48d6868a5413fbb83379afd06 /moses/BaseManager.cpp | |
parent | 184e79f4d6943f1ada23ab1f8780cb1097e08121 (diff) |
move OutputDetailedTranslationReport() to Managers
Diffstat (limited to 'moses/BaseManager.cpp')
-rw-r--r-- | moses/BaseManager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/moses/BaseManager.cpp b/moses/BaseManager.cpp index 485cdd182..e41685344 100644 --- a/moses/BaseManager.cpp +++ b/moses/BaseManager.cpp @@ -88,6 +88,24 @@ void BaseManager::OutputSurface(std::ostream &out, const Phrase &phrase, } } +// Emulates the old operator<<(ostream &, const DottedRule &) function. The +// output format is a bit odd (reverse order and double spacing between symbols) +// but there are scripts and tools that expect the output of -T to look like +// that. +void BaseManager::WriteApplicationContext(std::ostream &out, + const ApplicationContext &context) const +{ + assert(!context.empty()); + ApplicationContext::const_reverse_iterator p = context.rbegin(); + while (true) { + out << p->second << "=" << p->first << " "; + if (++p == context.rend()) { + break; + } + out << " "; + } +} + } // namespace |