aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-20 14:19:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-20 14:19:55 +0100
commita696a5e1c89118c44ff88ee15c3a662d07015119 (patch)
tree382cdcf87b82a9f4b0da947f20378709bf4d65c7 /src/libutil/str_util.h
parent04764a1d23491bb1029d090fd011f072e5326f24 (diff)
downloadrspamd-a696a5e1c89118c44ff88ee15c3a662d07015119.tar.gz
rspamd-a696a5e1c89118c44ff88ee15c3a662d07015119.zip
Add function to calculate lev distance between strings
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r--src/libutil/str_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 986fc7f03..e07c51701 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -141,4 +141,15 @@ gsize rspamd_decode_url (gchar *dst, const gchar *src, gsize size);
# define g_tolower(x) (((x) >= 'A' && (x) <= 'Z') ? (x) - 'A' + 'a' : (x))
#endif
+/**
+ * Return levenstein distance between two strings
+ * @param s1
+ * @param s1len
+ * @param s2
+ * @param s2len
+ * @return
+ */
+gint rspamd_strings_levenshtein_distance (const gchar *s1, gsize s1len,
+ const gchar *s2, gsize s2len);
+
#endif /* SRC_LIBUTIL_STR_UTIL_H_ */