mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
check that there's no epsilon
This commit is contained in:
parent
a0b6c381e0
commit
01a99d5821
@ -42,6 +42,8 @@ TranslationOptionCollectionLattice::TranslationOptionCollectionLattice(
|
||||
const ConfusionNet::Column &col = input.GetColumn(startPos);
|
||||
for (size_t i = 0; i < col.size(); ++i) {
|
||||
const Word &word = col[i].first;
|
||||
CHECK(!word.IsEpsilon());
|
||||
|
||||
Phrase subphrase;
|
||||
subphrase.AddWord(word);
|
||||
|
||||
|
@ -139,6 +139,14 @@ void Word::OnlyTheseFactors(const FactorMask &factors)
|
||||
}
|
||||
}
|
||||
|
||||
bool Word::IsEpsilon() const
|
||||
{
|
||||
const Factor *factor = m_factorArray[0];
|
||||
int compare = factor->GetString().compare(EPSILON);
|
||||
|
||||
return compare == 0;
|
||||
}
|
||||
|
||||
TO_STRING_BODY(Word);
|
||||
|
||||
// friend
|
||||
|
@ -103,6 +103,8 @@ public:
|
||||
m_isOOV = val;
|
||||
}
|
||||
|
||||
bool IsEpsilon() const;
|
||||
|
||||
/** add the factors from sourceWord into this representation,
|
||||
* NULL elements in sourceWord will be skipped */
|
||||
void Merge(const Word &sourceWord);
|
||||
|
Loading…
Reference in New Issue
Block a user