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); 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();