Coder Social home page Coder Social logo

Using prepare about textanalysis.jl HOT 6 CLOSED

juliatext avatar juliatext commented on August 30, 2024
Using prepare

from textanalysis.jl.

Comments (6)

abieler avatar abieler commented on August 30, 2024

What Julia version are you using? I do not get any warnings on v0.5 when using something like

sd = StringDocument(txt)
prepare!(sd, strip_case)

where txt is a string in memory.

from textanalysis.jl.

pmargreff avatar pmargreff commented on August 30, 2024

Version 0.5.0 (2016-09-19 18:14 UTC) - x86_64-linux-gnu

from textanalysis.jl.

abieler avatar abieler commented on August 30, 2024

Does this work?

txt = "Test This"
sd = StringDocument(txt)
prepare!(sd, strip_case)

I do not get any warning for this.. Or can you provide code that gets warnings?

from textanalysis.jl.

maurolopes avatar maurolopes commented on August 30, 2024

I have this same problem. Curiously, it works with strip_case but fails for all other similar functions. See:

julia> sd = StringDocument("Hello, world!"); prepare!(sd, strip_case); sd.text
"hello, world!"
julia> sd = StringDocument("Hello, world!"); prepare!(sd, strip_pronouns); sd.text
ERROR: type String has no field data
Use `Vector{UInt8}(str)` instead.
Stacktrace:
 [1] remove_patterns(::String, ::Regex) at ~/.julia/v0.6/TextAnalysis/src/preprocessing.jl:308
 [2] remove_patterns! at ~/.julia/v0.6/TextAnalysis/src/preprocessing.jl:334 [inlined]
 [3] #prepare!#11(::Set{AbstractString}, ::Set{AbstractString}, ::Function, ::TextAnalysis.StringDocument, ::UInt32) at ~/.julia/v0.6/TextAnalysis/src/preprocessing.jl:290
 [4] prepare!(::TextAnalysis.StringDocument, ::UInt32) at ~/.julia/v0.6/TextAnalysis/src/preprocessing.jl:285
 [5] macro expansion at ./REPL.jl:97 [inlined]
 [6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73

The error message is identical for strip_numbers, strip_non_letters, etc.
What am I doing wrong?

My Julia version is 0.6.0 (2017-06-19 13:05 UTC), x86_64-pc-linux-gnu.

from textanalysis.jl.

maurolopes avatar maurolopes commented on August 30, 2024

Ah, after running Pkg.update() everything works fine now. Sorry for the noise.

from textanalysis.jl.

aviks avatar aviks commented on August 30, 2024

Yes, thanks, I tagged a new version last night. Sorry for the trouble, this had been fixed on master for a while, but hadn't tagged it.

from textanalysis.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.