Words Library for Unity  1.0
A C# library for building and manipulating grids in Unity Game Engine.
Gamelogic.Words.Dictionaries.DictionaryExtensions Class Reference

A collection of extension methods common to all dictionary implementations More...

Static Public Member Functions

static void LoadDictionary (this IWordDictionary dictionary, Stream stream)
 Load a dictionary from a stream. More...
 
static void LoadDictionary (this IWordDictionary dictionary, Stream stream, String inclusionPattern, String exclusionPattern)
 Load a dictionary from a stream, checking it against exclusion and inclusion regular expressions before adding to the dictionary More...
 
static void LoadDictionary (this IWordDictionary dictionary, Stream stream, int minLength, int maxLength)
 Load a dictionary from a stream, checking a word's length before adding it More...
 
static void LoadDictionary (this IWordDictionary dictionary, Stream stream, String inclusionPattern, String exclusionPattern, int minLength, int maxLength)
 Load a dictionary from a stream, checking its length and matching it against exclusion and inclusion regular expressions before adding to the dictionary More...
 
static void LoadDictionary (this IWordDictionary dictionary, Stream stream, Func< String, String > transformation)
 Load a dictionary from a stream, and providing a transformation function. More...
 
static String GetNearestWord (this IWordDictionary dictionary, String word)
 Finds the closest word to the given input string, by edit distance More...
 

Detailed Description

A collection of extension methods common to all dictionary implementations

Member Function Documentation

static String Gamelogic.Words.Dictionaries.DictionaryExtensions.GetNearestWord ( this IWordDictionary  dictionary,
String  word 
)
static

Finds the closest word to the given input string, by edit distance

Parameters
dictionaryThe dictionary to search
wordThe word to find
Returns
word itself if it is a valid word in the dictionary, or the word in the dictionary with the smallest edit distance to it.

This implementation may prove slow on larger dictionaries.

static void Gamelogic.Words.Dictionaries.DictionaryExtensions.LoadDictionary ( this IWordDictionary  dictionary,
Stream  stream 
)
static

Load a dictionary from a stream.

Expects one word per line.

Parameters
dictionaryThe dictionary to load into
streamThe stream to load from
static void Gamelogic.Words.Dictionaries.DictionaryExtensions.LoadDictionary ( this IWordDictionary  dictionary,
Stream  stream,
String  inclusionPattern,
String  exclusionPattern 
)
static

Load a dictionary from a stream, checking it against exclusion and inclusion regular expressions before adding to the dictionary

Parameters
dictionaryThe dictionary to load into
streamThe stream to load from
inclusionPatternA regular expression to match as a whitelist pattern
exclusionPatternA regular expression to match as a blacklist pattern. Takes precedence over the whitelist
static void Gamelogic.Words.Dictionaries.DictionaryExtensions.LoadDictionary ( this IWordDictionary  dictionary,
Stream  stream,
int  minLength,
int  maxLength 
)
static

Load a dictionary from a stream, checking a word's length before adding it

Parameters
dictionaryThe dictionary to load into
streamThe stream to load from
minLengthThe minimum word length
maxLengthThe maximum word length
static void Gamelogic.Words.Dictionaries.DictionaryExtensions.LoadDictionary ( this IWordDictionary  dictionary,
Stream  stream,
String  inclusionPattern,
String  exclusionPattern,
int  minLength,
int  maxLength 
)
static

Load a dictionary from a stream, checking its length and matching it against exclusion and inclusion regular expressions before adding to the dictionary

Parameters
dictionaryThe dictionary to load into
streamThe stream to load from
inclusionPatternA regular expression to match as a whitelist pattern
exclusionPatternA regular expression to match as a blacklist pattern. Takes precedence over the whitelist
minLengthThe minimum word length
maxLengthThe maximum word length
static void Gamelogic.Words.Dictionaries.DictionaryExtensions.LoadDictionary ( this IWordDictionary  dictionary,
Stream  stream,
Func< String, String >  transformation 
)
static

Load a dictionary from a stream, and providing a transformation function.

Expects one word per line.

Return null from the transformation function to reject a word.

Parameters
dictionaryThe dictionary to load into
streamThe stream to load from
transformationA function to transform or reject a loaded word before adding it to the dictionary.

The documentation for this class was generated from the following file: