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/Manager.cpp | |
parent | fbfe5890d13760a6610abaf2b1797dc1db5cc9f4 (diff) |
More options refactoring (OOV Handling this time).
Diffstat (limited to 'moses/Manager.cpp')
-rw-r--r-- | moses/Manager.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/moses/Manager.cpp b/moses/Manager.cpp index bae0e9ec3..1280adcd6 100644 --- a/moses/Manager.cpp +++ b/moses/Manager.cpp @@ -1750,11 +1750,11 @@ 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 = options().unk.mark; if (reportAllFactors == true) { out << phrase; } else { - FactorType placeholderFactor = StaticData::Instance().options().input.placeholder_factor; + FactorType placeholderFactor = options().input.placeholder_factor; std::map<size_t, const Factor*> placeholders; if (placeholderFactor != NOT_FOUND) { @@ -1774,24 +1774,19 @@ OutputSurface(std::ostream &out, const Hypothesis &edge, } } - UTIL_THROW_IF2(factor == NULL, - "No factor 0 at position " << pos); + UTIL_THROW_IF2(factor == NULL, "No factor 0 at position " << pos); //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 << options().unk.prefix << *factor << options().unk.suffix; } else { out << *factor; } for (size_t i = 1 ; i < outputFactorOrder.size() ; i++) { const Factor *factor = phrase.GetFactor(pos, outputFactorOrder[i]); - UTIL_THROW_IF2(factor == NULL, - "No factor " << i << " at position " << pos); - + UTIL_THROW_IF2(factor==NULL,"No factor "<<i<<" at position "<< pos); out << "|" << *factor; } out << " "; |