NAME

Text::Dice - Calculate Dice's coefficient of two strings

SYNOPSIS

use Text::Dice;
$coefficient = coefficient $string1, $string2;
# or if you want to tokenize the strings yourself:
$coefficient = coefficient \%array1, \%array2;

DESCRIPTION

The Text::Dice module calculates Dice's coefficient of two strings. The main benefits of this algorithm are: true reflection of lexical similarity, robustness to changes of word order, and language independence.

FUNCTIONS

coefficient

$coefficient = coefficient $string1, $string2
$coefficient = coefficient \@array1, \@array2

Returns a number between 0 and 1; the higher the number, the greater the similarity.

The two input strings are internally tokenized into character bigrams. If you wish to use a different tokenization method, pass in the resulting array references.

SEE ALSO

http://en.wikipedia.org/wiki/Dice%27s_coefficient

http://www.catalysoft.com/articles/StrikeAMatch.html

REQUESTS AND BUGS

Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=Text-Dice. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Text::Dice

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright (C) 2012-2015 gray <gray at cpan.org>, all rights reserved.

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

AUTHOR

gray, <gray at cpan.org>