static StopAnalyzer() { { System.String[] 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" }; CharArraySet stopSet = new CharArraySet(stopWords.Length, false); stopSet.AddAll(new System.Collections.ArrayList(stopWords)); ENGLISH_STOP_WORDS_SET = CharArraySet.UnmodifiableSet(stopSet); } }
/// <summary> </summary> /// <param name="stopWords">An array of stopwords /// </param> /// <param name="ignoreCase">If true, all words are lower cased first. /// </param> /// <returns> a Set containing the words /// </returns> public static System.Collections.Hashtable MakeStopSet(System.String[] stopWords, bool ignoreCase) { CharArraySet stopSet = new CharArraySet(stopWords.Length, ignoreCase); stopSet.AddAll(new System.Collections.ArrayList(stopWords)); return stopSet; }
/// <summary> </summary> /// <param name="stopWords">A List of Strings representing the stopwords /// </param> /// <param name="ignoreCase">if true, all words are lower cased first /// </param> /// <returns> A Set containing the words /// </returns> public static System.Collections.Hashtable MakeStopSet(System.Collections.IList stopWords, bool ignoreCase) { CharArraySet stopSet = new CharArraySet(stopWords.Count, ignoreCase); stopSet.AddAll(stopWords); return stopSet; }
static StopAnalyzer() { { System.String[] 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"}; CharArraySet stopSet = new CharArraySet(stopWords.Length, false); stopSet.AddAll(new System.Collections.ArrayList(stopWords)); ENGLISH_STOP_WORDS_SET = CharArraySet.UnmodifiableSet(stopSet); } }