Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-11-12 16:12:25 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-11-12 16:12:25 +0300
commit28eee66d6ed38a3d1eea1114df2cdedbacd16f90 (patch)
tree0eb48a5c740c6c33ecc3e57cd49480341908e705 /moses/Hypothesis.cpp
parentbd73cfd377cd93d57a209a3814316198236ebb8c (diff)
parentdad1bd6127115cda89158c4c8fcf35cc4451218c (diff)
Merge ../mosesdecoder into perf_moses2
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r--moses/Hypothesis.cpp15
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;
}