• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

t/H03-Jul-2009-3729

COPYINGH A D03-Mar-200517.6 KiB341281

ChangesH A D03-Jul-20091.1 KiB3223

MANIFESTH A D03-Mar-2005237 1211

META.ymlH A D03-Jul-2009475 2120

Makefile.PLH A D03-Mar-2005336 1511

READMEH A D03-Jul-20091.9 KiB4736

Similarity.pmH A D04-Nov-20082.1 KiB8010

Similarity.xsH A D04-Nov-20081 KiB5646

fstrcmp.cH A D04-Nov-200815.8 KiB639388

fstrcmp.hH A D04-Nov-2008962 264

README

1NAME
2    String::Similarity - calculate the similarity of two strings
3
4SYNOPSIS
5     use String::Similarity;
6
7     $similarity = similarity $string1, $string2;
8     $similarity = similarity $string1, $string2, $limit;
9
10DESCRIPTION
11    $factor = similarity $string1, $string2, [$limit]
12        The "similarity"-function calculates the similarity index of its two
13        arguments. A value of 0 means that the strings are entirely
14        different. A value of 1 means that the strings are identical.
15        Everything else lies between 0 and 1 and describes the amount of
16        similarity between the strings.
17
18        It roughly works by looking at the smallest number of edits to
19        change one string into the other.
20
21        You can add an optional argument $limit (default 0) that gives the
22        minimum similarity the two strings must satisfy. "similarity" stops
23        analyzing the string as soon as the result drops below the given
24        limit, in which case the result will be invalid but lower than the
25        given $limit. You can use this to speed up the common case of
26        searching for the most similar string from a set by specifing the
27        maximum similarity found so far.
28
29SEE ALSO
30     The basic algorithm is described in:
31     "An O(ND) Difference Algorithm and its Variations", Eugene Myers,
32     Algorithmica Vol. 1 No. 2, 1986, pp. 251-266;
33     see especially section 4.2, which describes the variation used below.
34
35     The basic algorithm was independently discovered as described in:
36     "Algorithms for Approximate String Matching", E. Ukkonen,
37     Information and Control Vol. 64, 1985, pp. 100-118.
38
39AUTHOR
40     Marc Lehmann <schmorp@schmorp.de>
41     http://home.schmorp.de/
42
43     (the underlying fstrcmp function was taken from gnu diffutils and
44     modified by Peter Miller <pmiller@agso.gov.au> and Marc Lehmann
45     <schmorp@schmorp.de>).
46
47