Textonyms: Difference between revisions

Content added Content deleted
Line 928: Line 928:
codeGroups = groupBy (on (==) snd) . sortOn snd $ encodings
codeGroups = groupBy (on (==) snd) . sortOn snd $ encodings
textonyms = filter ((1 <) . length) codeGroups
textonyms = filter ((1 <) . length) codeGroups
digitCount = length . snd . head
[ambiguous, longer] =
[ambiguous, longer] =
[take 5 . flip sortBy textonyms] <*>
[take 5 . flip sortBy textonyms] <*>
(flip . comparing <$> [length, length . snd . head])
(flip . comparing <$> [length, digitCount])
[wa, wl] = maximum . map (length . snd . head) <$> [ambiguous, longer]
[wa, wl] = maximum . map digitCount <$> [ambiguous, longer]
mapM_ putStrLn $
mapM_ putStrLn $
[ "There are " ++
[ "There are " ++