mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +03:00
redo property API
This commit is contained in:
parent
7142eb5c1f
commit
e5184bc496
@ -38,17 +38,12 @@ void SpanLength::Evaluate(const InputType &input
|
|||||||
{
|
{
|
||||||
assert(stackVec);
|
assert(stackVec);
|
||||||
|
|
||||||
boost::shared_ptr<PhraseProperty> property;
|
const PhraseProperty *property = targetPhrase.GetProperty("SpanLength");
|
||||||
bool hasProperty = targetPhrase.GetProperty("SpanLength", property);
|
if (property == NULL) {
|
||||||
|
|
||||||
if (!hasProperty) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PhraseProperty *prop = property.get();
|
const SpanLengthPhraseProperty *slProp = static_cast<const SpanLengthPhraseProperty*>(property);
|
||||||
SpanLengthPhraseProperty *slProp = static_cast<SpanLengthPhraseProperty*>(prop);
|
|
||||||
assert(slProp);
|
|
||||||
|
|
||||||
string str = slProp->GetValueString();
|
string str = slProp->GetValueString();
|
||||||
|
|
||||||
const Phrase *ruleSource = targetPhrase.GetRuleSource();
|
const Phrase *ruleSource = targetPhrase.GetRuleSource();
|
||||||
|
Loading…
Reference in New Issue
Block a user