Words containing "the" substring: Difference between revisions

m (→‎{{header|REXX}}: made more idiomatic.)
Line 378:
 
=={{header|Julia}}==
See [[Alternade_words:Julia]] for the foreachword function.
<lang julia>function wordscontaining(needle, overlength, dictfile)
<lang julia>containsthe(w, d) = occursin("the", w) ? w : ""
for haystack in split(read(dictfile, String))
foreachword("unixdict.txt", containsthe, minlen = 12)
length(haystack) > overlength && occursin(needle, haystack) && println(haystack)
end
end
 
wordscontaining("the", 11, "unixdict.txt")
</lang>{{out}}
<pre>
Word source: unixdict.txt
authenticate
 
chemotherapy
authenticate chemotherapy chrysanthemum clothesbrush clotheshorse eratosthenes
chrysanthemum
featherbedding featherbrain featherweight gaithersburg hydrothermal lighthearted
clothesbrush
mathematician neurasthenic nevertheless northeastern northernmost otherworldly
clotheshorse
parasympatheticphysiotherapistphysiotherapy psychotherapeuticpsychotherapistpsychotherapy
eratosthenes
radiotherapy southeastern southernmost theoretician weatherbeaten weatherproof
featherbedding
weatherstrip weatherstripping
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping
</pre>
 
4,107

edits