|
myMPD
Internal API documentation
|
Fuzzy search implementation. More...

Macros | |
| #define | MIN3(a, b, c) |
Functions | |
| static size_t | levenshtein (const char *a, size_t a_len, const char *b, size_t b_len, size_t *cache, size_t max_distance) |
| bool | mympd_search_fuzzy_match (const char *haystack, size_t haystack_len, const char *needle, size_t needle_len) |
Fuzzy search implementation.
| #define MIN3 | ( | a, | |
| b, | |||
| c ) |
Private functions Return the minimum of 3 integers
|
static |
Private definitions
Calculate the levenshtein distance https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#C
| a | String 1 |
| a_len | Length of a |
| b | String 2 |
| b_len | Length of b |
| cache | Matrix cache |
| max_distance | Return as soon as the calculated distance is smaller than this value |
| bool mympd_search_fuzzy_match | ( | const char * | haystack, |
| size_t | haystack_len, | ||
| const char * | needle, | ||
| size_t | needle_len ) |
Public functions Fuzzy substring matching using the levenshtein distance
| haystack | Haystack |
| haystack_len | Haystack length |
| needle | Needle |
| needle_len | Needle length |