Perl module for comparing text

Can someone suggest a Perl module that can compare two strings and return the degree to which they match? I searched CPAN extensively, and although there are similar modules like String :: Approx and Data :: Compare , they are not what I am looking for. Suppose I have two lines: I love you , and I send you . I want a functionality that will compare these two lines, taking into account many parameters, matching the words in the correct order ( love , since the first word in the line should not match "strong> love strong> as the 4th word in the second line, although both the lines have this word), the words do not match, but are written almost in the same way (for example, love andloge ), number of words, etc. and return an index, for example, a number from 0 to 1 on a scale of 1 representing the degree of similarity between two rows. Is there such a Perl module?

+5
source share
1 answer

There are many such modules. Often, however, you will have to use them in some special way to take into account your own assumptions. Most string comparison tools like this just implement some algorithm to compare one line with another. Most believe that if you have specific political decisions, you will encode them yourself.

Personally, I'm not sure I recommend Text :: Levenshtein due to bugs and lack of support for ut8. However, I do not have a better recommendation.

, , , ( ):

, :

+6

All Articles