liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
transition.cpp
Go to the documentation of this file.
2
3
4namespace liblevenshtein {
5
6Transition::Transition(char label, DawgNode* source, DawgNode* target)
7 : _label(label),
8 _source(source),
9 _target(target)
10{}
11
13 : _label(transition._label),
14 _source(transition._source),
15 _target(transition._target)
16{}
17
18auto Transition::label() const -> char {
19 return _label;
20}
21
23 return _source;
24}
25
27 return _target;
28}
29
30auto Transition::operator==(const Transition &other) const -> bool {
31 return _label == other._label
32 && *_source == *(other._source)
33 && *_target == *(other._target);
34}
35
36} // namespace liblevenshtein
Represents a position within one or more terms of a DAWG dictionary.
Definition dawg_node.h:20
Represents an edge from one DawgNode to another, annotated with a character label from the current po...
Definition transition.h:13
DawgNode * _source
DawgNode at the beginning of this Transition.
Definition transition.h:77
auto source() const -> DawgNode *
Returns the initial DawgNode along the edge of this transition.
DawgNode * _target
DawgNode at the ending of this Transition.
Definition transition.h:80
auto label() const -> char
Returns the label annotating the edge from the source to the target of this Transition.
auto operator==(const Transition &other) const -> bool
Returns whether this Transition is equivalent to another.
char _label
Annotation along the edge of this Transition.
Definition transition.h:74
Transition(char label, DawgNode *source, DawgNode *target)
Constructs a new Transition from a source DawgNode to its target, annotated by the given label.
Definition transition.cpp:6
auto target() const -> DawgNode *
Returns the destination DawgNode along the edge of this transition.
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