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
7
namespace
liblevenshtein::distance
{
8
12
class
SymmetricPair
{
13
public
:
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
39
private
:
40
42
std::string
first
;
43
45
std::string
second
;
46
};
47
48
}
// namespace liblevenshtein::distance
49
50
namespace
std
{
51
55
template
<>
56
struct
hash
<
liblevenshtein
::distance::SymmetricPair> {
57
64
auto
operator()
(
const
liblevenshtein::distance::SymmetricPair
&pair)
const
65
-> std::size_t;
66
};
67
68
}
// namespace std
69
70
#endif
// __LIBLEVENSHTEIN__COLLECTION__SYMMETRIC_IMMUTABLE_PAIR_H__
liblevenshtein::distance::SymmetricPair
Represents a pair of terms sorted, lexicographically, in ascending order.
Definition
symmetric_pair.h:12
liblevenshtein::distance::SymmetricPair::SymmetricPair
SymmetricPair(const std::string &u, const std::string &v)
Constructs a SymmetricPair of terms such that the first term is the lesser, lexicographically,...
Definition
symmetric_pair.cpp:9
liblevenshtein::distance::SymmetricPair::second
std::string second
The lexicographically greater term of the pair.
Definition
symmetric_pair.h:45
liblevenshtein::distance::SymmetricPair::first
std::string first
The lexicographically lesser term of the pair.
Definition
symmetric_pair.h:42
liblevenshtein::distance::SymmetricPair::operator<<
friend auto operator<<(std::ostream &out, const SymmetricPair &pair) -> std::ostream &
The ostream operator may access all the members of this class.
Definition
symmetric_pair.cpp:23
liblevenshtein::distance::SymmetricPair::operator==
auto operator==(const SymmetricPair &other) const -> bool
Determines whether this SymmetricPair is equivalent to another.
Definition
symmetric_pair.cpp:19
query
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition
main.cpp:25
liblevenshtein::distance
Memoized, recursive distance metrics typically used to evaluate the correctness of Levenshtein automa...
Definition
namespaces.dox:16
liblevenshtein
Various utilities regarding Levenshtein transducers.
Definition
namespaces.dox:9
std
STL namespace.
std::hash< liblevenshtein::distance::SymmetricPair >::operator()
auto operator()(const liblevenshtein::distance::SymmetricPair &pair) const -> std::size_t
Generates the hash code for a SymmetricPair.
src
liblevenshtein
distance
symmetric_pair.h
Generated by
1.10.0