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


C# Monodoc.TermPositions方法代码示例

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


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

示例1: Scorer

			public virtual Scorer Scorer(Monodoc.Lucene.Net.Index.IndexReader reader)
			{
				if (Enclosing_Instance.termArrays.Count == 0)
				// optimize zero-term case
					return null;
				
				TermPositions[] tps = new TermPositions[Enclosing_Instance.termArrays.Count];
				for (int i = 0; i < tps.Length; i++)
				{
					Term[] terms = (Term[]) Enclosing_Instance.termArrays[i];
					
					TermPositions p;
					if (terms.Length > 1)
						p = new MultipleTermPositions(reader, terms);
					else
						p = reader.TermPositions(terms[0]);
					
					if (p == null)
						return null;
					
					tps[i] = p;
				}
				
				if (Enclosing_Instance.slop == 0)
					return new ExactPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), Enclosing_Instance.GetSimilarity(searcher), reader.Norms(Enclosing_Instance.field));
				else
					return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), Enclosing_Instance.GetSimilarity(searcher), Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:28,代码来源:PhrasePrefixQuery.cs

示例2: Scorer

			public virtual Scorer Scorer(Monodoc.Lucene.Net.Index.IndexReader reader)
			{
				if (Enclosing_Instance.terms.Count == 0)
				// optimize zero-term case
					return null;
				
				TermPositions[] tps = new TermPositions[Enclosing_Instance.terms.Count];
				for (int i = 0; i < Enclosing_Instance.terms.Count; i++)
				{
					TermPositions p = reader.TermPositions((Term) Enclosing_Instance.terms[i]);
					if (p == null)
						return null;
					tps[i] = p;
				}
				
				if (Enclosing_Instance.slop == 0)
				// optimize exact case
					return new ExactPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), Enclosing_Instance.GetSimilarity(searcher), reader.Norms(Enclosing_Instance.field));
				else
					return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), Enclosing_Instance.GetSimilarity(searcher), Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:21,代码来源:PhraseQuery.cs

示例3: MultipleTermPositions

		/// <summary> Creates a new <code>MultipleTermPositions</code> instance.
		/// 
		/// </summary>
		/// <param name="indexReader">an <code>Monodoc.Lucene.Net.Index.IndexReader</code> value
		/// </param>
		/// <param name="terms">a <code>Term[]</code> value
		/// </param>
		/// <exception cref=""> IOException if an error occurs
		/// </exception>
		public MultipleTermPositions(Monodoc.Lucene.Net.Index.IndexReader indexReader, Term[] terms)
		{
			System.Collections.IList termPositions = new System.Collections.ArrayList();
			
			for (int i = 0; i < terms.Length; i++)
				termPositions.Add(indexReader.TermPositions(terms[i]));
			
			_termPositionsQueue = new TermPositionsQueue(termPositions);
			_posList = new IntQueue();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:19,代码来源:MultipleTermPositions.cs

示例4: TermDocs

		protected internal override TermDocs TermDocs(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			return (TermDocs) reader.TermPositions();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:MultiReader.cs

示例5: InitBlock

			private void  InitBlock(Monodoc.Lucene.Net.Index.IndexReader reader, SpanTermQuery enclosingInstance)
			{
				this.reader = reader;
				this.enclosingInstance = enclosingInstance;
				positions = reader.TermPositions(Enclosing_Instance.term);
			}
开发者ID:emtees,项目名称:old-code,代码行数:6,代码来源:SpanTermQuery.cs


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