Lucene.Net.Analysis.WordlistLoader.GetWordSet C# (CSharp) Method

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
		public static ISet<string> GetWordSet(System.IO.FileInfo wordfile)
		{
            using (var reader = new System.IO.StreamReader(wordfile.FullName, System.Text.Encoding.Default))
            {
                return GetWordSet(reader);
            }
		}
		

Same methods

WordlistLoader::GetWordSet ( System wordfile, System comment ) : ISet

Usage Example

Beispiel #1
0
 public StopAnalyzer(System.IO.TextReader stopwords)
 {
     stopWords = WordlistLoader.GetWordSet(stopwords);
     useDefaultStopPositionIncrement = true;
     enablePositionIncrements        = false;
 }
All Usage Examples Of Lucene.Net.Analysis.WordlistLoader::GetWordSet