update readInput function with new word list
This commit is contained in:
parent
5d095cff1f
commit
5d6762194b
12
main.jl
12
main.jl
@ -6,17 +6,13 @@ mutable struct node
|
||||
colored::Bool
|
||||
end
|
||||
|
||||
function readInput()
|
||||
function readInput(filter=(x->true))
|
||||
words = Vector{String}()
|
||||
for line in eachline("./dwdswb-headwords.json")
|
||||
if line == "{" || line == "}" || line == ""
|
||||
for line in eachline("wordlist-german.txt")
|
||||
if filter(line)
|
||||
continue
|
||||
end
|
||||
line = strip(line)
|
||||
line = split(line, "\"")
|
||||
if occursin(r"^[a-zA-Z]+$", line[2])
|
||||
push!(words, line[2])
|
||||
end
|
||||
push!(words, line)
|
||||
end
|
||||
return sort(words)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user