• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Monodoc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Bits

		public override System.Collections.BitArray Bits(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			if (cache == null)
			{
				cache = new System.Collections.Hashtable();
			}
			
			lock (cache.SyncRoot)
			{
				// check cache
				System.Collections.BitArray cached = (System.Collections.BitArray) cache[reader];
				if (cached != null)
				{
					return cached;
				}
			}
			
			System.Collections.BitArray bits = filter.Bits(reader);
			
			lock (cache.SyncRoot)
			{
				// update cache
				cache[reader] = bits;
			}
			
			return bits;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:27,代码来源:CachingWrapperFilter.cs


示例2: InitBlock

			private void  InitBlock(System.Collections.BitArray bits, int[] totalHits, Monodoc.Lucene.Net.Search.FieldSortedHitQueue hq, IndexSearcher enclosingInstance)
			{
				this.bits = bits;
				this.totalHits = totalHits;
				this.hq = hq;
				this.enclosingInstance = enclosingInstance;
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:IndexSearcher.cs


示例3: Bits

		public override System.Collections.BitArray Bits(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			
			if (cache == null)
			{
				cache = new System.Collections.Hashtable();
			}
			
			lock (cache.SyncRoot)
			{
				// check cache
				System.Collections.BitArray cached = (System.Collections.BitArray) cache[reader];
				if (cached != null)
				{
					return cached;
				}
			}
			
			System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
			
			new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));
			
			lock (cache.SyncRoot)
			{
				// update cache
				cache[reader] = bits;
			}
			
			return bits;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:30,代码来源:QueryFilter.cs


示例4: InitBlock

			private void  InitBlock(Monodoc.Lucene.Net.Index.IndexReader reader, SpanNotQuery enclosingInstance)
			{
				this.reader = reader;
				this.enclosingInstance = enclosingInstance;
				includeSpans = Enclosing_Instance.include.GetSpans(reader);
				excludeSpans = Enclosing_Instance.exclude.GetSpans(reader);
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:SpanNotQuery.cs


示例5: Rewrite

		public override Query Rewrite(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			BooleanQuery query = new BooleanQuery();
			TermEnum enumerator = reader.Terms(prefix);
			try
			{
				System.String prefixText = prefix.Text();
				System.String prefixField = prefix.Field();
				do 
				{
					Term term = enumerator.Term();
					if (term != null && term.Text().StartsWith(prefixText) && (System.Object) term.Field() == (System.Object) prefixField)
					{
						TermQuery tq = new TermQuery(term); // found a match
						tq.SetBoost(GetBoost()); // set the boost
						query.Add(tq, false, false); // add to query
						//System.out.println("added " + term);
					}
					else
					{
						break;
					}
				}
				while (enumerator.Next());
			}
			finally
			{
				enumerator.Close();
			}
			return query;
		}
开发者ID:emtees,项目名称:old-code,代码行数:31,代码来源:PrefixQuery.cs


示例6: MultiSearcher

		/// <summary>Creates a searcher which searches <i>searchables</i>. </summary>
		public MultiSearcher(Monodoc.Lucene.Net.Search.Searchable[] searchables)
		{
			this.searchables = searchables;
			
			starts = new int[searchables.Length + 1]; // build starts array
			for (int i = 0; i < searchables.Length; i++)
			{
				starts[i] = maxDoc;
				maxDoc += searchables[i].MaxDoc(); // compute maxDocs
			}
			starts[searchables.Length] = maxDoc;
		}
开发者ID:emtees,项目名称:old-code,代码行数:13,代码来源:MultiSearcher.cs


示例7: InitBlock

			private void  InitBlock(Monodoc.Lucene.Net.Index.IndexReader reader, SpanOrQuery enclosingInstance)
			{
				this.reader = reader;
				this.enclosingInstance = enclosingInstance;
				all = new System.Collections.ArrayList(Enclosing_Instance.clauses.Count);
				queue = new SpanQueue(enclosingInstance, Enclosing_Instance.clauses.Count);
				System.Collections.IEnumerator i = Enclosing_Instance.clauses.GetEnumerator();
				while (i.MoveNext())
				{
					// initialize all
					all.Add(((SpanQuery) i.Current).GetSpans(reader));
				}
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:SpanOrQuery.cs


示例8: Initialize

		private void  Initialize(Monodoc.Lucene.Net.Index.IndexReader[] subReaders)
		{
			this.subReaders = subReaders;
			starts = new int[subReaders.Length + 1]; // build starts array
			for (int i = 0; i < subReaders.Length; i++)
			{
				starts[i] = maxDoc;
				maxDoc += subReaders[i].MaxDoc(); // compute maxDocs
				
				if (subReaders[i].HasDeletions())
					hasDeletions = true;
			}
			starts[subReaders.Length] = maxDoc;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:14,代码来源:MultiReader.cs


示例9: Rewrite

		/// <summary> FIXME: Describe <code>rewrite</code> method here.
		/// 
		/// </summary>
		/// <param name="reader">an <code>Monodoc.Lucene.Net.Index.IndexReader</code> value
		/// </param>
		/// <returns> a <code>Query</code> value
		/// </returns>
		/// <exception cref=""> IOException if an error occurs
		/// </exception>
		public override Query Rewrite(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			
			BooleanQuery query = new BooleanQuery();
			TermEnum enumerator = reader.Terms(lowerTerm);
			
			try
			{
				
				bool checkLower = false;
				if (!inclusive)
				// make adjustments to set to exclusive
					checkLower = true;
				
				System.String testField = GetField();
				
				do 
				{
					Term term = enumerator.Term();
					if (term != null && (System.Object) term.Field() == (System.Object) testField)
					{
						if (!checkLower || String.CompareOrdinal(term.Text(), lowerTerm.Text()) > 0)
						{
							checkLower = false;
							if (upperTerm != null)
							{
								int compare = String.CompareOrdinal(upperTerm.Text(), term.Text());
								/* if beyond the upper term, or is exclusive and
								* this is equal to the upper term, break out */
								if ((compare < 0) || (!inclusive && compare == 0))
									break;
							}
							TermQuery tq = new TermQuery(term); // found a match
							tq.SetBoost(GetBoost()); // set the boost
							query.Add(tq, false, false); // add to query
						}
					}
					else
					{
						break;
					}
				}
				while (enumerator.Next());
			}
			finally
			{
				enumerator.Close();
			}
			return query;
		}
开发者ID:emtees,项目名称:old-code,代码行数:59,代码来源:RangeQuery.cs


示例10: SegmentMergeInfo

		internal int[] docMap = null; // maps around deleted docs
		
		internal SegmentMergeInfo(int b, TermEnum te, Monodoc.Lucene.Net.Index.IndexReader r)
		{
			base_Renamed = b;
			reader = r;
			termEnum = te;
			term = te.Term();
			postings = reader.TermPositions();
			
			// build array which maps document numbers around deletions 
			if (reader.HasDeletions())
			{
				int maxDoc = reader.MaxDoc();
				docMap = new int[maxDoc];
				int j = 0;
				for (int i = 0; i < maxDoc; i++)
				{
					if (reader.IsDeleted(i))
						docMap[i] = - 1;
					else
						docMap[i] = j++;
				}
			}
		}
开发者ID:emtees,项目名称:old-code,代码行数:25,代码来源:SegmentMergeInfo.cs


示例11: WildcardTermEnum

		/// <summary> Creates a new <code>WildcardTermEnum</code>.  Passing in a
		/// {@link Monodoc.Lucene.Net.Index.Term Term} that does not contain a
		/// <code>WILDCARD_CHAR</code> will cause an exception to be thrown.
		/// </summary>
		public WildcardTermEnum(Monodoc.Lucene.Net.Index.IndexReader reader, Term term):base()
		{
			searchTerm = term;
			field = searchTerm.Field();
			text = searchTerm.Text();
			
			int sidx = text.IndexOf((System.Char) WILDCARD_STRING);
			int cidx = text.IndexOf((System.Char) WILDCARD_CHAR);
			int idx = sidx;
			if (idx == - 1)
			{
				idx = cidx;
			}
			else if (cidx >= 0)
			{
				idx = System.Math.Min(idx, cidx);
			}
			
			pre = searchTerm.Text().Substring(0, (idx) - (0));
			preLen = pre.Length;
			text = text.Substring(preLen);
			SetEnum(reader.Terms(new Term(searchTerm.Field(), pre)));
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:27,代码来源:WildcardTermEnum.cs


示例12: Rewrite

		public override Query Rewrite(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			FilteredTermEnum enumerator = GetEnum(reader);
			BooleanQuery query = new BooleanQuery();
			try
			{
				do 
				{
					Term t = enumerator.Term();
					if (t != null)
					{
						TermQuery tq = new TermQuery(t); // found a match
						tq.SetBoost(GetBoost() * enumerator.Difference()); // set the boost
						query.Add(tq, false, false); // add to query
					}
				}
				while (enumerator.Next());
			}
			finally
			{
				enumerator.Close();
			}
			return query;
		}
开发者ID:emtees,项目名称:old-code,代码行数:24,代码来源:MultiTermQuery.cs


示例13: AnonymousClassSpans

			public AnonymousClassSpans(Monodoc.Lucene.Net.Index.IndexReader reader, SpanOrQuery enclosingInstance)
			{
				InitBlock(reader, enclosingInstance);
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:SpanOrQuery.cs


示例14: GetSpans

		public override Spans GetSpans(Monodoc.Lucene.Net.Index.IndexReader reader)
		{
			if (clauses.Count == 1)
			// optimize 1-clause case
				return ((SpanQuery) clauses[0]).GetSpans(reader);
			
			return new AnonymousClassSpans(reader, this);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:SpanOrQuery.cs


示例15: Explain

			public virtual Explanation Explain(Monodoc.Lucene.Net.Index.IndexReader reader, int doc)
			{
				Explanation result = new Explanation();
				result.SetDescription("weight(" + Query + " in " + doc + "), product of:");
				
				Explanation idfExpl = new Explanation(idf, "idf(" + Query + ")");
				
				// explain query weight
				Explanation queryExpl = new Explanation();
				queryExpl.SetDescription("queryWeight(" + Query + "), product of:");
				
				Explanation boostExpl = new Explanation(Enclosing_Instance.GetBoost(), "boost");
				if (Enclosing_Instance.GetBoost() != 1.0f)
					queryExpl.AddDetail(boostExpl);
				
				queryExpl.AddDetail(idfExpl);
				
				Explanation queryNormExpl = new Explanation(queryNorm, "queryNorm");
				queryExpl.AddDetail(queryNormExpl);
				
				queryExpl.SetValue(boostExpl.GetValue() * idfExpl.GetValue() * queryNormExpl.GetValue());
				
				result.AddDetail(queryExpl);
				
				// explain Field weight
				Explanation fieldExpl = new Explanation();
				fieldExpl.SetDescription("fieldWeight(" + Query + " in " + doc + "), product of:");
				
				Explanation tfExpl = Scorer(reader).Explain(doc);
				fieldExpl.AddDetail(tfExpl);
				fieldExpl.AddDetail(idfExpl);
				
				Explanation fieldNormExpl = new Explanation();
				byte[] fieldNorms = reader.Norms(Enclosing_Instance.field);
				float fieldNorm = fieldNorms != null?Similarity.DecodeNorm(fieldNorms[doc]):0.0f;
				fieldNormExpl.SetValue(fieldNorm);
				fieldNormExpl.SetDescription("fieldNorm(Field=" + Enclosing_Instance.field + ", doc=" + doc + ")");
				fieldExpl.AddDetail(fieldNormExpl);
				
				fieldExpl.SetValue(tfExpl.GetValue() * idfExpl.GetValue() * fieldNormExpl.GetValue());
				
				result.AddDetail(fieldExpl);
				
				// combine them
				result.SetValue(queryExpl.GetValue() * fieldExpl.GetValue());
				
				if (queryExpl.GetValue() == 1.0f)
					return fieldExpl;
				
				return result;
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:51,代码来源:PhrasePrefixQuery.cs


示例16: 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


示例17: GetEnum

 protected internal override FilteredTermEnum GetEnum(Monodoc.Lucene.Net.Index.IndexReader reader)
 {
     return new FuzzyTermEnum(reader, GetTerm(), minimumSimilarity, prefixLength);
 }
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:FuzzyQuery.cs


示例18: Bits

		/// <summary>Returns a BitSet with true for documents which should be permitted in
		/// search results, and false for those that should not. 
		/// </summary>
		public abstract System.Collections.BitArray Bits(Monodoc.Lucene.Net.Index.IndexReader reader);
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:Filter.cs


示例19: AnonymousClassWith1

			internal AnonymousClassWith1(Monodoc.Lucene.Net.Index.IndexReader enclosingInstance, Lucene.Net.Store.Lock Param1, long Param2) : base(Param1, Param2)
			{
				InitBlock(enclosingInstance);
			}
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:IndexReader.cs


示例20: InitBlock

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Monster类代码示例发布时间:2022-05-24
下一篇:
C# UIKit.UILabel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap