Ruby utilities for part of speech tagging and text categorization

Discussion in 'Ruby' started by Mark Watson, Apr 4, 2005.

  1. Mark  Watson

    Mark Watson Guest

    Released as Free Software on my open source page at www.markwatson.com.

    I have started using Ruby for some of my research. I wrote these
    utilities for my own use, but I hope that other people find them both
    useful and fun.

    Enjoy!
     
    Mark Watson, Apr 4, 2005
    #1
    1. Advertising

  2. Mark  Watson

    pat eyler Guest

    Mark,


    On Apr 4, 2005 9:44 AM, Mark Watson <> wrote:
    > Released as Free Software on my open source page at www.markwatson.com.
    >
    > I have started using Ruby for some of my research. I wrote these
    > utilities for my own use, but I hope that other people find them both
    > useful and fun.


    Thanks for writing these, I've been interested in using Ruby for some
    (armchair) text analysis myself.

    As I read through the tagger.rb script, I saw a lot of non-ruby idiom (not
    a complaint, just an observation). Before Doing anything else with it, I
    ran ZenTest (http://rubyforge.org/projects/zentest) against your script and
    started moving your tests over to Test::Unit. Here's a first shot for you:

    require 'test/unit' unless defined? $ZENTEST and $ZENTEST
    require 'tagger'

    class TestTagger < Test::Unit::TestCase
    def test_getTags
    tt = Tagger.new
    assert_equal(["NN"], tt.getTags("bank"))
    assert_equal(["DT", "NN", "VBZ", "DT", "JJ", "NN", "JJ", "NN"],
    tt.getTags("The dog bites the black cat last week."))
    assert_equal(["DT", "NN", "VBD", "NNP", "DT", "NN", "JJ", "NN",
    nil, "PRP", "MD", "NN", "DT", "NN", "RB", "RB"],
    tt.getTags("The bank gave Sam a loan last week. He
    can bank an airplane really well."))
    assert_equal([],tt.getTags(""))
    end
    end


    I'll be interested in seeing how these projects grow.

    >
    > Enjoy!
    >
    >



    --
    thanks,
    -pate
    -------------------------
    We are often unable to tell people what they need to know, because
    they want to know something else, and would therefore only
    misunderstand what we said
    - the Raven (George MacDonald, Lilith)
     
    pat eyler, Apr 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    429
  2. Scott Aikin

    Ruby Snippet Tagging

    Scott Aikin, Sep 19, 2005, in forum: Ruby
    Replies:
    0
    Views:
    111
    Scott Aikin
    Sep 19, 2005
  3. Replies:
    1
    Views:
    88
    Darshan Patil
    Nov 11, 2005
  4. Aníbal
    Replies:
    0
    Views:
    108
    Aníbal
    Dec 8, 2006
  5. Felipe Contreras
    Replies:
    0
    Views:
    102
    Felipe Contreras
    May 8, 2007
Loading...

Share This Page