diff options
author | Jacob Dlougach <jacob@yandex-team.ru> | 2012-10-16 09:30:48 +0400 |
---|---|---|
committer | Jacob Dlougach <jacob@yandex-team.ru> | 2012-10-16 09:30:48 +0400 |
commit | 74c6cef3b3d7ad0928ad30b3c041fb9952441c6f (patch) | |
tree | 81ac08f33dff16c817bf890fc3de4af1e287bbbe | |
parent | 92b887fb845e7814a2d22b4e1a1fa0c9b52a3c93 (diff) |
Changes to make things compilechart_alignments
-rw-r--r-- | moses/src/AlignmentInfo.h | 3 | ||||
-rw-r--r-- | moses/src/Incremental/Fill.cpp | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/moses/src/AlignmentInfo.h b/moses/src/AlignmentInfo.h index dd5cb725b..4ba230cf0 100644 --- a/moses/src/AlignmentInfo.h +++ b/moses/src/AlignmentInfo.h @@ -21,7 +21,6 @@ #include <ostream> #include <set> -#include <map> #include <vector> namespace Moses @@ -34,7 +33,7 @@ class AlignmentInfoCollection; */ class AlignmentInfo { - typedef std::multimap<size_t,size_t> CollType; + typedef std::set< std::pair<size_t,size_t> > CollType; friend std::ostream& operator<<(std::ostream &, const AlignmentInfo &); friend struct AlignmentInfoOrderer; diff --git a/moses/src/Incremental/Fill.cpp b/moses/src/Incremental/Fill.cpp index 2246ea3a3..a32c7a8ea 100644 --- a/moses/src/Incremental/Fill.cpp +++ b/moses/src/Incremental/Fill.cpp @@ -33,10 +33,9 @@ template <class Model> void Fill<Model>::Add(const TargetPhraseCollection &targe } std::vector<lm::WordIndex> words; - for (TargetPhraseCollection::const_iterator i(targets.begin()); i != targets.end(); ++i) { + for (TargetPhraseCollection::const_iterator iter(targets.begin()); iter != targets.end(); ++iter) { words.clear(); - const TargetPhrase &phrase = **i; - const AlignmentInfo::NonTermIndexMap &align = phrase.GetAlignmentInfo().GetNonTermIndexMap(); + const TargetPhrase &phrase = **iter; search::PartialEdge &edge = edges_.InitializeEdge(); size_t i = 0; @@ -54,7 +53,7 @@ template <class Model> void Fill<Model>::Add(const TargetPhraseCollection &targe for (; i < phrase.GetSize(); ++i) { const Word &word = phrase.GetWord(i); if (word.IsNonTerminal()) { - edge.nt[nt++] = vertices[align[i]]; + edge.nt[nt++] = vertices[phrase.GetNonTermIndex(i)]; words.push_back(search::kNonTerminal); } else { words.push_back(Convert(word)); |