JuliaText / TextAnalysis.jl

Julia package for text analysis
Other
373 stars 95 forks source link

UndefVarError when `prepare!` called on Corpus #171

Closed tanmaykm closed 4 years ago

tanmaykm commented 4 years ago

An UndefVarError is thrown when prepare! is called on a corpus with strip_whitespace option.

julia> prepare!(crps, strip_html_tags | strip_whitespace | strip_non_letters)
ERROR: UndefVarError: d not defined
Stacktrace:
 [1] #prepare!#12(::Set{AbstractString}, ::Set{AbstractString}, ::Function, ::Corpus{Union{FileDocument, NGramDocument, StringDocument, TokenDocument}}, ::UInt32) at /home/tan/.julia/dev/TextAnalysis/src/preprocessing.jl:469
 [2] prepare!(::Corpus{Union{FileDocument, NGramDocument, StringDocument, TokenDocument}}, ::UInt32) at /home/tan/.julia/dev/TextAnalysis/src/preprocessing.jl:458
 [3] top-level scope at none:0

Looks like a typo (copy-paste related?) here: https://github.com/JuliaText/TextAnalysis.jl/blob/06e85ef52be4b64330211a578f39a259b86b7a33/src/preprocessing.jl#L417 introduced in https://github.com/JuliaText/TextAnalysis.jl/pull/141

aviks commented 4 years ago

cc: @asbisen