liblevenshtein
4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
prefix.h
Go to the documentation of this file.
1
#ifndef LIBLEVENSHTEIN_COLLECTION_PREFIX_H
2
#define LIBLEVENSHTEIN_COLLECTION_PREFIX_H
3
4
#include <iostream>
5
#include <string>
6
7
#include "
liblevenshtein/collection/dawg_node.h
"
8
9
10
namespace
liblevenshtein
{
11
16
class
Prefix
{
17
public
:
18
29
Prefix
(
DawgNode
*
node
,
Prefix
*
parent
,
char
label
);
30
37
Prefix
(
DawgNode
* root);
38
44
Prefix
(
const
Prefix
&
prefix
) =
default
;
45
51
Prefix
(
Prefix
&&
prefix
)
noexcept
;
52
58
[[
nodiscard
]]
auto
node
()
const
->
DawgNode
*;
59
67
[[
nodiscard
]]
auto
label
()
const
->
char
;
68
76
[[
nodiscard
]]
auto
str
()
const
->
std
::
string
;
77
79
friend
auto
operator
<<(
std
::ostream &
out
,
const
Prefix
&
prefix
)
80
->
std
::ostream &;
81
82
private
:
83
85
DawgNode
*
_node
;
86
88
Prefix
*
_parent
;
89
92
char
_label
;
93
};
94
95
}
// namespace liblevenshtein
96
97
98
#endif
// LIBLEVENSHTEIN_COLLECTION_PREFIX_H
liblevenshtein::DawgNode
Represents a position within one or more terms of a DAWG dictionary.
Definition
dawg_node.h:20
liblevenshtein::Prefix
Represents the prefix of a dictionary term.
Definition
prefix.h:16
liblevenshtein::Prefix::_label
char _label
Current character label along the path from the root prefix node to this one.
Definition
prefix.h:92
liblevenshtein::Prefix::str
auto str() const -> std::string
Returns the string constructed by following the path between the root prefix node and this one,...
Definition
prefix.cpp:34
liblevenshtein::Prefix::Prefix
Prefix(DawgNode *node, Prefix *parent, char label)
Constructs a new prefix that follows another along the path from the root node to the current one.
Definition
prefix.cpp:8
liblevenshtein::Prefix::_parent
Prefix * _parent
Parent prefix node to this one; used to construct the prefix string.
Definition
prefix.h:88
liblevenshtein::Prefix::label
auto label() const -> char
Returns the character label associated with this prefixed position within the dictionary term.
Definition
prefix.cpp:30
liblevenshtein::Prefix::node
auto node() const -> DawgNode *
Returns the node analogous to this prefix, within the dictionary.
Definition
prefix.cpp:26
liblevenshtein::Prefix::Prefix
Prefix(const Prefix &prefix)=default
Copy constructor for a prefix node.
liblevenshtein::Prefix::_node
DawgNode * _node
Analogous dictionary node to this prefix node.
Definition
prefix.h:85
dawg_node.h
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.
src
liblevenshtein
collection
prefix.h
Generated by
1.10.0