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
|
colored::Bool
|
||||||
end
|
end
|
||||||
|
|
||||||
function readInput()
|
function readInput(filter=(x->true))
|
||||||
words = Vector{String}()
|
words = Vector{String}()
|
||||||
for line in eachline("./dwdswb-headwords.json")
|
for line in eachline("wordlist-german.txt")
|
||||||
if line == "{" || line == "}" || line == ""
|
if filter(line)
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
line = strip(line)
|
push!(words, line)
|
||||||
line = split(line, "\"")
|
|
||||||
if occursin(r"^[a-zA-Z]+$", line[2])
|
|
||||||
push!(words, line[2])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return sort(words)
|
return sort(words)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user