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)
let offset = max 0 (n - (r + 1)) -- initial chars out of range ?
-- 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)) >>=