diff --git a/contrib/other-builds/moses2/SubPhrase.cpp b/contrib/other-builds/moses2/SubPhrase.cpp index 5635e59b3..4d3c20f14 100644 --- a/contrib/other-builds/moses2/SubPhrase.cpp +++ b/contrib/other-builds/moses2/SubPhrase.cpp @@ -11,28 +11,7 @@ using namespace std; namespace Moses2 { -const Word &SubPhrase::operator[](size_t pos) const -{ - return (*m_origPhrase)[pos + m_start]; -} -std::ostream& operator<<(std::ostream &out, const SubPhrase &obj) -{ - if (obj.GetSize()) { - out << obj[0]; - for (size_t i = 1; i < obj.GetSize(); ++i) { - const Word &word = obj[i]; - out << " " << word; - } - } - return out; -} - -SubPhrase SubPhrase::GetSubPhrase(size_t start, size_t size) const -{ - SubPhrase ret(*m_origPhrase, m_start + start, m_size); - return ret; -} } diff --git a/contrib/other-builds/moses2/SubPhrase.h b/contrib/other-builds/moses2/SubPhrase.h index e6dccd710..d0f893eaa 100644 --- a/contrib/other-builds/moses2/SubPhrase.h +++ b/contrib/other-builds/moses2/SubPhrase.h @@ -14,19 +14,35 @@ public: ,m_size(size) {} - virtual const Word& operator[](size_t pos) const; + virtual const Word& operator[](size_t pos) const + { return (*m_origPhrase)[pos + m_start]; } virtual size_t GetSize() const - { - return m_size; - } + { return m_size; } - SubPhrase GetSubPhrase(size_t start, size_t size) const; + SubPhrase GetSubPhrase(size_t start, size_t size) const + { + SubPhrase ret(*m_origPhrase, m_start + start, m_size); + return ret; + } protected: const Phrase *m_origPhrase; size_t m_start, m_size; }; +/////////////////////////////////////////////////////// +std::ostream& operator<<(std::ostream &out, const SubPhrase &obj) +{ + if (obj.GetSize()) { + out << obj[0]; + for (size_t i = 1; i < obj.GetSize(); ++i) { + const Word &word = obj[i]; + out << " " << word; + } + } + return out; +} + }