本文整理汇总了C#中Lucene.Net.Search.IndexSearcher.Next方法的典型用法代码示例。如果您正苦于以下问题:C# IndexSearcher.Next方法的具体用法?C# IndexSearcher.Next怎么用?C# IndexSearcher.Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.IndexSearcher
的用法示例。
在下文中一共展示了IndexSearcher.Next方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEnglish
public static bool IsEnglish(string text)
{
Lucene.Net.Store.Directory directoryBR = new RAMDirectory();
Lucene.Net.Store.Directory directoryEN = new RAMDirectory();
IndexWriter iwriterBr = new IndexWriter(directoryBR, brazilAnalyzer, true, new IndexWriter.MaxFieldLength(25000));
IndexWriter iwriterEn = new IndexWriter(directoryEN, englishAnalyzer, true, new IndexWriter.MaxFieldLength(25000));
Document doc = new Document();
doc.Add(new Field("detectLang", text,Field.Store.NO, Field.Index.ANALYZED));
iwriterBr.AddDocument(doc);
iwriterEn.AddDocument(doc);
iwriterBr.Dispose();
iwriterEn.Dispose();
//SE O Nº DE TERMOS ANALIZADOS EM INGLÊS FOR MAIOR QUE EM PORTUGUÊS QUER DIZER QUE NÃO ELIMINOU AS STOPWORDS, LOGO É PORTUGUÊS
TermEnum termsBr = new IndexSearcher(directoryBR, true).IndexReader.Terms();
string term;
int x=0;
while (termsBr.Next()) { term= termsBr.Term.ToString() ; ++x; }
TermEnum termsEn = new IndexSearcher(directoryEN, true).IndexReader.Terms();
int y=0;
while (termsEn.Next()) { term = termsEn.Term.ToString(); ++y; }
return y < x;
}