diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-12 16:12:25 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-12 16:12:25 +0300 |
commit | 28eee66d6ed38a3d1eea1114df2cdedbacd16f90 (patch) | |
tree | 0eb48a5c740c6c33ecc3e57cd49480341908e705 /moses/Hypothesis.cpp | |
parent | bd73cfd377cd93d57a209a3814316198236ebb8c (diff) | |
parent | dad1bd6127115cda89158c4c8fcf35cc4451218c (diff) |
Merge ../mosesdecoder into perf_moses2
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 9c209013c..c27de1dda 100644 --- a/moses/Hypothesis.cpp +++ b/moses/Hypothesis.cpp @@ -352,7 +352,9 @@ std::string Hypothesis:: GetTargetPhraseStringRep(const vector<FactorType> factorsToPrint) const { - return (m_prevHypo ? GetCurrTargetPhrase().GetStringRep(factorsToPrint) : ""); + return (m_prevHypo + ? GetCurrTargetPhrase().GetStringRep(factorsToPrint) + : ""); } std::string @@ -474,11 +476,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().GetPlaceholderFactor(); + FactorType placeholderFactor + = StaticData::Instance().options().input.placeholder_factor; std::map<size_t, const Factor*> placeholders; if (placeholderFactor != NOT_FOUND) { @@ -504,9 +508,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; } |