mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 20:46:59 +03:00
ijik
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@968 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
4e2f8cf550
commit
c140de307e
@ -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;
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user