diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-08-01 20:27:08 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-08-01 20:27:08 +0400 |
commit | c345a0ff841145a43ee5a7629beff3a428b22530 (patch) | |
tree | 2416b62f09a295c9131c2b79172cf58d0b3fecb2 | |
parent | 9304d7146996dd9b74d9fc007cb7e57a215af6c6 (diff) |
delete unecessary unknown words list
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@447 1f5c12ca-751b-0410-a591-d2e778427230
-rw-r--r-- | moses/src/TranslationOptionCollection.cpp | 8 | ||||
-rwxr-xr-x | moses/src/TranslationOptionCollection.h | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/moses/src/TranslationOptionCollection.cpp b/moses/src/TranslationOptionCollection.cpp index 979634555..28b539259 100644 --- a/moses/src/TranslationOptionCollection.cpp +++ b/moses/src/TranslationOptionCollection.cpp @@ -482,8 +482,8 @@ void TranslationOptionCollection::ProcessOneUnknownWord(const FactorArray &sourc if (!dropUnknown || isDigit) { // add to dictionary - TargetPhrase targetPhraseOrig(Output); - FactorArray &targetWord = targetPhraseOrig.AddWord(); + TargetPhrase targetPhrase(Output); + FactorArray &targetWord = targetPhrase.AddWord(); for (unsigned int currFactor = 0 ; currFactor < NUM_FACTORS ; currFactor++) { @@ -496,10 +496,8 @@ void TranslationOptionCollection::ProcessOneUnknownWord(const FactorArray &sourc targetWord[factorType] = factorCollection.AddFactor(Output, factorType, sourceFactor->GetString()); } - targetPhraseOrig.SetScore(weightWordPenalty); + targetPhrase.SetScore(weightWordPenalty); - pair< set<TargetPhrase>::iterator, bool> inserted = m_unknownTargetPhrase.insert(targetPhraseOrig); - const TargetPhrase &targetPhrase = *inserted.first; transOpt = new TranslationOption(WordsRange(sourcePos, sourcePos), targetPhrase, 0); } else diff --git a/moses/src/TranslationOptionCollection.h b/moses/src/TranslationOptionCollection.h index 344b4c31a..a231b2add 100755 --- a/moses/src/TranslationOptionCollection.h +++ b/moses/src/TranslationOptionCollection.h @@ -48,8 +48,6 @@ protected: InputType const &m_source; SquareMatrix m_futureScore; WordsBitmap m_unknownWordPos; - std::set<TargetPhrase> m_unknownTargetPhrase; - // make sure phrase doesn't go out of memory while we're using it const size_t m_maxNoTransOptPerCoverage; const LMList *m_allLM; |