ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
levenshtein.h
Go to the documentation of this file.
1
12
13#ifndef LEVENSHTEIN_H
14#define LEVENSHTEIN_H
15
16#include "../common.h"
17#include <stddef.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
32#define LEVENSHTEIN_SUGGESTION_THRESHOLD 4
33
47ASCIICHAT_API size_t levenshtein(const char *a, const char *b);
48
58ASCIICHAT_API size_t levenshtein_n(const char *a, const size_t length,
59 const char *b, const size_t bLength);
60
71ASCIICHAT_API const char *
72levenshtein_find_similar(const char *unknown, const char *const *candidates);
73
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif // LEVENSHTEIN_H
size_t levenshtein_n(const char *a, const size_t length, const char *b, const size_t bLength)
Calculate Levenshtein distance with explicit string lengths.
Definition levenshtein.c:25
const char * levenshtein_find_similar(const char *unknown, const char *const *candidates)
Find the most similar string from a NULL-terminated array.
size_t levenshtein(const char *a, const char *b)
Calculate Levenshtein distance between two strings.
Definition levenshtein.c:79
#define ASCIICHAT_API
Export symbols on Unix platforms (Linux, macOS).
Definition api.h:87
⚙️ Common definitions, error codes, macros, and types shared throughout the application