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://github.com/ugexe/Text--Levenshtein--XS/issues

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.