Text completion: Difference between revisions

m
→‎Sorenson-Dice: removed two unnecessary '+'
(Added Perl example)
m (→‎Sorenson-Dice: removed two unnecessary '+')
Line 608:
<lang perl6>sub sorenson ($phrase, %hash) {
my $match = bigram $phrase;
%hash.race.map: { [(2 * +($match ∩ .value) / (+$match + .value)).round(.001), .key] }
}
 
2,392

edits