WiktionaryDumps to words: Difference between revisions

m
write to a file not to the terminal
m (write to a file not to the terminal)
Line 315:
<lang julia>using CodecBzip2
 
function getwords(io::IO, output::IO, languagemark = "==French==", maxwords = 80)
title, txopen, txclose = "<title>", "<text", "</text>"
got_title_last, got_text_last = false, false
Line 327:
elseif occursin(languagemark, line)
if got_text_last && titleword != ""
printprintln(titlewordoutput, (wordcount += 1) % 8 == 0 ? "\n" : ", "titleword)
(wordcount += 1) >= maxwords && break
end
got_title_last, got_text_last = false, false
Line 341:
stat(urlfile).size == 0 && download(url, urlfile)
const stream = Bzip2DecompressorStream(open(urlfile))
getwords(stream, stdout) # or open a file to write to and use its IO handle instead of stdout
getwords(stream)
 
</lang>{{out}}
<pre>
gratis
gratis, gratuit, livre, chien, pond, pies, pie, A
gratuit
connotation, minute, trade, adjective, adjectival, substantive, patronage, merchandise
livre
eagle, fa, fable, a-, abaca, abada, abalone, abandon
chien
abattoir, abaxial, abbatial, abdication, abdicative, abdomen, abdominal, abdominales
pond
abduction, aberrance, aberrant, aberration, abhorrent, abhorrer, abime, abject
pies
abjection, abjuration, abjure, abjurer, ablactation, ablation, ablative, able
pie
abluent, ablution, abolition, abominable, abomination, abord, abortive, about
A
abracadabra, abrase, abrasion, abrasive, abraxas, abreuvoir, abrogation, abrogative
connotation
abrupt, on, abscission, abscond, absconder, quiz, nu, lente
minute
été, servant, robot, y, absent, absenter, absolution, absorbable
trade
adjective
adjectival
substantive
patronage
merchandise
eagle
fa
fable
a-
abaca
abada
abalone
abandon
abattoir
abaxial
abbatial
abdication
abdicative
abdomen
abdominal
abdominales
abduction
aberrance
aberrant
aberration
abhorrent
abhorrer
abime
abject
abjection
abjuration
abjure
abjurer
ablactation
ablation
ablative
able
abluent
ablution
abolition
abominable
abomination
abord
abortive
about
abracadabra
abrase
abrasion
abrasive
abraxas
abreuvoir
abrogation
abrogative
abrupt
on
abscission
abscond
absconder
quiz
nu
lente
été
servant
robot
y
absent
absenter
absolution
absorbable
</pre>
 
 
=={{header|OCaml}}==
4,106

edits