update readInput function with new word list

This commit is contained in:
Jonas Seiler 2023-06-16 10:16:50 +02:00
parent 5d095cff1f
commit 5d6762194b

12
main.jl
View File

@ -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