in reply to Measuring Substrings Problem
sub score { my ($str, $array) = @_; my $vec = ''; for (@$array) { my $idx = index $str, $_; # Set bits at each matched location vec($vec, $_, 1)= 1 for $idx..$idx+length($_)-1; } # Count set bits unpack '%32b*', $vec; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Substring Distance Problem
by monkfan (Curate) on Apr 09, 2005 at 04:58 UTC | |
by tlm (Prior) on Apr 09, 2005 at 07:42 UTC | |
|
Re^2: Substring Distance Problem
by tlm (Prior) on Apr 08, 2005 at 16:53 UTC |