diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-11 20:07:45 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-11 20:07:45 +0300 |
commit | f247e26fed78347cfcaeb8f82b8db6b50feff3f8 (patch) | |
tree | ce29bcefd75605890ffbc90f0a0ccd1e869bcc6d /moses/Hypothesis.cpp | |
parent | fbfe5890d13760a6610abaf2b1797dc1db5cc9f4 (diff) |
More options refactoring (OOV Handling this time).
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r-- | moses/Hypothesis.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp index ad3f6ab4b..19bd541f6 100644 --- a/moses/Hypothesis.cpp +++ b/moses/Hypothesis.cpp @@ -347,7 +347,9 @@ std::string Hypothesis:: GetTargetPhraseStringRep(const vector<FactorType> factorsToPrint) const { - return (m_prevHypo ? GetCurrTargetPhrase().GetStringRep(factorsToPrint) : ""); + return (m_prevHypo + ? GetCurrTargetPhrase().GetStringRep(factorsToPrint) + : ""); } std::string @@ -469,11 +471,13 @@ OutputSurface(std::ostream &out, const Hypothesis &edge, UTIL_THROW_IF2(outputFactorOrder.size() == 0, "Must specific at least 1 output factor"); const TargetPhrase& phrase = edge.GetCurrTargetPhrase(); - bool markUnknown = StaticData::Instance().GetMarkUnknown(); + bool markUnknown = GetManager().options().unk.mark; + // = StaticData::Instance().GetMarkUnknown(); if (reportAllFactors == true) { out << phrase; } else { - FactorType placeholderFactor = StaticData::Instance().options().input.placeholder_factor; + FactorType placeholderFactor + = StaticData::Instance().options().input.placeholder_factor; std::map<size_t, const Factor*> placeholders; if (placeholderFactor != NOT_FOUND) { @@ -499,9 +503,8 @@ OutputSurface(std::ostream &out, const Hypothesis &edge, //preface surface form with UNK if marking unknowns const Word &word = phrase.GetWord(pos); if(markUnknown && word.IsOOV()) { - out << StaticData::Instance().GetUnknownWordPrefix() - << *factor - << StaticData::Instance().GetUnknownWordSuffix(); + out << GetManager().options().unk.prefix << *factor + << GetManager().options().unk.suffix; } else { out << *factor; } |