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") |
||
definedSamples |
|||
ambiguousAndLongerSamples |
|||
:: Int |
:: Int |
||
-> [[(String, String)]] |
-> [[(String, String)]] |
||
-> [[(String, String)] -> Int] |
-> [[(String, String)] -> Int] |
||
-> [[[(String, String)]]] |
-> [[[(String, String)]]] |
||
definedSamples n xs fs = |
|||
[take n . flip sortBy xs] <*> (flip . comparing <$> fs) |
[take n . flip sortBy xs] <*> (flip . comparing <$> fs) |
||
Line 948: | Line 948: | ||
] |
] |
||
let codeLength = length . snd . head |
let codeLength = length . snd . head |
||
[ambiguous, longer] = |
[ambiguous, longer] = definedSamples 5 textonyms [length, codeLength] |
||
ambiguousAndLongerSamples 5 textonyms [length, codeLength] |
|||
[wa, wl] = maximum . fmap codeLength <$> [ambiguous, longer] |
[wa, wl] = maximum . fmap codeLength <$> [ambiguous, longer] |
||
mapM_ putStrLn $ |
mapM_ putStrLn $ |