Skip to content

UndefVarError when prepare! called on Corpus #171

@tanmaykm

Description

@tanmaykm

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:

((flags & strip_whitespace) > 0) && remove_whitespace!(d)
introduced in #141

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions