git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@968 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
abarun 2006-11-09 17:04:47 +00:00
parent 4e2f8cf550
commit c140de307e
3 changed files with 19 additions and 0 deletions

View File

@ -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<string> > Phrase::Parse(const std::string &phraseString, const std::vector<FactorType> &factorOrder, const std::string& factorDelimiter)
{
bool isMultiCharDelimiter = factorDelimiter.size() > 1;

View File

@ -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);
};

View File

@ -68,6 +68,15 @@ public:
|| (m_startPos==x.m_startPos && m_endPos<x.m_endPos));
}
// Whether 2 word ranges overlap or not
inline bool Overlap(const WordsRange& x) const
{
if ( x.m_endPos < m_startPos || x.m_startPos > m_endPos) return false;
return true;
}
TO_STRING();
};