本文整理汇总了C#中Mono.Lucene.Net.Index.IndexReader.TermPositions方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.Lucene.Net.Index.IndexReader.TermPositions方法的具体用法?C# Mono.Lucene.Net.Index.IndexReader.TermPositions怎么用?C# Mono.Lucene.Net.Index.IndexReader.TermPositions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Lucene.Net.Index.IndexReader
的用法示例。
在下文中一共展示了Mono.Lucene.Net.Index.IndexReader.TermPositions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scorer
public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
{
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(), similarity, reader.Norms(Enclosing_Instance.field));
else
return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
}
示例2: GetSpans
public override Spans GetSpans(IndexReader reader)
{
return new TermSpans(reader.TermPositions(term), term);
}
示例3: Scorer
public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
{
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(), similarity, reader.Norms(Enclosing_Instance.field));
else
return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
}