Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
levenshtein.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#ifndef __ASE_LEVENSHTEIN_HH__
3#define __ASE_LEVENSHTEIN_HH__
4
5#include "cxxaux.hh"
6
7namespace Ase {
8
9// Damerau-Levenshtein Distance with restricted transposition, memory requirement: 12 * max(|source|,|target|) + constant
10float damerau_levenshtein_restricted (const std::string &source, const std::string &target,
11 const float ci = 1, // insertion
12 const float cd = 1, // deletion
13 const float cs = 1, // substitution
14 const float ct = 1); // transposition
15
16// Damerau-Levenshtein Distance with unrestricted transpositions, memory requirement: 4 * |source|*|target| + constant
17float damerau_levenshtein_distance (const std::string &source, const std::string &target,
18 const float ci = 1, // insertion
19 const float cd = 1, // deletion
20 const float cs = 1, // substitution
21 const float ct = 1); // transposition
22
23} // Ase
24
25#endif // __ASE_LEVENSHTEIN_HH__
The Anklang C++ API namespace.
Definition api.hh:9
float damerau_levenshtein_distance(const std::string &source, const std::string &target, const float ci, const float cd, const float cs, const float ct)
float damerau_levenshtein_restricted(const std::string &source, const std::string &target, const float ci, const float cd, const float cs, const float ct)