C# Class LevenshteinAutomaton.LevTAutomataImitation

Universal deterministic Levenshtein automaton for Damerau-Levenshtein distance
Mostrar archivo Open project: ibendrup/LevenshteinAutomaton Class Usage Examples

Public Properties

Property Type Description
N int
StateCount int
VectorCount int
VectorLength int
W int
Word string

Public Methods

Method Description
AcceptWord ( string word ) : bool

Check if this automaton accepts given word (i.e. edit distance between Word and word <= N)

GetCharacteristicVector ( char letter, int position ) : int

Gets the characteristic vector for given letter and position.

GetNextState ( int vector ) : AutomatonState

Evaluate next automaton state (without actual transition)

IsAcceptState ( int state, int offset ) : bool

Check if given state is the accept state for given offset

LevTAutomataImitation ( string word, int n ) : System

Initializes a new instance of the LevTAutomataImitation class.

LoadState ( int state, int offset ) : void

Loads automaton state and offset.

NextState ( char letter ) : void

Make transition to the next state for the given letter

NextState ( int vector ) : void

Make transition to the next state for the given characteristic vector

Protected Methods

Method Description
UpdateMatricies ( ) : void

Select current state transition matrix and offset increment matrix

Method Details

AcceptWord() public method

Check if this automaton accepts given word (i.e. edit distance between Word and word <= N)
public AcceptWord ( string word ) : bool
word string Word to check
return bool

GetCharacteristicVector() public method

Gets the characteristic vector for given letter and position.
public GetCharacteristicVector ( char letter, int position ) : int
letter char Letter.
position int Position.
return int

GetNextState() public method

Evaluate next automaton state (without actual transition)
public GetNextState ( int vector ) : AutomatonState
vector int Characteristic vector.
return AutomatonState

IsAcceptState() public method

Check if given state is the accept state for given offset
public IsAcceptState ( int state, int offset ) : bool
state int State.
offset int Offset.
return bool

LevTAutomataImitation() public method

Initializes a new instance of the LevTAutomataImitation class.
public LevTAutomataImitation ( string word, int n ) : System
word string Word
n int Maximum edit distance
return System

LoadState() public method

Loads automaton state and offset.
public LoadState ( int state, int offset ) : void
state int State.
offset int Offset.
return void

NextState() public method

Make transition to the next state for the given letter
public NextState ( char letter ) : void
letter char Letter.
return void

NextState() public method

Make transition to the next state for the given characteristic vector
public NextState ( int vector ) : void
vector int Vector.
return void

UpdateMatricies() protected method

Select current state transition matrix and offset increment matrix
protected UpdateMatricies ( ) : void
return void

Property Details

N public_oe property

Allowed modifications count
public int N
return int

StateCount public_oe property

The state count.
public int StateCount
return int

VectorCount public_oe property

Possible characteristic vector value count
public int VectorCount
return int

VectorLength public_oe property

Characteristic vector length
public int VectorLength
return int

W public_oe property

Word length
public int W
return int

Word public_oe property

The word.
public string Word
return string