annotate 2.4/lib/perl5/x86_64-linux-gnu-thread-multi/Text/LevenshteinXS.pm @ 16:8eb7d93f7e58 draft

Uploaded
author plus91-technologies-pvt-ltd
date Sat, 31 May 2014 11:23:36 -0400
parents e3609c8714fb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
1 package Text::LevenshteinXS;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
2
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
3 use strict;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
4 use warnings;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
5 use Carp;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
6
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
7 require Exporter;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
8 require DynaLoader;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
9 use AutoLoader;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
10
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
11 our @ISA = qw(Exporter DynaLoader);
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
12
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
13 our %EXPORT_TAGS = ( 'all' => [ qw(
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
14
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
15 ) ] );
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
16
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
17 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
18
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
19 our @EXPORT = qw(
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
20 distance
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
21 );
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
22 our $VERSION = '0.03';
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
23
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
24 bootstrap Text::LevenshteinXS $VERSION;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
25
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
26 1;
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
27 __END__
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
28
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
29 =head1 NAME
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
30
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
31 Text::LevenshteinXS - An XS implementation of the Levenshtein edit distance
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
32
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
33 =head1 SYNOPSIS
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
34
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
35 use Text::LevenshteinXS qw(distance);
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
36
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
37 print distance("foo","four");
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
38 # prints "2"
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
39
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
40 print distance("foo","bar");
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
41 # prints "3"
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
42
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
43
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
44 =head1 DESCRIPTION
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
45
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
46 This module implements the Levenshtein edit distance in a XS way.
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
47
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
48 The Levenshtein edit distance is a measure of the degree of proximity between two strings.
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
49 This distance is the number of substitutions, deletions or insertions ("edits")
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
50 needed to transform one string into the other one (and vice versa).
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
51 When two strings have distance 0, they are the same.
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
52 A good point to start is: <http://www.merriampark.com/ld.htm>
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
53
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
54
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
55 =head1 CREDITS
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
56
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
57 All the credits go to Vladimir Levenshtein the author of the algorithm and to
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
58 Lorenzo Seidenari who made the C implementation <http://www.merriampark.com/ldc.htm>
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
59
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
60
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
61 =head1 SEE ALSO
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
62
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
63 Text::Levenshtein , Text::WagnerFischer , Text::Brew , String::Approx
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
64
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
65
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
66 =head1 AUTHOR
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
67
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
68 Copyright 2003 Dree Mistrut <F<dree@friul.it>>
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
69 Modifications Copyright 2004 Josh Goldberg <F<josh@3io.com>>
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
70
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
71 This package is free software and is provided "as is" without express
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
72 or implied warranty. You can redistribute it and/or modify it under
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
73 the same terms as Perl itself.
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
74
e3609c8714fb Uploaded
plus91-technologies-pvt-ltd
parents:
diff changeset
75 =cut