Method LoadDictionary
LoadDictionary(IWordDictionary, Stream)
Load a dictionary from a stream. Expects one word per line.
public static void LoadDictionary(this IWordDictionary dictionary, Stream stream)
Parameters
dictionary
IWordDictionaryThe dictionary to load into
stream
StreamThe stream to load from
LoadDictionary(IWordDictionary, Stream, string, string)
Load a dictionary from a stream, checking it against exclusion and inclusion regular expressions before adding to the dictionary
public static void LoadDictionary(this IWordDictionary dictionary, Stream stream, string inclusionPattern, string exclusionPattern)
Parameters
dictionary
IWordDictionaryThe dictionary to load into
stream
StreamThe stream to load from
inclusionPattern
stringA regular expression to match as a whitelist pattern
exclusionPattern
stringA regular expression to match as a blacklist pattern. Takes precedence over the whitelist
LoadDictionary(IWordDictionary, Stream, int, int)
Load a dictionary from a stream, checking a word's length before adding it
public static void LoadDictionary(this IWordDictionary dictionary, Stream stream, int minLength, int maxLength)
Parameters
dictionary
IWordDictionaryThe dictionary to load into
stream
StreamThe stream to load from
minLength
intThe minimum word length
maxLength
intThe maximum word length
LoadDictionary(IWordDictionary, Stream, string, string, int, int)
Load a dictionary from a stream, checking its length and matching it against exclusion and inclusion regular expressions before adding to the dictionary
public static void LoadDictionary(this IWordDictionary dictionary, Stream stream, string inclusionPattern, string exclusionPattern, int minLength, int maxLength)
Parameters
dictionary
IWordDictionaryThe dictionary to load into
stream
StreamThe stream to load from
inclusionPattern
stringA regular expression to match as a whitelist pattern
exclusionPattern
stringA regular expression to match as a blacklist pattern. Takes precedence over the whitelist
minLength
intThe minimum word length
maxLength
intThe maximum word length
LoadDictionary(IWordDictionary, Stream, Func<string, string>)
Load a dictionary from a stream, and providing a transformation function. Expects one word per line.
public static void LoadDictionary(this IWordDictionary dictionary, Stream stream, Func<string, string> transformation)
Parameters
dictionary
IWordDictionaryThe dictionary to load into
stream
StreamThe stream to load from
transformation
Func<string, string>A function to transform or reject a loaded word before adding it to the dictionary.
Remarks
Return null from the transformation function to reject a word.