diff --git a/moses/src/Phrase.cpp b/moses/src/Phrase.cpp index 3d30b9d2d..27e39b7d3 100755 --- a/moses/src/Phrase.cpp +++ b/moses/src/Phrase.cpp @@ -150,6 +150,13 @@ Word &Phrase::AddWord() return m_words[m_phraseSize++]; } +void Phrase::Append(const Phrase &endPhrase){ + + for (int i = 0; i < endPhrase.GetSize();i++){ + AddWord(endPhrase.GetWord(i)); + } +} + vector< vector > Phrase::Parse(const std::string &phraseString, const std::vector &factorOrder, const std::string& factorDelimiter) { bool isMultiCharDelimiter = factorDelimiter.size() > 1; diff --git a/moses/src/Phrase.h b/moses/src/Phrase.h index 9f22fe206..ab01041c1 100755 --- a/moses/src/Phrase.h +++ b/moses/src/Phrase.h @@ -164,5 +164,8 @@ public: * used to insert & find phrase in dictionary */ bool operator< (const Phrase &compare) const; + + /** appends a phrase to the end of current phrase **/ + void Append(const Phrase &endPhrase); }; diff --git a/moses/src/WordsRange.h b/moses/src/WordsRange.h index 2fdf4fd5d..aa916b7bb 100755 --- a/moses/src/WordsRange.h +++ b/moses/src/WordsRange.h @@ -68,6 +68,15 @@ public: || (m_startPos==x.m_startPos && m_endPos m_endPos) return false; + + return true; + } + TO_STRING(); };