Textonyms: Difference between revisions
m
→{{header|Haskell}}
Line 920:
(words "abc def ghi jkl mno pqrs tuv wxyz")
ambiguousAndLongerSamples
:: Int
-> [[(String, String)]]▼
-> [[(String, String)] -> Int]
ambiguousAndLongerSamples n textonyms =▼
[take n . flip sortBy textonyms] <*>▼
--------------------------- TEST ---------------------------
Line 947:
, ""
]
let codeLength = length . snd . head
ambiguousAndLongerSamples 5 textonyms [length, codeLength]
[wa, wl] = maximum . fmap
mapM_ putStrLn $
"Five most ambiguous:" :
|