liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
|
Lazily traverses the intersection between the dictionary automaton and Levenshtein automaton, guided by the query term, and yields each spelling candidate as it is matched. More...
#include <lazy_query.h>
Public Member Functions | |
LazyIterator (const std::string &term, std::size_t max_distance, Intersection *intersection, TransitionFn transition, DistanceFn min_distance) | |
Constructs a new LazyIterator which yields spelling candidates as they are matched while traversing the intersection between the dictionary automaton and Levenshtein automaton, guided by the query term. | |
auto | begin () -> LazyQuery< Result > |
Returns an instance of LazyQuery that yields spelling candidates of the given Type. | |
auto | end () -> LazyQuery< Result > |
Returns a placeholder representing the end of the spelling candidates. | |
Private Attributes | |
std::string | _term |
Query term whose spelling candidates are to be matched. | |
std::size_t | _max_distance |
Maximum edit distance to consider when matching spelling candidates. | |
Intersection * | _intersection |
Initial Intersection between the dictionary root node and initial Levenshtein State. | |
TransitionFn | transition |
Maps one Levenshtein State to another given the state and a characteristic vector. | |
DistanceFn | min_distance |
Infers the Levenshtein distance between the query term and a spelling candidate. | |
Lazily traverses the intersection between the dictionary automaton and Levenshtein automaton, guided by the query term, and yields each spelling candidate as it is matched.
Definition at line 180 of file lazy_query.h.
liblevenshtein::LazyIterator< Result >::LazyIterator | ( | const std::string & | term, |
std::size_t | max_distance, | ||
Intersection * | intersection, | ||
TransitionFn | transition, | ||
DistanceFn | min_distance ) |
Constructs a new LazyIterator which yields spelling candidates as they are matched while traversing the intersection between the dictionary automaton and Levenshtein automaton, guided by the query term.
term | Query term whose spelling candidates are to be matched. |
max_distance | Maximum edit distance to consider when matching spelling candidates. |
intersection | Initial Intersection between the root node of the dictionary and the initial Levenshtein State. |
transition | Function that maps one Levenshtein State to another with input from a characteristic vector. |
min_distance | Infers the Levenshtein distance between the query term and a spelling candidate. |
Definition at line 134 of file lazy_query.cpp.
Returns an instance of LazyQuery that yields spelling candidates of the given Type.
Definition at line 144 of file lazy_query.cpp.
References query().
Returns a placeholder representing the end of the spelling candidates.
Definition at line 150 of file lazy_query.cpp.
References query().
|
private |
Initial Intersection between the dictionary root node and initial Levenshtein State.
Definition at line 227 of file lazy_query.h.
|
private |
Maximum edit distance to consider when matching spelling candidates.
Definition at line 223 of file lazy_query.h.
|
private |
Query term whose spelling candidates are to be matched.
Definition at line 220 of file lazy_query.h.
|
private |
Infers the Levenshtein distance between the query term and a spelling candidate.
Definition at line 235 of file lazy_query.h.
|
private |
Maps one Levenshtein State to another given the state and a characteristic vector.
Definition at line 231 of file lazy_query.h.