diff --git a/mira/Decoder.cpp b/mira/Decoder.cpp index 3dea97f24e..2f2beede0e 100644 --- a/mira/Decoder.cpp +++ b/mira/Decoder.cpp @@ -106,7 +106,7 @@ vector< vector > MosesDecoder::getNBest(const std::string& source, string filename) { StaticData &staticData = StaticData::InstanceNonConst(); - bool chartDecoding = (staticData.GetSearchAlgorithm() == ChartDecoding); + bool chartDecoding = staticData.IsChart(); initialize(staticData, source, sentenceid, bleuObjectiveWeight, bleuScoreWeight, avgRefLength, chartDecoding); // run the decoder @@ -269,7 +269,7 @@ void MosesDecoder::outputNBestList(const std::string& source, size_t sentenceid, bool distinctNbest, bool avgRefLength, string filename, ofstream& streamOut) { StaticData &staticData = StaticData::InstanceNonConst(); - bool chartDecoding = (staticData.GetSearchAlgorithm() == ChartDecoding); + bool chartDecoding = staticData.IsChart(); initialize(staticData, source, sentenceid, bleuObjectiveWeight, bleuScoreWeight, avgRefLength, chartDecoding); if (chartDecoding) { diff --git a/mira/Main.cpp b/mira/Main.cpp index 0dbc9be43e..0e6001672a 100644 --- a/mira/Main.cpp +++ b/mira/Main.cpp @@ -416,8 +416,7 @@ int main(int argc, char** argv) decoder->setBleuParameters(disableBleuFeature, sentenceBleu, scaleByInputLength, scaleByAvgInputLength, scaleByInverseLength, scaleByAvgInverseLength, scaleByX, historySmoothing, bleu_smoothing_scheme, simpleHistoryBleu); - SearchAlgorithm searchAlgorithm = staticData.GetSearchAlgorithm(); - bool chartDecoding = (searchAlgorithm == ChartDecoding); + bool chartDecoding = staticData.IsChart(); // Optionally shuffle the sentences vector order; @@ -1800,7 +1799,7 @@ void decodeHopeOrFear(size_t rank, size_t size, size_t decode, string filename, vector< vector > nbestOutput = decoder->getNBest(input, sid, n, factor, bleuWeight, dummyFeatureValues[0], dummyBleuScores[0], dummyModelScores[0], n, realBleu, true, false, rank, 0, ""); cerr << endl; - decoder->cleanup(StaticData::Instance().GetSearchAlgorithm() == ChartDecoding); + decoder->cleanup(StaticData::Instance().IsChart()); for (size_t i = 0; i < nbestOutput.size(); ++i) { vector output = nbestOutput[i]; diff --git a/moses/FF/BleuScoreFeature.cpp b/moses/FF/BleuScoreFeature.cpp index e2e0b1317f..cdc0fd6b5f 100644 --- a/moses/FF/BleuScoreFeature.cpp +++ b/moses/FF/BleuScoreFeature.cpp @@ -24,10 +24,7 @@ int BleuScoreState::Compare(const FFState& o) const if (&o == this) return 0; - const StaticData &staticData = StaticData::Instance(); - SearchAlgorithm searchAlgorithm = staticData.GetSearchAlgorithm(); - bool chartDecoding = (searchAlgorithm == ChartDecoding); - if (chartDecoding) + if (StaticData::Instance().IsChart()) return 0; const BleuScoreState& other = dynamic_cast(o);