Jump to content

Textonyms: Difference between revisions

m
m (→‎{{header|Haskell}}: generalised a little)
Line 920:
(words "abc def ghi jkl mno pqrs tuv wxyz")
 
ambigousAndLongerSamplesambiguousAndLongerSamples :: Int
-> [[(String, String)]]
-> [[[(String, String)]]]
ambigousAndLongerSamplesambiguousAndLongerSamples n textonyms =
[take n . flip sortBy textonyms] <*>
(flip . comparing <$> [length, length . snd . head])
Line 948:
]
let [ambiguous, longer] = ambigousAndLongerSamplesambiguousAndLongerSamples 5 textonyms
[wa, wl] = maximum . fmap (length . snd . head) <$> [ambiguous, longer]
mapM_ putStrLn $
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.