Table of Contents

Class TrieDictionary

Namespace
Gamelogic.Words
Assembly
Gamelogic.Words.dll

A dictionary represented as a trie. Allows for fast lookups and prefix-based search

[Version(1, 0, 0)]
public class TrieDictionary : IWordDictionary, IEnumerable<Word>, IEnumerable
Inheritance
TrieDictionary
Implements
Inherited Members
Extension Methods

Constructors

TrieDictionary(IWordAlphabet)

Initialize an empty dictionary with the provided alphabet

Properties

Alphabet

Gets our alphabet

Count

Gets the number of words in this dictionary

LetterFrequencies

Gets an array of letter frequencies per letter of our alphabet

Methods

AddWord(Word)

Add a word to the dictionary

AddWord(string)
FindAnagrams(Word)

Find anagrams of a given source string

FindAnagrams(Word, bool)

Find phrase anagrams of a given source string. Phrase anagrams may return multple words that, together, consist of all the letters in the source string

FindAnagrams(string)
FindAnagramsOfSubset(Word)

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

FindAnagramsOfSubset(string)
FindFirstAnagram(Word)

Find one anagram of a given source string

FindFirstAnagram(Word, bool)

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

FindFirstAnagram(string)
FindFirstAnagram(string, bool)
FindFirstAnagramsOfSubset(Word)

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

FindFirstAnagramsOfSubset(string)
FindFirstSubWord(Word)

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

FindFirstSubWord(string)
FindPhraseAnagrams(Word)
FindPhraseAnagrams(string)
FindSubWords(Word)

Searches a word for all substrings that are themselves also words

FindSubWords(string)
GetAllWords()
GetEnumerator()
GetRandomWord(IRandom)

Selects a random word from the dictionary.

The generator to use.A random word from the dictionary.
Lookup(Word)

Gets whether a word is in the dictionary

Lookup(string)
Search(Word)

Search the dictionary for a pattern

Search(string)
SearchFirst(Word)
SearchFirst(string)
WordWithPrefixExists(Word)

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

WordWithPrefixExists(string)