Text completion: Difference between revisions

Content added Content deleted
m (→‎Sorenson-Dice: fewer intermediates)
m (→‎Sorenson-Dice: stabilize the returned sort order)
Line 560: Line 560:


# Testing
# Testing
for 'complition', 'inconsqual', 'Sørenson' -> $w {
for <complition inconsqual Sørenson> -> $w {
say "\n$w:";
say "\n$w:";
.say for sorenson($w, %hash).grep(*.[0] >= .55).sort(-*[0]).head(10);
.say for sorenson($w, %hash).grep(*.[0] >= .55).sort({-.[0],~.[1]}).head(10);
}</lang>
}</lang>


Line 568: Line 568:
<pre>complition:
<pre>complition:
[0.778 completion]
[0.778 completion]
[0.737 composition]
[0.737 competition]
[0.737 competition]
[0.737 composition]
[0.706 coalition]
[0.706 coalition]
[0.7 incompletion]
[0.7 incompletion]
[0.667 decomposition]
[0.667 complexion]
[0.667 complexion]
[0.667 complicity]
[0.667 complicity]
[0.667 decomposition]
[0.632 compilation]
[0.632 compilation]
[0.632 computation]
[0.632 compunction]


inconsqual:
inconsqual:
Line 589: Line 589:
[0.667 benson]
[0.667 benson]
[0.615 swenson]
[0.615 swenson]
[0.571 sorensen]
[0.571 evensong]
[0.571 evensong]</pre>
[0.571 sorensen]</pre>


=={{header|REXX}}==
=={{header|REXX}}==