liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
intersection.h
Go to the documentation of this file.
1#ifndef LIBLEVENSHTEIN_TRANSDUCER_INTERSECTION_H
2#define LIBLEVENSHTEIN_TRANSDUCER_INTERSECTION_H
3
4#include <iostream>
5#include <string>
6
9
10namespace liblevenshtein {
11
17public:
18
28 Intersection(char label, DawgNode *node, State *state, Intersection *parent = nullptr);
29
34
40 [[nodiscard]] auto node() const -> DawgNode *;
41
47 [[nodiscard]] auto state() const -> State *;
48
56 [[nodiscard]] auto str() const -> std::string;
57
59 friend auto operator<<(std::ostream &out, const Intersection &intersection)
60 -> std::ostream &;
61
62private:
63
65 char _label;
66
69
72
75};
76
77} // namespace liblevenshtein
78
79#endif // LIBLEVENSHTEIN_TRANSDUCER_INTERSECTION_H
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.
char _label
Transition annotation from the outgoing edge to the given DawgNode.
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.
Intersection * _parent
The preceding Intersection node along the current path.
friend auto operator<<(std::ostream &out, const Intersection &intersection) -> std::ostream &
Specifies the ostream operator may access all the members.
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