VLC 4.0.0-dev
vlc_jaro_winkler.h
Go to the documentation of this file.
1/*****************************************************************************
2 * jaro_winkler.c: jaro winkler string similarity algorithm implementation
3 *****************************************************************************
4 * Copyright 2015 Danny Guo
5 * Copyright 2018, 2019 Lyndon Brown
6 *
7 * Authors: Danny Guo <dguo@users.noreply.github.com>
8 * Lyndon Brown <jnqnfe@gmail.com>
9 *
10 * Licensed under the MIT license. You may not copy, modify, or distribute this
11 * file except in compliance with said license. You can find a copy of this
12 * license either in the LICENSE file, or alternatively at
13 * <http://opensource.org/licenses/MIT>.
14 *****************************************************************************
15 * This file is based upon the Jaro Winkler implementation of the `strsim`
16 * Rust crate, authored by Danny Guo, available at
17 * <https://github.com/dguo/strsim-rs>; more specifically the (as yet un-merged)
18 * optimised copy authored by myself (Lyndon Brown), available at
19 * <https://github.com/dguo/strsim-rs/pull/31>. The code is available under the
20 * MIT license.
21 *****************************************************************************/
22
23#ifndef VLC_JARO_WINKLER_H
24#define VLC_JARO_WINKLER_H 1
25
26/**
27 * Calculate a “Jaro Winkler” metric.
28 *
29 * Algorithm: <http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance>
30 *
31 * Like “Jaro” but gives a boost to strings that have a common prefix.
32 *
33 * \note: This implementation does not place a limit the common prefix length
34 * adjusted for.
35 *
36 * \param a string A
37 * \param b string B
38 * \param res [OUT] a pointer to a float to receive the result
39 * \return -1 on memory allocation failure, otherwise 0
40 */
41int vlc_jaro_winkler(const char *a, const char *b, float *res);
42
43#endif
int vlc_jaro_winkler(const char *a, const char *b, float *res)
Calculate a “Jaro Winkler” metric.
Definition: jaro_winkler.c:161