liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
|
Metric that measures the edit distance between two terms, denoted d(v,w)
.
More...
#include <distance.h>
Public Member Functions | |
virtual auto | between (std::string v, std::string w) -> std::size_t=0 |
Measures the edit distance between two terms. | |
auto | operator() (const std::string &v, const std::string &w) -> std::size_t |
Measures the edit distance between two terms. | |
Metric that measures the edit distance between two terms, denoted d(v,w)
.
The edit distance is the minimum number of elementary operations required to transform one term into the other, but it does not describe a unique combination of transformations. Elementary operations consist of insertion, deletion, and substitution, and any others specific to each implementation.
A distance metric satisfies the following axioms:
d(x, y) = 0, if x = y
d(x, y) > 0, if x != y
d(x, y) = d(y, x)
d(x, z) <= d(x, y) + d(y, z)
Definition at line 21 of file distance.h.
|
pure virtual |
Measures the edit distance between two terms.
v | First term to compare. |
w | Second term to compare. |
Implemented in liblevenshtein::distance::MergeAndSplitDistance, liblevenshtein::distance::StandardDistance, and liblevenshtein::distance::TranspositionDistance.
auto liblevenshtein::distance::Distance::operator() | ( | const std::string & | v, |
const std::string & | w ) -> std::size_t |
Measures the edit distance between two terms.
This is equivalent to calling between(v, w)
.
v | First term to compare. |
w | Second term to compare. |
Definition at line 5 of file distance.cpp.
References query().