Sorensen–Dice coefficient: Difference between revisions

m
m (felicity)
m (→‎{{header|jq}}: simplify)
 
Line 327:
| .[1] as $j
| if $i == ($A|length) or $j == ($B|length) then empty
elif $A[$i] == $B[$j] then $A[$i]1, ([$i+1, $j+1] | pop)
elif $A[$i] < $B[$j] then [$i+1, $j] | pop
else [$i, $j+1] | pop
Line 337:
# Emit a stream of the bigrams of the input string blindly
def bg: . as $in | range(0;length-1 ) | $in[.:.+2];
ascii_downcase | [splits(" *") | bg];
| reduce splits(" *") as $word ([];
. + [$word | bg]);
 
 
2,442

edits