liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
|
Represents the prefix of a dictionary term. More...
#include <prefix.h>
Public Member Functions | |
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. | |
Prefix (DawgNode *root) | |
Constructs the initial prefix from which all prefixes of the dictionary terms follow. | |
Prefix (const Prefix &prefix)=default | |
Copy constructor for a prefix node. | |
Prefix (Prefix &&prefix) noexcept | |
Move constructor for a prefix node. | |
auto | node () const -> DawgNode * |
Returns the node analogous to this prefix, within the dictionary. | |
auto | label () const -> char |
Returns the character label associated with this prefixed position within the dictionary term. | |
auto | str () const -> std::string |
Returns the string constructed by following the path between the root prefix node and this one, which is either a prefix of the current dictionary term or the whole term (which is also a prefix). | |
Private Attributes | |
DawgNode * | _node |
Analogous dictionary node to this prefix node. | |
Prefix * | _parent |
Parent prefix node to this one; used to construct the prefix string. | |
char | _label |
Current character label along the path from the root prefix node to this one. | |
Friends | |
auto | operator<< (std::ostream &out, const Prefix &prefix) -> std::ostream & |
Specifies the ostream operator may access all this node's members. | |
Represents the prefix of a dictionary term.
The prefix is formed by traversing the outgoing edges from the root node of the dictionary.
Constructs a new prefix that follows another along the path from the root node to the current one.
node | Dictionary node represented by this prefix. |
parent | Prefix representing the path from the root node to that immediately prior to this one. |
label | Character label for the current position within the dictionary term. |
Definition at line 8 of file prefix.cpp.
liblevenshtein::Prefix::Prefix | ( | DawgNode * | root | ) |
Constructs the initial prefix from which all prefixes of the dictionary terms follow.
root | Root node of the dictionary. |
Definition at line 14 of file prefix.cpp.
Copy constructor for a prefix node.
prefix | Prefix node to copy. |
|
noexcept |
Returns the character label associated with this prefixed position within the dictionary term.
Definition at line 30 of file prefix.cpp.
References _label.
Returns the node analogous to this prefix, within the dictionary.
Definition at line 26 of file prefix.cpp.
References _node.
auto liblevenshtein::Prefix::str | ( | ) | const -> std::string |
Returns the string constructed by following the path between the root prefix node and this one, which is either a prefix of the current dictionary term or the whole term (which is also a prefix).
Definition at line 34 of file prefix.cpp.
References query().
|
private |
|
private |
|
private |