diff options
Diffstat (limited to 'moses/FF')
-rw-r--r-- | moses/FF/GlobalLexicalModel.cpp | 4 | ||||
-rw-r--r-- | moses/FF/GlobalLexicalModel.h | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/moses/FF/GlobalLexicalModel.cpp b/moses/FF/GlobalLexicalModel.cpp index 30cf4444d..d47aeb981 100644 --- a/moses/FF/GlobalLexicalModel.cpp +++ b/moses/FF/GlobalLexicalModel.cpp @@ -43,7 +43,7 @@ GlobalLexicalModel::~GlobalLexicalModel() // delete words in the hash data structure DoubleHash::const_iterator iter; for(iter = m_hash.begin(); iter != m_hash.end(); iter++ ) { - boost::unordered_map< const Word*, float, WordComparer, WordComparer>::const_iterator iter2; + boost::unordered_map< const Word*, float, UnorderedComparer<Word>, UnorderedComparer<Word> >::const_iterator iter2; for(iter2 = iter->second.begin(); iter2 != iter->second.end(); iter2++ ) { delete iter2->first; // delete input word } @@ -134,7 +134,7 @@ float GlobalLexicalModel::ScorePhrase( const TargetPhrase& targetPhrase ) const sum += inputWordHash->second; } - set< const Word*, WordComparer > alreadyScored; // do not score a word twice + boost::unordered_set< const Word*, UnorderedComparer<Word>, UnorderedComparer<Word> > alreadyScored; // do not score a word twice for(size_t inputIndex = 0; inputIndex < input.GetSize(); inputIndex++ ) { const Word& inputWord = input.GetWord( inputIndex ); if ( alreadyScored.find( &inputWord ) == alreadyScored.end() ) { diff --git a/moses/FF/GlobalLexicalModel.h b/moses/FF/GlobalLexicalModel.h index 9889b1824..51284863d 100644 --- a/moses/FF/GlobalLexicalModel.h +++ b/moses/FF/GlobalLexicalModel.h @@ -33,8 +33,10 @@ class InputType; */ class GlobalLexicalModel : public StatelessFeatureFunction { - typedef boost::unordered_map< const Word*, boost::unordered_map< const Word*, float, WordComparer, WordComparer >, WordComparer, WordComparer > DoubleHash; - typedef boost::unordered_map< const Word*, float, WordComparer, WordComparer > SingleHash; + typedef boost::unordered_map< const Word*, + boost::unordered_map< const Word*, float, UnorderedComparer<Word> , UnorderedComparer<Word> >, + UnorderedComparer<Word>, UnorderedComparer<Word> > DoubleHash; + typedef boost::unordered_map< const Word*, float, UnorderedComparer<Word>, UnorderedComparer<Word> > SingleHash; typedef std::map< const TargetPhrase*, float > LexiconCache; struct ThreadLocalStorage { |