Find words with alternating vowels and consonants: Difference between revisions
Content deleted Content added
Realize in F# |
|||
Line 804:
</pre>
=={{header|F_Sharp|F#}}==
<lang fsharp>
// Find words with alternating vowels and consonants. Nigel Galloway: January 20th., 2020
let vowels=set['a';'e';'i';'o';'u']
let fN g=let rec fN g=function h::t->(if g<>vowels.Contains h then fN (not g) t else false)|_->true
fN (vowels.Contains(Seq.head g)) (Seq.tail g|>List.ofSeq)
seq{use n=System.IO.File.OpenText("unixdict.txt") in while not n.EndOfStream do yield n.ReadLine()}
|>Seq.filter(fun g->g.Length>9 && fN g)|>Seq.iter(printfn "%s")
</lang>
{{out}}
<pre>
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|Factor}}==
{{works with|Factor|0.99 2020-08-14}}
|