Textonyms: Difference between revisions
Content added Content deleted
Line 920: | Line 920: | ||
(words "abc def ghi jkl mno pqrs tuv wxyz") |
(words "abc def ghi jkl mno pqrs tuv wxyz") |
||
ambiguousAndLongerSamples |
ambiguousAndLongerSamples |
||
:: Int |
|||
⚫ | |||
-> [[(String, String)]] |
|||
-> [[(String, String)] -> Int] |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
(flip . comparing <$> [length, length . snd . head]) |
|||
⚫ | |||
--------------------------- TEST --------------------------- |
--------------------------- TEST --------------------------- |
||
Line 947: | Line 947: | ||
, "" |
, "" |
||
] |
] |
||
let codeLength = length . snd . head |
|||
[ambiguous, longer] = |
|||
ambiguousAndLongerSamples 5 textonyms [length, codeLength] |
|||
[wa, wl] = maximum . fmap |
[wa, wl] = maximum . fmap codeLength <$> [ambiguous, longer] |
||
mapM_ putStrLn $ |
mapM_ putStrLn $ |
||
"Five most ambiguous:" : |
"Five most ambiguous:" : |