liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
symmetric_pair.h
Go to the documentation of this file.
1#ifndef LIBLEVENSHTEIN_DISTANCE_SYMMETRIC_IMMUTABLE_PAIR_H
2#define LIBLEVENSHTEIN_DISTANCE_SYMMETRIC_IMMUTABLE_PAIR_H
3
4#include <iostream>
5#include <string>
6
8
13public:
14
22 SymmetricPair(const std::string &u, const std::string &v);
23
30 auto operator==(const SymmetricPair &other) const -> bool;
31
33 friend class std::hash<SymmetricPair>;
34
36 friend auto operator<<(std::ostream &out, const SymmetricPair &pair)
37 -> std::ostream &;
38
39private:
40
42 std::string first;
43
45 std::string second;
46};
47
48} // namespace liblevenshtein::distance
49
50namespace std {
51
55template <>
56struct hash<liblevenshtein::distance::SymmetricPair> {
57
65 -> std::size_t;
66};
67
68} // namespace std
69
70#endif // __LIBLEVENSHTEIN__COLLECTION__SYMMETRIC_IMMUTABLE_PAIR_H__
Represents a pair of terms sorted, lexicographically, in ascending order.
SymmetricPair(const std::string &u, const std::string &v)
Constructs a SymmetricPair of terms such that the first term is the lesser, lexicographically,...
std::string second
The lexicographically greater term of the pair.
std::string first
The lexicographically lesser term of the pair.
friend auto operator<<(std::ostream &out, const SymmetricPair &pair) -> std::ostream &
The ostream operator may access all the members of this class.
auto operator==(const SymmetricPair &other) const -> bool
Determines whether this SymmetricPair is equivalent to another.
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition main.cpp:25
Memoized, recursive distance metrics typically used to evaluate the correctness of Levenshtein automa...
Various utilities regarding Levenshtein transducers.
Definition namespaces.dox:9
STL namespace.
auto operator()(const liblevenshtein::distance::SymmetricPair &pair) const -> std::size_t
Generates the hash code for a SymmetricPair.