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
8
9
10namespace liblevenshtein {
11
16class Prefix {
17public:
18
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
80 -> std::ostream &;
81
83
86
89
92 char _label;
93};
94
95} // namespace liblevenshtein
96
97
98#endif // LIBLEVENSHTEIN_COLLECTION_PREFIX_H
Represents a position within one or more terms of a DAWG dictionary.
Definition dawg_node.h:20
Represents the prefix of a dictionary term.
Definition prefix.h:16
char _label
Current character label along the path from the root prefix node to this one.
Definition prefix.h:92
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
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
Prefix * _parent
Parent prefix node to this one; used to construct the prefix string.
Definition prefix.h:88
auto label() const -> char
Returns the character label associated with this prefixed position within the dictionary term.
Definition prefix.cpp:30
auto node() const -> DawgNode *
Returns the node analogous to this prefix, within the dictionary.
Definition prefix.cpp:26
Prefix(const Prefix &prefix)=default
Copy constructor for a prefix node.
DawgNode * _node
Analogous dictionary node to this prefix node.
Definition prefix.h:85
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
STL namespace.