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
dictionaryIWordDictionaryThe dictionary to load into
streamStreamThe 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
dictionaryIWordDictionaryThe dictionary to load into
streamStreamThe stream to load from
inclusionPatternstringA regular expression to match as a whitelist pattern
exclusionPatternstringA 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
dictionaryIWordDictionaryThe dictionary to load into
streamStreamThe stream to load from
minLengthintThe minimum word length
maxLengthintThe 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
dictionaryIWordDictionaryThe dictionary to load into
streamStreamThe stream to load from
inclusionPatternstringA regular expression to match as a whitelist pattern
exclusionPatternstringA regular expression to match as a blacklist pattern. Takes precedence over the whitelist
minLengthintThe minimum word length
maxLengthintThe 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
dictionaryIWordDictionaryThe dictionary to load into
streamStreamThe stream to load from
transformationFunc<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.