GetWordSet() public static method

Loads a text file and adds every line as an entry to a HashSet (omitting leading and trailing whitespace). Every line of the file should contain only one word. The words need to be in lowercase if you make use of an Analyzer which uses LowerCaseFilter (like StandardAnalyzer).
public static GetWordSet ( System wordfile ) : ISet
wordfile System File containing the wordlist
return ISet
Exemplo n.º 1
0
 public StopAnalyzer(System.IO.TextReader stopwords)
 {
     stopWords = WordlistLoader.GetWordSet(stopwords);
     useDefaultStopPositionIncrement = true;
     enablePositionIncrements        = false;
 }
Exemplo n.º 2
0
 /// <summary> Builds an analyzer with the stop words from the given file.
 ///
 /// </summary>
 /// <seealso cref="WordlistLoader.getWordSet(File)">
 /// </seealso>
 /// <param name="matchVersion">See <a href="#version">above</a>
 /// </param>
 /// <param name="stopwordsFile">File to load stop words from
 /// </param>
 public StopAnalyzer(Version matchVersion, System.IO.FileInfo stopwordsFile)
 {
     stopWords = WordlistLoader.GetWordSet(stopwordsFile);
     this.enablePositionIncrements   = StopFilter.GetEnablePositionIncrementsVersionDefault(matchVersion);
     useDefaultStopPositionIncrement = false;
 }
Exemplo n.º 3
0
 /// <summary>Builds an analyzer with the stop words from the given reader.</summary>
 /// <seealso cref="WordlistLoader.GetWordSet(Reader)">
 /// </seealso>
 public StopAnalyzer(System.IO.TextReader stopwords)
 {
     stopWords = WordlistLoader.GetWordSet(stopwords);
 }
Exemplo n.º 4
0
 public StopAnalyzer(System.IO.FileInfo stopwordsFile, bool enablePositionIncrements)
 {
     stopWords = WordlistLoader.GetWordSet(stopwordsFile);
     this.enablePositionIncrements   = enablePositionIncrements;
     useDefaultStopPositionIncrement = false;
 }
Exemplo n.º 5
0
 /// <summary>Builds an analyzer with the stop words from the given file.</summary>
 /// <seealso cref="WordlistLoader.GetWordSet(File)">
 /// </seealso>
 public StopAnalyzer(System.IO.FileInfo stopwordsFile)
 {
     stopWords = WordlistLoader.GetWordSet(stopwordsFile);
 }