当前位置: 首页>>代码示例>>C#>>正文


C# Sentence.GetSentenceTextFromElements方法代码示例

本文整理汇总了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();
        }
开发者ID:Ogonik,项目名称:LWS,代码行数:10,代码来源:EnumerationsPreprocessingAlgorithm.cs

示例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();
        }
开发者ID:Ogonik,项目名称:LWS,代码行数:11,代码来源:PredicateReplacementProcessingAlgorithm.cs

示例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;
        }
开发者ID:Ogonik,项目名称:LWS,代码行数:21,代码来源:InsertsPreprocessingAlgorithm.cs


注:本文中的Sentence.GetSentenceTextFromElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。