Table of Contents

Method LoadDictionary

Namespace
Gamelogic.Words
Assembly
Gamelogic.Words.dll

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 IWordDictionary

The dictionary to load into

stream Stream

The 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 IWordDictionary

The dictionary to load into

stream Stream

The stream to load from

inclusionPattern string

A regular expression to match as a whitelist pattern

exclusionPattern string

A 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 IWordDictionary

The dictionary to load into

stream Stream

The stream to load from

minLength int

The minimum word length

maxLength int

The 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 IWordDictionary

The dictionary to load into

stream Stream

The stream to load from

inclusionPattern string

A regular expression to match as a whitelist pattern

exclusionPattern string

A regular expression to match as a blacklist pattern. Takes precedence over the whitelist

minLength int

The minimum word length

maxLength int

The 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 IWordDictionary

The dictionary to load into

stream Stream

The 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.