Loads a text file and adds every line as an entry to a Hashtable. Every line should contain only one word. If the file is not found or on any error, an empty table is returned.
コード例 #1
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);
 }
コード例 #2
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);
 }
コード例 #3
0
ファイル: StopAnalyzer.cs プロジェクト: zfxsss/lucenenet
 /// <summary>Builds an analyzer with the stop words from the given reader. </summary>
 /// <seealso cref="WordlistLoader.GetWordSet(System.IO.TextReader)">
 /// </seealso>
 /// <param name="matchVersion">See <a href="#Version">above</a>
 /// </param>
 /// <param name="stopwords">Reader to load stop words from
 /// </param>
 public StopAnalyzer(Version matchVersion, System.IO.TextReader stopwords)
 {
     stopWords = WordlistLoader.GetWordSet(stopwords);
     enablePositionIncrements = StopFilter.GetEnablePositionIncrementsVersionDefault(matchVersion);
 }
コード例 #4
0
 public StopAnalyzer(System.IO.TextReader stopwords, bool enablePositionIncrements)
 {
     stopWords = WordlistLoader.GetWordSet(stopwords);
     this.enablePositionIncrements   = enablePositionIncrements;
     useDefaultStopPositionIncrement = false;
 }
コード例 #5
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;
 }
コード例 #6
0
 public StopAnalyzer(System.IO.FileInfo stopwordsFile)
 {
     stopWords = WordlistLoader.GetWordSet(stopwordsFile);
     useDefaultStopPositionIncrement = true;
     enablePositionIncrements        = false;
 }