本文整理匯總了C#中Transformalize.Libs.Lucene.Net.Index.IndexReader.TermPositions方法的典型用法代碼示例。如果您正苦於以下問題:C# IndexReader.TermPositions方法的具體用法?C# IndexReader.TermPositions怎麽用?C# IndexReader.TermPositions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Transformalize.Libs.Lucene.Net.Index.IndexReader
的用法示例。
在下文中一共展示了IndexReader.TermPositions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetSpans
public override Spans GetSpans(IndexReader reader)
{
return new TermSpans(reader.TermPositions(internalTerm), internalTerm);
}
示例2: 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(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));
}
示例3: 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 = 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));
}
示例4: TermDocs
protected internal override TermDocs TermDocs(IndexReader reader)
{
return reader.TermPositions();
}