liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
transducer.cpp
Go to the documentation of this file.
10
11namespace liblevenshtein {
12
13template <Algorithm Type, class Result>
15 auto *position = new Position(0, 0);
16 auto *initial_state = new State({position});
17 _intersection = new Intersection('\0', root, initial_state);
18}
19
20template <Algorithm Type, class Result>
22 delete _intersection;
23}
24
25template <Algorithm Type, class Result>
27 std::size_t max_distance)
30 term, max_distance, _intersection,
33 max_distance, term.length()),
35}
36
43
44} // namespace liblevenshtein
Represents a position within one or more terms of a DAWG dictionary.
Definition dawg_node.h:20
Represents an Intersection between a dictionary automaton and Levenshtein automaton,...
Lazily traverses the intersection between the dictionary automaton and Levenshtein automaton,...
Definition lazy_query.h:180
Represents a location within the Levenshtein automaton.
Definition position.h:11
Transitions Levenshtein States given a characteristic vector.
Consists of a closure of Position nodes within the Levenshtein automaton.
Definition state.h:23
Constructs a Levenshtein Transducer that, when given a dictionary automaton, query term,...
Definition transducer.h:26
~Transducer()
Frees any owned allocations.
auto operator()(const std::string &term, std::size_t max_distance=2) -> LazyIterator< Result >
Transduces the query term and max_distance into the set of all spelling candidates from the dictionar...
Transducer(DawgNode *root)
Constructs a Levenshtein Transducer around the root DawgNode of a Dawg dictionary.
Removes (unsubsumes) all Positions from a State that are subsumed by another Position within the same...
Definition unsubsume.h:20
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition main.cpp:25
Various utilities regarding Levenshtein transducers.
Definition namespaces.dox:9