18 using System.Collections.Generic;
21 namespace Lucene.Net.Analysis
38 private readonly ISet<string> stopWords;
39 private readonly
bool enablePositionIncrements;
49 stopWords = ENGLISH_STOP_WORDS_SET;
56 this.stopWords = stopWords;
95 private class SavedStreams
99 InitBlock(enclosingInstance);
101 private void InitBlock(StopAnalyzer enclosingInstance)
103 this.enclosingInstance = enclosingInstance;
105 private StopAnalyzer enclosingInstance;
106 public StopAnalyzer Enclosing_Instance
110 return enclosingInstance;
118 public override TokenStream ReusableTokenStream(System.String fieldName, System.IO.TextReader reader)
120 var streams = (SavedStreams) PreviousTokenStream;
124 streams.result =
new StopFilter(enablePositionIncrements, streams.source, stopWords);
125 PreviousTokenStream = streams;
128 streams.source.Reset(reader);
129 return streams.result;
134 var stopWords =
new System.String[]{
"a",
"an",
"and",
"are",
"as",
"at",
"be",
"but",
"by",
"for",
"if",
"in",
"into",
"is",
"it",
"no",
"not",
"of",
"on",
"or",
"such",
"that",
"the",
"their",
"then",
"there",
"these",
"they",
"this",
"to",
"was",
"will",
"with"};
135 var stopSet =
new CharArraySet(stopWords.Length,
false);
136 stopSet.AddAll(stopWords);
137 ENGLISH_STOP_WORDS_SET = CharArraySet.UnmodifiableSet(stopSet);