Sorensen–Dice coefficient: Difference between revisions
m
→{{header|jq}}: simplify
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
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];
|