Hi All,

I have implemented a stateless feature where I need
access to the string representation of source and
target phrase within the member function "Evaluate".
Everything works well for the target phrase, but I
get a segmentation fault when I call GetStringRep for
the source phrase (see code example below).

Has anyone some hints about what I'm doing wrong or
what I should take into account? (I'm working with
mira-mtm5-branch as codebase for sake of sparse
features)

Thanks
Sascha


/* minimal code example */

void MyFeature::Evaluate (const TargetPhrase& tp,
    ScoreComponentCollection* score) const
{
  string trg = tp.GetStringRep(m_factorsToPrint); // works well
  const Phrase *srcPhrase = tp.GetSourcePhrase(); // works well
  string src = srcPhrase->GetStringRep(m_factorsToPrint); // segfault
}

_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to