diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-07-19 18:38:13 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-07-19 18:38:13 +0400 |
commit | b7b23dd703ca3bd6bb382092e59d89a387de7bcd (patch) | |
tree | 222047f14a8358f8e3a1225093de043e9438ba2f /moses/AlignmentInfo.cpp | |
parent | 116f1dcd41908772848ea0fee076eed28fd7566b (diff) |
starting placeholder
Diffstat (limited to 'moses/AlignmentInfo.cpp')
-rw-r--r-- | moses/AlignmentInfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/moses/AlignmentInfo.cpp b/moses/AlignmentInfo.cpp index 178f3438a..882e51a34 100644 --- a/moses/AlignmentInfo.cpp +++ b/moses/AlignmentInfo.cpp @@ -53,9 +53,22 @@ void AlignmentInfo::BuildNonTermIndexMap() } m_nonTermIndexMap[p->second] = i++; } +} +std::set<size_t> AlignmentInfo::GetAlignmentsForSource(size_t sourcePos) const +{ + std::set<size_t> ret; + CollType::const_iterator iter; + for (iter = begin(); iter != end(); ++iter) { + const std::pair<size_t,size_t> &align = *iter; + if (iter->first == sourcePos) { + ret.insert(iter->second); + } + } + return ret; } + bool compare_target(const std::pair<size_t,size_t> *a, const std::pair<size_t,size_t> *b) { if(a->second < b->second) return true; |