Textonyms: Difference between revisions

m
Line 928:
codeGroups = groupBy (on (==) snd) . sortOn snd $ encodings
textonyms = filter ((1 <) . length) codeGroups
mapM_
mapM_ putStrLn $putStrLn
digitCount = length . snd . head
[ambiguous, longer] =
[take 5 . flip sortBy textonyms] <*>
(flip . comparing <$> [length, digitCount])
[wa, wl] = maximum . map digitCount <$> [ambiguous, longer]
mapM_ putStrLn $
[ "There are " ++
show (length encodings) ++
Line 943 ⟶ 938:
, show (length textonyms) ++ " digit combinations represent textonyms."
, ""
]
, "5 most ambiguous:"
] ++
let digitCount = length . snd . head
[ambiguous, longer] =
[take 5 . flip sortBy textonyms] <*>
(flip . comparing <$> [length, digitCount])
[wa, wl] = maximum . map digitCount <$> [ambiguous, longer]
mapM_ putStrLn $
, "5Five most ambiguous:" :
fmap (showTextonym wa) ambiguous ++
["", : "5Five longest:"] ++: fmap (showTextonym wl) longer
 
------------------------- DISPLAY --------------------------
9,655

edits