Jaro similarity: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: white space and layout) |
m (→{{header|Haskell}}: Comment positions tidied) |
||
Line 1,079: | Line 1,079: | ||
r = quot l2 2 - 1 |
r = quot l2 2 - 1 |
||
in mapMaybe |
in mapMaybe |
||
(\(c, n) |
(\(c, n) |
||
-- Initial chars out of range ? |
|||
-> |
|||
let offset = max 0 (n - (r + 1)) |
|||
-- Any offset for this char within range. |
-- Any offset for this char within range. |
||
in elemIndex c (drop offset (take (n + r) ys)) >>= |
in elemIndex c (drop offset (take (n + r) ys)) >>= |