Better distance function
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Mar 2017 22:28:14 +0000 (00:28 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Mar 2017 22:28:14 +0000 (00:28 +0200)
lib/Text/Levenshtein/Edlib.pm

index e61b4a3bdb6e011bf3ee8a432ef499dfc1f9ff41..6b38a6c742a892a3f21b7db106c6f38efe5befe8 100644 (file)
@@ -67,8 +67,8 @@ sub align {
 }
 
 sub distance {
 }
 
 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 {
 }
 
 sub to_cigar {
@@ -120,7 +120,7 @@ This module has two functions:
 
 =over
 
 
 =over
 
-=item B<distance>(I<$query>, I<$target>, [I<$max_distance>])
+=item B<distance>(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<Text::Levenshtein::XS>.
 
 This is the basic interface to the library. It is compatible with the
 function of the same name in L<Text::Levenshtein::XS>.
@@ -128,7 +128,8 @@ function of the same name in L<Text::Levenshtein::XS>.
 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
 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<align>(I<$query>, I<$target>, [I<$max_distance>, [I<$mode>, [I<$task>]]])
 
 
 =item B<align>(I<$query>, I<$target>, [I<$max_distance>, [I<$mode>, [I<$task>]]])
 
This page took 0.011177 seconds and 4 git commands to generate.