Method GetWordSet
GetWordSet(IO.FileInfo)
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).
Declaration
public static ISet<string> GetWordSet(IO.FileInfo wordfile)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | wordfile | File containing the wordlist |
Returns
Type | Description |
---|---|
ISet<System.String> | A HashSet with the file's words |
GetWordSet(IO.FileInfo, String)
Loads a text file and adds every non-comment 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).
Declaration
public static ISet<string> GetWordSet(IO.FileInfo wordfile, String comment)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | wordfile | File containing the wordlist |
System.String | comment | The comment string to ignore |
Returns
Type | Description |
---|---|
ISet<System.String> | A HashSet with the file's words |
GetWordSet(IO.TextReader)
Reads lines from a Reader and adds every line as an entry to a HashSet (omitting leading and trailing whitespace). Every line of the Reader should contain only one word. The words need to be in lowercase if you make use of an Analyzer which uses LowerCaseFilter (like StandardAnalyzer).
Declaration
public static ISet<string> GetWordSet(IO.TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader | Reader containing the wordlist |
Returns
Type | Description |
---|---|
ISet<System.String> | A HashSet with the reader's words |
GetWordSet(IO.TextReader, String)
Reads lines from a Reader and adds every non-comment line as an entry to a HashSet (omitting leading and trailing whitespace). Every line of the Reader should contain only one word. The words need to be in lowercase if you make use of an Analyzer which uses LowerCaseFilter (like StandardAnalyzer).
Declaration
public static ISet<string> GetWordSet(IO.TextReader reader, String comment)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader | Reader containing the wordlist |
System.String | comment | The string representing a comment. |
Returns
Type | Description |
---|---|
ISet<System.String> | A HashSet with the reader's words |