liblevenshtein
4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
position.h
Go to the documentation of this file.
1
#ifndef LIBLEVENSHTEIN_TRANSDUCER_POSITION_H
2
#define LIBLEVENSHTEIN_TRANSDUCER_POSITION_H
3
4
#include <cstddef>
5
6
namespace
liblevenshtein
{
7
11
class
Position
{
12
public
:
13
22
Position
(std::size_t
term_index
, std::size_t
num_errors
,
23
bool
is_special
=
false
);
24
28
~Position
();
29
35
void
next
(
Position
*
next
);
36
42
[[
nodiscard
]]
auto
next
()
const
->
Position
*;
43
49
[[
nodiscard
]]
auto
term_index
()
const
-> std::size_t;
50
56
[[
nodiscard
]]
auto
num_errors
()
const
-> std::size_t;
57
63
[[
nodiscard
]]
auto
is_special
()
const
->
bool
;
64
65
private
:
66
68
Position
*
_next
=
nullptr
;
69
71
std::size_t
_term_index
;
72
75
std::size_t
_num_errors
;
76
78
bool
_is_special
;
79
};
80
81
}
// namespace liblevenshtein
82
83
#endif
// LIBLEVENSHTEIN_TRANSDUCER_POSITION_H
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
src
liblevenshtein
transducer
position.h
Generated by
1.10.0