C# Class LevenshteinAutomaton.Trie

Prefix tree
Show file Open project: ibendrup/LevenshteinAutomaton

Public Properties

Property Type Description
root TrieNode

Public Methods

Method Description
AddWord ( String word ) : void

Append word to the prefix tree

GetNode ( String argString ) : TrieNode

Get node for given word or prefix

GetPrefix ( String prefix ) : TrieNode

Get node for given prefix if exists

GetWord ( String word ) : TrieNode

Get node for given word if exists

Trie ( ) : System

Init empty prefix tree

Trie ( IEnumerable lexicon ) : System

Init prefix tree for given lexicon

СontainsPrefix ( String prefix ) : bool

Check if trie contains given prefix

СontainsWord ( String word ) : bool

Check if trie contains given word

Private Methods

Method Description
Сontains ( String argString, bool word ) : bool

Check if trie contains given word or prefix

Method Details

AddWord() public method

Append word to the prefix tree
public AddWord ( String word ) : void
word String
return void

GetNode() public method

Get node for given word or prefix
public GetNode ( String argString ) : TrieNode
argString String
return TrieNode

GetPrefix() public method

Get node for given prefix if exists
public GetPrefix ( String prefix ) : TrieNode
prefix String
return TrieNode

GetWord() public method

Get node for given word if exists
public GetWord ( String word ) : TrieNode
word String
return TrieNode

Trie() public method

Init empty prefix tree
public Trie ( ) : System
return System

Trie() public method

Init prefix tree for given lexicon
public Trie ( IEnumerable lexicon ) : System
lexicon IEnumerable
return System

СontainsPrefix() public method

Check if trie contains given prefix
public СontainsPrefix ( String prefix ) : bool
prefix String
return bool

СontainsWord() public method

Check if trie contains given word
public СontainsWord ( String word ) : bool
word String
return bool

Property Details

root public property

Root of the tree
public TrieNode,LevenshteinAutomaton root
return TrieNode