Words Library for Unity  1.0
A C# library for building and manipulating grids in Unity Game Engine.
Gamelogic.Words.IWordDictionary Interface Reference

An interface for a dictionary of words More...

+ Inheritance diagram for Gamelogic.Words.IWordDictionary:

Public Member Functions

void AddWord (String word)
 Add a word to the dictionary More...
 
String Lookup (String word)
 Gets whether a word is in the dictionary More...
 
String GetRandomWord ()
 Selects a random word from the dictionary More...
 
bool WordWithPrefixExists (String prefix)
 Gets whether a certain prefix leads to a word or is a word itself More...
 
IEnumerable< String > Search (String pattern)
 Search the dictionary for a pattern More...
 
String SearchFirst (String pattern)
 Search the dictionary for a pattern and returns only the first result More...
 
IEnumerable< String > FindAnagrams (String source)
 Find anagrams of a given source string More...
 
IEnumerable< String > FindAnagrams (String source, bool phrases)
 Find anagrams of a given source string, optionally returning phrases More...
 
String FindFirstAnagram (String source)
 Find one anagram of a given source string More...
 
String FindFirstAnagram (String source, bool phrases)
 Find one anagram of a given source string, optionally returning phrases More...
 
IEnumerable< String > FindAnagramsOfSubset (String source)
 Find anagrams of a subset of the letters in the given source string More...
 
String FindFirstAnagramsOfSubset (String source)
 Find anagrams of a subset of the letters in the given source string and returns the first result More...
 
IEnumerable< String > FindSubWords (String source)
 Searches a word for all substrings that are themselves also words More...
 
String FindFirstSubWord (String source)
 Searches a word for the first substrings that is itself also a word More...
 

Properties

int Count [get]
 Gets the number of words in this dictionary More...
 
IWordAlphabet Alphabet [get]
 Gets our alphabet More...
 
int[] LetterFrequences [get]
 Gets an array of letter frequencies per letter of our alphabet More...
 

Detailed Description

An interface for a dictionary of words

Member Function Documentation

void Gamelogic.Words.IWordDictionary.AddWord ( String  word)

Add a word to the dictionary

Parameters
wordThe word to add to the dictionary
Exceptions
ArgumentNullExceptionword is null
ArgumentExceptionword is length 0

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

IEnumerable<String> Gamelogic.Words.IWordDictionary.FindAnagrams ( String  source)

Find anagrams of a given source string

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
Returns
A list of anagrams of source

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

IEnumerable<String> Gamelogic.Words.IWordDictionary.FindAnagrams ( String  source,
bool  phrases 
)

Find anagrams of a given source string, optionally returning phrases

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
phrasesWhether to return phrases as well as single words
Returns
A list of anagrams of source

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

IEnumerable<String> Gamelogic.Words.IWordDictionary.FindAnagramsOfSubset ( String  source)

Find anagrams of a subset of the letters in the given source string

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
Returns
A list of all anagrams of a subset of the letters in source

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.FindFirstAnagram ( String  source)

Find one anagram of a given source string

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
Returns
The first discovered anagram of source , or null if no anagrams exist

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.FindFirstAnagram ( String  source,
bool  phrases 
)

Find one anagram of a given source string, optionally returning phrases

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
phrasesWhether to return phrases as well as single words
Returns
The first discovered anagram of source , or null if no anagrams exist

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.FindFirstAnagramsOfSubset ( String  source)

Find anagrams of a subset of the letters in the given source string and returns the first result

Parameters
sourceThe source string. May include spaces, but not other non-alphabet characters
Returns
One anagram of a subset of the letters in source , or null if none exist.

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.FindFirstSubWord ( String  source)

Searches a word for the first substrings that is itself also a word

Parameters
sourceThe source string.
Returns
The first subword inside of source , or null if none exist.

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

IEnumerable<String> Gamelogic.Words.IWordDictionary.FindSubWords ( String  source)

Searches a word for all substrings that are themselves also words

Parameters
sourceThe source string.
Returns
A collection of all subwords inside of source

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.GetRandomWord ( )

Selects a random word from the dictionary

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.Lookup ( String  word)

Gets whether a word is in the dictionary

Parameters
wordThe word to look up
Exceptions
ArgumentNullExceptionword is null

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

IEnumerable<String> Gamelogic.Words.IWordDictionary.Search ( String  pattern)

Search the dictionary for a pattern

Parameters
patternThe pattern to search for
Exceptions
ArgumentNullExceptionpattern is null

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

String Gamelogic.Words.IWordDictionary.SearchFirst ( String  pattern)

Search the dictionary for a pattern and returns only the first result

Parameters
patternThe pattern to search for
Exceptions
ArgumentNullExceptionpattern is null
Returns
The first word found to match the given pattern, or null if none exist.

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

bool Gamelogic.Words.IWordDictionary.WordWithPrefixExists ( String  prefix)

Gets whether a certain prefix leads to a word or is a word itself

Parameters
prefixThe prefix to check
Returns
True if the given prefix leads to a word or is a word
Exceptions
ArgumentNullExceptionprefix is null

Implemented in Gamelogic.Words.Dictionaries.TrieDictionary.

Property Documentation

IWordAlphabet Gamelogic.Words.IWordDictionary.Alphabet
get

Gets our alphabet

int Gamelogic.Words.IWordDictionary.Count
get

Gets the number of words in this dictionary

int [] Gamelogic.Words.IWordDictionary.LetterFrequences
get

Gets an array of letter frequencies per letter of our alphabet


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