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.
1
#include "
liblevenshtein/collection/transition.h
"
2
3
4
namespace
liblevenshtein
{
5
6
Transition::Transition
(
char
label,
DawgNode
* source,
DawgNode
* target)
7
: _label(label),
8
_source(source),
9
_target(target)
10
{}
11
12
Transition::Transition
(
Transition
&&transition)
noexcept
13
: _label(transition._label),
14
_source(transition._source),
15
_target(transition._target)
16
{}
17
18
auto
Transition::label
()
const
->
char
{
19
return
_label
;
20
}
21
22
auto
Transition::source
()
const
->
DawgNode
* {
23
return
_source
;
24
}
25
26
auto
Transition::target
()
const
->
DawgNode
* {
27
return
_target
;
28
}
29
30
auto
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
liblevenshtein::DawgNode
Represents a position within one or more terms of a DAWG dictionary.
Definition
dawg_node.h:20
liblevenshtein::Transition
Represents an edge from one DawgNode to another, annotated with a character label from the current po...
Definition
transition.h:13
liblevenshtein::Transition::_source
DawgNode * _source
DawgNode at the beginning of this Transition.
Definition
transition.h:77
liblevenshtein::Transition::source
auto source() const -> DawgNode *
Returns the initial DawgNode along the edge of this transition.
Definition
transition.cpp:22
liblevenshtein::Transition::_target
DawgNode * _target
DawgNode at the ending of this Transition.
Definition
transition.h:80
liblevenshtein::Transition::label
auto label() const -> char
Returns the label annotating the edge from the source to the target of this Transition.
Definition
transition.cpp:18
liblevenshtein::Transition::operator==
auto operator==(const Transition &other) const -> bool
Returns whether this Transition is equivalent to another.
Definition
transition.cpp:30
liblevenshtein::Transition::_label
char _label
Annotation along the edge of this Transition.
Definition
transition.h:74
liblevenshtein::Transition::Transition
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
liblevenshtein::Transition::target
auto target() const -> DawgNode *
Returns the destination DawgNode along the edge of this transition.
Definition
transition.cpp:26
query
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition
main.cpp:25
liblevenshtein
Various utilities regarding Levenshtein transducers.
Definition
namespaces.dox:9
transition.h
src
liblevenshtein
collection
transition.cpp
Generated by
1.10.0