本文整理汇总了C#中Sentence.GetSentenceTextFromElements方法的典型用法代码示例。如果您正苦于以下问题:C# Sentence.GetSentenceTextFromElements方法的具体用法?C# Sentence.GetSentenceTextFromElements怎么用?C# Sentence.GetSentenceTextFromElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentence
的用法示例。
在下文中一共展示了Sentence.GetSentenceTextFromElements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformPreprocessing
public override string PerformPreprocessing(Sentence sentenceForPreprocess)
{
var colons = sentenceForPreprocess.ElementList.FindAll(x => x.ElementType.Value == ComprenoSentenceElementType.Punctuator_Colon.Value);
log.InfoFormat("Found {0} colon(s) in sentence", colons.Count);
foreach (var colon in colons)
_processColon(colon, sentenceForPreprocess.ElementList);
return sentenceForPreprocess.GetSentenceTextFromElements();
}
示例2: PerformPreprocessing
public override string PerformPreprocessing(Sentence sentenceForPreprocess)
{
var predicateElements = sentenceForPreprocess.ElementList.FindAll(x => x.SyntacticRole.Value == LWS.Compreno.FormatEntities.SyntacticRole.Predicate.Value);
if (predicateElements.Count > 0)
foreach (var predicateElement in predicateElements)
_processPredicate(predicateElement, sentenceForPreprocess.ElementList);
else
log.WarnFormat("During processing with {0} predicates were not found. Sentence is not changed", Name);
return sentenceForPreprocess.GetSentenceTextFromElements();
}
示例3: PerformPreprocessing
public override string PerformPreprocessing(Sentence sentenceForPreprocess)
{
var result = sentenceForPreprocess.SentenceText;
// ищем вставки
var insertsList = new SentenceInsertBlocks(sentenceForPreprocess);
log.InfoFormat("Inserts found count is {0}. Data is {1}{2}", insertsList.Enumerations.Count, Environment.NewLine, insertsList.ToString());
foreach (var insert in insertsList.Enumerations)
{
if (insert.Value.IsMainWordPresented)
{
sentenceForPreprocess.ElementList.RemoveAll(x => x.Order == insert.Value.EndElementOrder);
sentenceForPreprocess.ElementList.Find(x => x.Order == insert.Value.StartElementOrder).Text = ReplaceStringForOpenBracket;
}
else
sentenceForPreprocess.ElementList.RemoveAll(x => (x.Order >= insert.Value.StartElementOrder && x.Order <= insert.Value.EndElementOrder));
}
result = sentenceForPreprocess.GetSentenceTextFromElements();
return result;
}