liblevenshtein
4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
position.cpp
Go to the documentation of this file.
1
#include "
liblevenshtein/transducer/position.h
"
2
3
namespace
liblevenshtein
{
4
5
Position::Position
(std::size_t term_index, std::size_t num_errors,
bool
is_special)
6
: _term_index(term_index),
7
_num_errors(num_errors),
8
_is_special(is_special)
9
{}
10
11
Position::~Position
() {
12
delete
_next
;
13
}
14
15
void
Position::next
(
Position
*next) {
16
_next
=
next
;
17
}
18
19
auto
Position::next
()
const
->
Position
* {
20
return
_next
;
21
}
22
23
auto
Position::term_index
()
const
->
std
::
size_t
{
24
return
_term_index
;
25
}
26
27
auto
Position::num_errors
()
const
->
std
::
size_t
{
28
return
_num_errors
;
29
}
30
31
auto
Position::is_special
()
const
->
bool
{
32
return
_is_special
;
33
}
34
35
}
// namespace liblevenshtein
liblevenshtein::Position
Represents a location within the Levenshtein automaton.
Definition
position.h:11
liblevenshtein::Position::_term_index
std::size_t _term_index
The current position within the dictionary term.
Definition
position.h:71
liblevenshtein::Position::~Position
~Position()
Frees any owned allocations.
Definition
position.cpp:11
liblevenshtein::Position::next
auto next() const -> Position *
Returns the Position that follows this one along the current path.
Definition
position.cpp:19
liblevenshtein::Position::term_index
auto term_index() const -> std::size_t
Returns the current position in the dictionary term.
Definition
position.cpp:23
liblevenshtein::Position::_next
Position * _next
The Position that follows this one along the current path.
Definition
position.h:68
liblevenshtein::Position::is_special
auto is_special() const -> bool
Returns whether this is a special state of one of the extended algorithms.
Definition
position.cpp:31
liblevenshtein::Position::num_errors
auto num_errors() const -> std::size_t
Returns the accumulated number of errors at the term_index.
Definition
position.cpp:27
liblevenshtein::Position::_num_errors
std::size_t _num_errors
The accumulated number of errors between the spelling candidate and query term, at term_index of the ...
Definition
position.h:75
liblevenshtein::Position::Position
Position(std::size_t term_index, std::size_t num_errors, bool is_special=false)
Constructs a new Position within the Levenshtein automaton.
Definition
position.cpp:5
liblevenshtein::Position::_is_special
bool _is_special
Whether this is a special state of one of the extended algorithms.
Definition
position.h:78
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
std
STL namespace.
position.h
src
liblevenshtein
transducer
position.cpp
Generated by
1.10.0