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


C# ITsString.ToWsOnlyString方法代码示例

本文整理汇总了C#中ITsString.ToWsOnlyString方法的典型用法代码示例。如果您正苦于以下问题:C# ITsString.ToWsOnlyString方法的具体用法?C# ITsString.ToWsOnlyString怎么用?C# ITsString.ToWsOnlyString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITsString的用法示例。


在下文中一共展示了ITsString.ToWsOnlyString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateOrReuseAnnotation

		/// <summary>
		///
		/// </summary>
		/// <param name="tssWordTextIn"></param>
		/// <param name="ichMin"></param>
		/// <param name="ichLim"></param>
		/// <param name="iWfAnalysis">index of the analysis we will create in the overall list of wordform analyses for the paragraph.</param>
		/// <param name="tssWordAnn">the wordform of the matching annotation (could be a phrase).</param>
		/// <returns>the new or reused annotation id</returns>
		private IAnalysis CreateOrReuseAnnotation(ITsString tssWordTextIn, int ichMin, int ichLim, int iWfAnalysis, out ITsString tssWordAnn)
		{
			ITsString tssWordText = tssWordTextIn.ToWsOnlyString();
			// First see if we can find a real annotation we can reuse for the wordform or alternative case.
			IWfiWordform wf;
			IAnalysis analysis;
			TryReuseAnalysis(tssWordText, ichMin, ichLim, iWfAnalysis, out wf, out tssWordAnn, out analysis);
			if (tssWordAnn.Length == 0)
				tssWordAnn = tssWordText;
			// check to see if we can match a user-confirmed phrase to establish a user based guess.
			// if we didn't find a real annotation or it's only an annotation for a WfiWordform.
			if (!SegmentFormCollectionMode && PossiblePhrases.Count > 0 && HasTrivialAnalysis(analysis))
			{
				ITsString tssPhrase;
				if (TryCreatePhrase(tssWordText, ichMin, iWfAnalysis, tssWordAnn.Length, out tssPhrase))
				{
					tssWordAnn = tssPhrase;
					analysis = null;	// indicates the need to create a new annotation.
				}
			}

			// When searching for existing Wordforms, include lower-case forms when the beginning index is 0 or 1
			// (in case of leading quote etc (one but not two), but still safe for one-letter initial word).
			var isFirstWord = ichMin < 2;

			// if we couldn't find an existing annotation to use, try to create one.
			return analysis ?? FindOrCreateWordform(tssWordAnn, isFirstWord);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:ITextUtils.cs


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