diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-07-02 01:30:29 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-07-02 01:30:29 +0400 |
commit | bff761b6053eb62adae6808b52fa67f29a4cf5f3 (patch) | |
tree | 16525060c87d61cbbc508e0a893639f0190b68f3 /moses/TranslationOptionCollection.h | |
parent | 4e773acd5fa2e64e246fdb8bf700cab64190e933 (diff) |
a little bit more towards using prefix subphrase to optimize translation model lookup
Diffstat (limited to 'moses/TranslationOptionCollection.h')
-rw-r--r-- | moses/TranslationOptionCollection.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/moses/TranslationOptionCollection.h b/moses/TranslationOptionCollection.h index 5a1518e63..732e11be9 100644 --- a/moses/TranslationOptionCollection.h +++ b/moses/TranslationOptionCollection.h @@ -53,16 +53,19 @@ This is for both sentence input, and confusion network/lattices class InputLatticeNode { protected: + const InputLatticeNode *m_prevNode; Phrase m_phrase; WordsRange m_range; - std::map<const PhraseDictionary*, const TargetPhraseCollection *> m_targetPhrases; + std::map<const PhraseDictionary*, std::pair<const TargetPhraseCollection*, void*> > m_targetPhrases; public: InputLatticeNode() - :m_range(NOT_FOUND, NOT_FOUND) + : m_prevNode(NULL) + , m_range(NOT_FOUND, NOT_FOUND) {} - InputLatticeNode(const Phrase &phrase, const WordsRange &range) - :m_phrase(phrase) + InputLatticeNode(const Phrase &phrase, const WordsRange &range, const InputLatticeNode *prevNode) + :m_prevNode(prevNode) + ,m_phrase(phrase) ,m_range(range) { } @@ -73,8 +76,11 @@ public: return m_range; } - void SetTargetPhrases(const PhraseDictionary &phraseDictionary, const TargetPhraseCollection *targetPhrases) { - m_targetPhrases[&phraseDictionary] = targetPhrases; + void SetTargetPhrases(const PhraseDictionary &phraseDictionary + , const TargetPhraseCollection *targetPhrases + , void *ptNode) { + std::pair<const TargetPhraseCollection*, void*> value(targetPhrases, ptNode); + m_targetPhrases[&phraseDictionary] = value; } const TargetPhraseCollection *GetTargetPhrases(const PhraseDictionary &phraseDictionary) const; |