redo property API

This commit is contained in:
Hieu Hoang 2014-06-13 15:45:34 +01:00
parent 7142eb5c1f
commit e5184bc496

View File

@ -38,17 +38,12 @@ void SpanLength::Evaluate(const InputType &input
{
assert(stackVec);
boost::shared_ptr<PhraseProperty> property;
bool hasProperty = targetPhrase.GetProperty("SpanLength", property);
if (!hasProperty) {
const PhraseProperty *property = targetPhrase.GetProperty("SpanLength");
if (property == NULL) {
return;
}
PhraseProperty *prop = property.get();
SpanLengthPhraseProperty *slProp = static_cast<SpanLengthPhraseProperty*>(prop);
assert(slProp);
const SpanLengthPhraseProperty *slProp = static_cast<const SpanLengthPhraseProperty*>(property);
string str = slProp->GetValueString();
const Phrase *ruleSource = targetPhrase.GetRuleSource();