Nick Logan > Text-Levenshtein-XS-0.1 > Text::Levenshtein::XS

Download:
Text-Levenshtein-XS-0.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.1   Source   Latest Release: Text-Levenshtein-XS-0.43

NAME ^

Text::Levenshtein::XS - XS Levenshtein edit distance.

SYNOPSIS ^

        use Text::Levenshtein::XS qw/distance/;

        print distance('Neil','Niel');
        # prints 2

DESCRIPTION ^

Returns the number of edits (insert,delete,substitute) required to turn the source string into the target string. XS implementation (requires a C compiler). Works correctly with utf8.

        use Text::Levenshtein::XS qw/distance/;
        use utf8;

        distance('ⓕⓞⓤⓡ','ⓕⓤⓞⓡ'), 
        # prints 2

METHODS ^

distance

Arguments: source string and target string.

Returns: int that represents the edit distance between the two argument. Stops calculations and returns -1 if max distance is set and reached.

Wrapper function to take the edit distance between a source and target string using XS algorithm implementation.

        use Text::Levenshtein::XS qw/distance/;
        print distance('Neil','Niel');
        # prints 2

NOTES ^

Drop in replacement for Text::LevenshteinXS

SEE ALSO ^

BUGS ^

Please report bugs to:

https://rt.cpan.org/Public/Dist/Display.html?Name=Text-Levenshtein-XS

AUTHOR ^

Nick Logan <ugexe@cpan.com>

LICENSE AND COPYRIGHT ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: