liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
|
Transitions Levenshtein States given a characteristic vector. More...
#include <state_transition.h>
Public Member Functions | |
StateTransition (PositionTransitionFn transition, CompareFn compare, MergeFn merge, UnsubsumeFn unsubsume, std::size_t max_distance, std::size_t query_length) | |
Constructs a new StateTransition function. | |
auto | operator() (State *curr_state, std::vector< bool > &characteristic_vector) -> State * |
Returns a successive State to the current one given the characteristic vector. | |
Private Attributes | |
PositionTransitionFn | transition |
Maps Position nodes and characteristic vectors to subsequent Position nodes. | |
CompareFn | compare |
Compares Position nodes. | |
MergeFn | merge |
Merges Positions into a State. | |
UnsubsumeFn | unsubsume |
Removes redundant Positions from a State according to the notion of subsumption. | |
std::size_t | max_distance |
Maximum edit distance to consider when matching spelling candidates. | |
std::size_t | query_length |
Length of the query term. | |
Transitions Levenshtein States given a characteristic vector.
Definition at line 28 of file state_transition.h.
liblevenshtein::StateTransition::StateTransition | ( | PositionTransitionFn | transition, |
CompareFn | compare, | ||
MergeFn | merge, | ||
UnsubsumeFn | unsubsume, | ||
std::size_t | max_distance, | ||
std::size_t | query_length ) |
Constructs a new StateTransition function.
transition | Maps Position nodes and characteristic vectors to subsequent Position nodes. |
compare | Compares Position nodes. |
merge | Merges Positions into a State. |
unsubsume | Removes redundant Positions from a State according to the notion of subsumption. |
max_distance | Maximum edit distance to consider when matching spelling candidates. |
query_length | Length of the query term. |
Definition at line 8 of file state_transition.cpp.
auto liblevenshtein::StateTransition::operator() | ( | State * | curr_state, |
std::vector< bool > & | characteristic_vector ) -> State * |
Returns a successive State to the current one given the characteristic vector.
curr_state | Current State in the Levenshtein automaton. |
characteristic_vector | Moving window over matching characters in the query term. |
Definition at line 17 of file state_transition.cpp.
References liblevenshtein::compare(), liblevenshtein::State::head(), liblevenshtein::merge(), and query().
|
private |
Compares Position nodes.
Definition at line 70 of file state_transition.h.
|
private |
Maximum edit distance to consider when matching spelling candidates.
Definition at line 80 of file state_transition.h.
|
private |
Merges Positions into a State.
Definition at line 73 of file state_transition.h.
|
private |
Length of the query term.
Definition at line 83 of file state_transition.h.
|
private |
Maps Position nodes and characteristic vectors to subsequent Position nodes.
Definition at line 67 of file state_transition.h.
|
private |
Removes redundant Positions from a State according to the notion of subsumption.
Definition at line 77 of file state_transition.h.