mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 06:52:34 +03:00
hiero model compatibility
This commit is contained in:
parent
44ce4b361a
commit
ef2c9dc92d
@ -29,9 +29,8 @@ public:
|
||||
{}
|
||||
|
||||
void EvaluateWhenApplied(const ChartHypothesis& hypo,
|
||||
ScoreComponentCollection*) const {
|
||||
throw std::logic_error("PhraseLengthFeature not valid in chart decoder");
|
||||
}
|
||||
ScoreComponentCollection*) const
|
||||
{}
|
||||
|
||||
void EvaluateWithSourceContext(const InputType &input
|
||||
, const InputPath &inputPath
|
||||
|
@ -83,10 +83,7 @@ void SourceWordDeletionFeature::ComputeFeatures(const Phrase &source,
|
||||
if (targetLength == 1 && sourceLength == 1 && !alignmentInfo.GetSize()) return;
|
||||
|
||||
// flag aligned words
|
||||
bool aligned[16];
|
||||
UTIL_THROW_IF2(sourceLength >= 16, "Source length must be less than 16 words");
|
||||
for(size_t i=0; i<sourceLength; i++)
|
||||
aligned[i] = false;
|
||||
std::vector<bool> aligned(sourceLength, false);
|
||||
for (AlignmentInfo::const_iterator alignmentPoint = alignmentInfo.begin(); alignmentPoint != alignmentInfo.end(); alignmentPoint++)
|
||||
aligned[ alignmentPoint->first ] = true;
|
||||
|
||||
|
@ -73,11 +73,7 @@ void TargetWordInsertionFeature::ComputeFeatures(const Phrase &source,
|
||||
if (targetLength == 1 && sourceLength == 1 && !alignmentInfo.GetSize()) return;
|
||||
|
||||
// flag aligned words
|
||||
bool aligned[16];
|
||||
UTIL_THROW_IF2(targetLength >= 16, "Target length must be less than 16 words");
|
||||
for(size_t i=0; i<targetLength; i++) {
|
||||
aligned[i] = false;
|
||||
}
|
||||
std::vector<bool> aligned(targetLength, false);
|
||||
for (AlignmentInfo::const_iterator alignmentPoint = alignmentInfo.begin(); alignmentPoint != alignmentInfo.end(); alignmentPoint++) {
|
||||
aligned[ alignmentPoint->second ] = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user