X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FText%2FLevenshtein%2FEdlib.pm;h=8dd4146aaae4fd42408dcd891e535574f5bd3773;hb=a35dd4c351c2c795ff9c433c74f82cbdc7595595;hp=e61b4a3bdb6e011bf3ee8a432ef499dfc1f9ff41;hpb=ed67b619dc8a9c4a18e90069684e57e47fcbd99b;p=text-levenshtein-edlib.git diff --git a/lib/Text/Levenshtein/Edlib.pm b/lib/Text/Levenshtein/Edlib.pm index e61b4a3..8dd4146 100644 --- a/lib/Text/Levenshtein/Edlib.pm +++ b/lib/Text/Levenshtein/Edlib.pm @@ -67,8 +67,8 @@ sub align { } sub distance { - my ($q, $t, $k) = @_; - align($q, $t, $k)->{editDistance} + my ($q, $t, $k, $mode) = @_; + align($q, $t, $k, $mode, EDLIB_TASK_DISTANCE())->{editDistance} } sub to_cigar { @@ -120,7 +120,7 @@ This module has two functions: =over -=item B(I<$query>, I<$target>, [I<$max_distance>]) +=item B(I<$query>, I<$target>, [I<$max_distance>, [I<$mode>]]) This is the basic interface to the library. It is compatible with the function of the same name in L. @@ -128,7 +128,8 @@ function of the same name in L. It returns the edit distance between the two given strings. If the third argument is specified, and the edit distance is greater than the value of the third argument, then the function finishes the -computation early and returns undef. +computation early and returns undef. See below for the meaning of the +optional I<$mode> argument. =item B(I<$query>, I<$target>, [I<$max_distance>, [I<$mode>, [I<$task>]]]) @@ -199,20 +200,34 @@ the beginning and C at the end of the target are ignored. =back -The fifth argument, I<$task>, chooses what we want to compute. -If set to C (default), all the keys described above will be computed. -If set to C, all keys except for C will be computed. -If set to C, all keys except for C and C will be computed. -The less we compute, the faster the function will run. +The fifth argument, I<$task>, chooses what we want to compute. The options are: + +=over + +=item C (default, slowest) + +All the keys described above will be computed. + +=item C + +All keys except for C will be computed. + +=item C (fastest) + +All keys except for C and C will be computed. + +=back + +The less the function computes, the faster it runs. =back =head2 EXPORT -All constants by default. You can export the functions C and -C and any of the constants below. You can use the tags -C<:constants> to export every constant, and C<:all> to export every -constant, C and C. +All constants by default. You can export the functions C, +C and C and any of the constants below. You can +use the tags C<:constants> to export every constant, and C<:all> to +export every constant, C, C and C. =head2 Exportable constants