liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
intersection.cpp
Go to the documentation of this file.
1#include <sstream>
2
4
5namespace liblevenshtein {
6
8 : _parent(parent),
9 _label(label),
10 _node(node),
11 _state(state) {}
12
16
18 return _node;
19}
20
22 return _state;
23}
24
25auto Intersection::str() const -> std::string {
26 std::stringstream ss;
27 ss << *this;
28 return ss.str();
29}
30
31auto operator<<(std::ostream &out, const Intersection &intersection)
32 -> std::ostream & {
33 if (intersection._parent != nullptr) {
34 out << *(intersection._parent) << intersection._label;
35 }
36 return out;
37}
38
39} // 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,...
~Intersection()
Frees all owned members.
Intersection(char label, DawgNode *node, State *state, Intersection *parent=nullptr)
Constructs a new Intersection between a dictionary automaton and Levenshtein automaton,...
State * _state
Levenshtein transducer State.
DawgNode * _node
Placeholder in the dictionary automaton.
auto state() const -> State *
Returns the Levenshtein State from the Intersection.
auto node() const -> DawgNode *
Returns the dictionary DawgNode from the Intersection.
auto str() const -> std::string
Concatenates all subsequent character labels from the Intersection nodes beginning at the root of the...
Consists of a closure of Position nodes within the Levenshtein automaton.
Definition state.h:23
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
auto operator<<(std::ostream &out, const Dawg &dawg) -> std::ostream &
Definition dawg.cpp:67
STL namespace.