Find words with alternating vowels and consonants: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: added Ruby |
→{{header|Haskell}}: Added a Haskell draft. |
||
Line 567: | Line 567: | ||
67: verisimilitude |
67: verisimilitude |
||
</pre> |
</pre> |
||
=={{header|Haskell}}== |
|||
<lang haskell>------ WORDS WITHOUT SUCCESSIVE VOWELS OR CONSONANTS ----- |
|||
isLongAlternator :: String -> Bool |
|||
isLongAlternator s = |
|||
9 < length s |
|||
&& all (\(a, b) -> isVowel a /= isVowel b) (zip s (tail s)) |
|||
isVowel :: Char -> Bool |
|||
isVowel = flip elem "aeiou" |
|||
main :: IO () |
|||
main = do |
|||
s <- readFile "unixdict.txt" |
|||
mapM_ putStrLn $ |
|||
((:) =<< (<> " matching words:\n") . show . length) $ |
|||
filter isLongAlternator (lines s)</lang> |
|||
{{Out}} |
|||
<pre>67 matching words: |
|||
aboriginal |
|||
apologetic |
|||
bimolecular |
|||
borosilicate |
|||
calorimeter |
|||
capacitate |
|||
capacitive |
|||
capitoline |
|||
capitulate |
|||
caricature |
|||
colatitude |
|||
coloratura |
|||
colorimeter |
|||
debilitate |
|||
decelerate |
|||
decolonize |
|||
definitive |
|||
degenerate |
|||
deliberate |
|||
demodulate |
|||
denominate |
|||
denotative |
|||
deregulate |
|||
desiderata |
|||
desideratum |
|||
dilapidate |
|||
diminutive |
|||
epigenetic |
|||
facilitate |
|||
hemosiderin |
|||
heretofore |
|||
hexadecimal |
|||
homogenate |
|||
inoperative |
|||
judicature |
|||
latitudinal |
|||
legitimate |
|||
lepidolite |
|||
literature |
|||
locomotive |
|||
manipulate |
|||
metabolite |
|||
nicotinamide |
|||
oratorical |
|||
paragonite |
|||
pejorative |
|||
peridotite |
|||
peripatetic |
|||
polarimeter |
|||
recitative |
|||
recuperate |
|||
rehabilitate |
|||
rejuvenate |
|||
remunerate |
|||
repetitive |
|||
reticulate |
|||
savonarola |
|||
similitude |
|||
solicitude |
|||
tananarive |
|||
telekinesis |
|||
teratogenic |
|||
topologize |
|||
unilateral |
|||
unimodular |
|||
uninominal |
|||
verisimilitude</pre> |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |