diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-10 06:17:36 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-11 04:09:22 +0300 |
commit | 29694af6e43c1cec7a6fd0b157eb44faca706129 (patch) | |
tree | acda250a83c5a3a4244be011f1f4b9e6337f5d6b /moses/WordLattice.cpp | |
parent | 240b88c6834c9c94e8a6448a34dc4ad33bdf3fbd (diff) |
Code cleanup and refactoring.
Diffstat (limited to 'moses/WordLattice.cpp')
-rw-r--r-- | moses/WordLattice.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/moses/WordLattice.cpp b/moses/WordLattice.cpp index c4d4808e3..01f8eac9f 100644 --- a/moses/WordLattice.cpp +++ b/moses/WordLattice.cpp @@ -52,18 +52,15 @@ void WordLattice::Print(std::ostream& out) const int WordLattice:: -InitializeFromPCNDataType -(const PCN::CN& cn, size_t const maxPhraseLength, - const std::vector<FactorType>& factorOrder, - const std::string& debug_line) +InitializeFromPCNDataType(const PCN::CN& cn, const std::string& debug_line) { - // const StaticData &staticData = StaticData::Instance(); + const std::vector<FactorType>& factorOrder = m_options->input.factor_order; + size_t const maxPhraseLength = m_options->search.max_phrase_length; + const InputFeature *inputFeature = InputFeature::InstancePtr(); size_t numInputScores = inputFeature->GetNumInputScores(); size_t numRealWordCount = inputFeature->GetNumRealWordsInInput(); - // size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength(); - bool addRealWordCount = (numRealWordCount > 0); //when we have one more weight than params, we add a word count feature @@ -150,9 +147,7 @@ InitializeFromPCNDataType int WordLattice:: -Read(std::istream& in, - std::vector<FactorType> const& factorOrder, - AllOptions const& opts) +Read(std::istream& in) { Clear(); std::string line; @@ -163,8 +158,7 @@ Read(std::istream& in, } PCN::CN cn = PCN::parsePCN(line); - return InitializeFromPCNDataType(cn, opts.search.max_phrase_length, - factorOrder, line); + return InitializeFromPCNDataType(cn, line); } void WordLattice::GetAsEdgeMatrix(std::vector<std::vector<bool> >& edges) const @@ -228,17 +222,10 @@ TranslationOptionCollection* WordLattice ::CreateTranslationOptionCollection(ttasksptr const& ttask) const { - // size_t maxNoTransOptPerCoverage = StaticData::Instance().GetMaxNoTransOptPerCoverage(); - // float translationOptionThreshold = StaticData::Instance().GetTranslationOptionThreshold(); - - size_t maxNoTransOptPerCoverage = ttask->options()->search.max_trans_opt_per_cov; - // StaticData::Instance().GetMaxNoTransOptPerCoverage(); + size_t maxNoTransOptPerCoverage = ttask->options()->search.max_trans_opt_per_cov; float translationOptionThreshold = ttask->options()->search.trans_opt_threshold; - // StaticData::Instance().GetTranslationOptionThreshold(); - TranslationOptionCollection *rv = NULL; - //rv = new TranslationOptionCollectionConfusionNet(*this, maxNoTransOptPerCoverage, translationOptionThreshold); if (StaticData::Instance().GetUseLegacyPT()) { rv = new TranslationOptionCollectionConfusionNet(ttask, *this, maxNoTransOptPerCoverage, translationOptionThreshold); |