本文整理汇总了C++中Sentence::GetXMLOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ Sentence::GetXMLOptions方法的具体用法?C++ Sentence::GetXMLOptions怎么用?C++ Sentence::GetXMLOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentence
的用法示例。
在下文中一共展示了Sentence::GetXMLOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessXML
void UnknownWordPenalty::ProcessXML(
const Manager &mgr,
MemPool &pool,
const Sentence &sentence,
InputPaths &inputPaths) const
{
const Vector<const InputType::XMLOption*> &xmlOptions = sentence.GetXMLOptions();
BOOST_FOREACH(const InputType::XMLOption *xmlOption, xmlOptions) {
TargetPhraseImpl *target = TargetPhraseImpl::CreateFromString(pool, *this, mgr.system, xmlOption->GetTranslation());
if (xmlOption->prob) {
Scores &scores = target->GetScores();
scores.PlusEquals(mgr.system, *this, Moses2::TransformScore(xmlOption->prob));
}
InputPath *path = inputPaths.GetMatrix().GetValue(xmlOption->startPos, xmlOption->phraseSize - 1);
const SubPhrase<Moses2::Word> &source = path->subPhrase;
mgr.system.featureFunctions.EvaluateInIsolation(pool, mgr.system, source, *target);
TargetPhrases *tps = new (pool.Allocate<TargetPhrases>()) TargetPhrases(pool, 1);
tps->AddTargetPhrase(*target);
mgr.system.featureFunctions.EvaluateAfterTablePruning(pool, *tps, source);
path->AddTargetPhrases(*this, tps);
}