Professional Web Applications Themes

[ANN] Linguistics 0.02 - Ruby

Hi fellow Rubyists, I'd like to announce the second release of the Linguistics module, a generic, language-neutral framework for extending Ruby objects with linguistic methods. This release fixes some of the bugs that were discovered since the last version, and adds a few new features: == Infinitives New in version 0.02: "leaving".en.infinitive # => "leave" "left".en.infinitive # => "leave" "leaving".en.infinitive.suffix # => "ing" == WordNetÆ Integration Also new in version 0.02, if you have the Ruby-WordNet module installed, you can look up WordNet synsets using the Linguistics interface: # Test to be sure the WordNet module loaded okay. Linguistics::EN.has_wordnet? # ...

  1. #1

    Default [ANN] Linguistics 0.02

    Hi fellow Rubyists,

    I'd like to announce the second release of the Linguistics module, a
    generic, language-neutral framework for extending Ruby objects with
    linguistic methods.

    This release fixes some of the bugs that were discovered since the last
    version, and adds a few new features:

    == Infinitives

    New in version 0.02:

    "leaving".en.infinitive
    # => "leave"

    "left".en.infinitive
    # => "leave"

    "leaving".en.infinitive.suffix
    # => "ing"


    == WordNetÆ Integration

    Also new in version 0.02, if you have the Ruby-WordNet module
    installed, you can
    look up WordNet synsets using the Linguistics interface:

    # Test to be sure the WordNet module loaded okay.
    Linguistics::EN.has_wordnet?
    # => true

    # Fetch the default synset for the word "balance"
    "balance".synset
    # => #<WordNet::Synset:0x40376844 balance (noun): "a state of
    equilibrium"
    (derivations: 3, antonyms: 1, hypernyms: 1, hyponyms: 3)>

    # Fetch the synset for the first verb sense of "balance"
    "balance".en.synset( :verb )
    # => #<WordNet::Synset:0x4033f448 balance, equilibrate, equilibrize,
    equilibrise
    (verb): "bring into balance or equilibrium; "She has to balance work
    and her
    domestic duties"; "balance the two weights"" (derivations: 7,
    antonyms: 1,
    verbGroups: 2, hypernyms: 1, hyponyms: 5)>

    # Fetch the second noun sense
    "balance".en.synset( 2, :noun )
    # => #<WordNet::Synset:0x404ebb24 balance (noun): "a scale for
    weighing; depends
    on pull of gravity" (hypernyms: 1, hyponyms: 5)>

    # Fetch the second noun sense's hypernyms (more-general words, like a
    superclass)
    "balance".en.synset( 2, :noun ).hypernyms
    # => [#<WordNet::Synset:0x404e5620 scale, weighing machine (noun): "a
    measuring
    instrument for weighing; shows amount of mass" (derivations: 2,
    hypernyms: 1,
    hyponyms: 2)>]

    # A simpler way of doing the same thing:
    "balance".en.hypernyms( 2, :noun )
    # => [#<WordNet::Synset:0x404e5620 scale, weighing machine (noun): "a
    measuring
    instrument for weighing; shows amount of mass" (derivations: 2,
    hypernyms: 1,
    hyponyms: 2)>]

    # Fetch the first hypernym's hypernyms
    "balance".en.synset( 2, :noun ).hypernyms.first.hypernyms
    # => [#<WordNet::Synset:0x404c60b8 measuring instrument, measuring
    system,
    measuring device (noun): "instrument that shows the extent or amount
    or quantity
    or degree of something" (hypernyms: 1, hyponyms: 83)>]

    # Find the synset to which both the second noun sense of "balance"
    and the
    # default sense of "shovel" belong.
    ("balance".en.synset( 2, :noun ) | "shovel".en.synset)
    # => #<WordNet::Synset:0x40473da4 instrumentality, instrumentation
    (noun): "an
    artifact (or system of artifacts) that is instrumental in
    accomplishing some
    end" (derivations: 1, hypernyms: 1, hyponyms: 13)>

    # Fetch just the words for the other kinds of "instruments"
    "instrument".en.hyponyms.collect {|synset| synset.words}.flatten
    # => ["yzer", "yser", "cautery", "cauterant", "drafting
    instrument",
    "extractor", "instrument of execution", "instrument of punishment",
    "measuring
    instrument", "measuring system", "measuring device", "medical
    instrument",
    "navigational instrument", "optical instrument", "plotter",
    "scientific
    instrument", "sonograph", "surveying instrument", "surveyor's
    instrument",
    "tracer", "weapon", "arm", "weapon system", "whip"]

    There are many more WordNet methods supported – too many to list here.
    See the
    doentation for the complete list.


    == LinkPr Integration

    Another new feature in version 0.02 is integration with the Ruby
    version of the
    CMU Link Grammar Pr by Martin Chase. If you have the LinkPr
    module
    installed, you can create linkages from English sentences that let you
    query for
    parts of speech:

    # Test to see whether or not the link pr is loaded.
    Linguistics::EN.has_link_pr?
    # => true

    # Diagram the first linkage for a test sentence
    puts "he is a big dog".sentence.linkages.first.to_s
    +---O*---+
    | +--Ds--+
    +Ss+ | +-A-+
    | | | | |
    he is a big dog

    # Find the verb in the sentence
    "he is a big dog".en.sentence.verb.to_s
    # => "is"

    # Combined infinitive + LinkPr: Find the infinitive form of the
    verb of the
    given sentence.
    "he is a big dog".en.sentence.verb.infinitive
    # => "be"

    # Find the direct object of the sentence
    "he is a big dog".en.sentence.object.to_s
    # => "dog"

    # Look at the raw LinkPr::Word for the direct object of the
    sentence.
    "he is a big dog".en.sentence.object
    # => #<LinkPr::Word:0x403da0a0 definition=[[{A-}, Ds-, {M+},
    J-], [{A-},
    Ds-, {M+}, Os-], [{A-}, Ds-, {M+}, Ss+, {CO-}, {C-}], [{A-},
    Ds-, {M+},
    Ss+, R-], [{A-}, Ds-, {M+}, SIs-], [{A-}, Ds-, {R+}, {Bs+}, J-],
    [{A-}, Ds-,
    {R+}, {Bs+}, Os-], [{A-}, Ds-, {R+}, {Bs+}, Ss+, {CO-}, {C-}],
    [{A-}, Ds-,
    {R+}, {Bs+}, Ss+, R-], [{A-}, Ds-, {R+}, {Bs+}, SIs-]], right=[],
    suffix="",
    left=[#<LinkPr::Connection:0x403da028
    rword=#<LinkPr::Word:0x403da0a0
    ...>, lword=#<LinkPr::Word:0x403da0b4 definition=[[Ss-, O+,
    {MV+}], [Ss-,
    B-, {MV+}], [Ss-, P+], [Ss-, AF-], [RS-, Bs-, O+, {MV+}], [RS-,
    Bs-, B-,
    {MV+}], [RS-, Bs-, P+], [RS-, Bs-, AF-], [{Q-}, SIs+, O+, {MV+}],
    [{Q-}, SIs+,
    B-, {MV+}], [{Q-}, SIs+, P+], [{Q-}, SIs+, AF-]],
    right=[#<LinkPr::Connection:0x403da028 ...>], suffix="",
    left=[],
    name="is", position=1>, subName="*", name="O", length=3>],
    name="dog",
    position=4>

    # Combine WordNet + LinkPr to find the definition of the direct
    object of
    # the sentence
    "he is a big dog".en.sentence.object.gloss
    # => "a member of the genus Canis (probably descended from the common
    wolf) that
    has been domesticated by man since prehistoric times; occurs in many
    breeds;
    \"the dog barked all night\""


    To find out more, visit the project's home page:

    <http://www.devEiate.org/code/linguistics.html>

    You can also download the module directly from:

    <http://www.devEiate.org/code/Linguistics-0.02.tar.gz>

    Thanks for your time.
    --
    Michael Granger <gedFaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>


    Michael Granger Guest

  2. #2

    Default Re: [ANN] Linguistics 0.02

    Michael Granger wrote:
    > Hi fellow Rubyists,
    >
    > I'd like to announce the second release of the Linguistics module, a
    > generic, language-neutral framework for extending Ruby objects with
    > linguistic methods.
    >
    > This release fixes some of the bugs that were discovered since the
    > last version, and adds a few new features:
    >
    > <snip>
    >
    > To find out more, visit the project's home page:
    >
    > <http://www.devEiate.org/code/linguistics.html>
    >
    > You can also download the module directly from:
    >
    > <http://www.devEiate.org/code/Linguistics-0.02.tar.gz>
    >
    > Thanks for your time.

    This is really incredible. My hat is off to you.

    Regards,
    Michael


    Michael Garriss Guest

  3. #3

    Default Re: [ANN] Linguistics 0.02

    On Mon, 2003-09-15 at 15:11, Michael Garriss wrote:
    > Michael Granger wrote:
    >
    > > Hi fellow Rubyists,
    > >
    > > I'd like to announce the second release of the Linguistics module, a
    > > generic, language-neutral framework for extending Ruby objects with
    > > linguistic methods.
    > >
    > > This release fixes some of the bugs that were discovered since the
    > > last version, and adds a few new features:
    > >
    > > <snip>
    > >
    > > To find out more, visit the project's home page:
    > >
    > > <http://www.devEiate.org/code/linguistics.html>
    > >
    > > You can also download the module directly from:
    > >
    > > <http://www.devEiate.org/code/Linguistics-0.02.tar.gz>
    > >
    > > Thanks for your time.
    >
    >
    > This is really incredible. My hat is off to you.
    >
    self congratulation?


    maillist@bestworldweb.homelinux.com Guest

  4. #4

    Default Re: [ANN] Linguistics 0.02

    [email]maillistbestworldweb.homelinux.com[/email] wrote:
    > self congratulation?
    Almost, but not quite. The author is Michael Granger, the person who was impressed was Michael Garriss ... unless, of course, MichaelGarriss = MichaelGranger.dup :-).

    --------------------------------------------
    Computers are like air conditioners ... they
    stop working properly if you open WINDOWS!



    Harry Ohlsen Guest

  5. #5

    Default Re: [ANN] Linguistics 0.02

    On Mon, 2003-09-15 at 19:10, Harry Ohlsen wrote:
    > [email]maillistbestworldweb.homelinux.com[/email] wrote:
    >
    > > self congratulation?
    >
    > Almost, but not quite. The author is Michael Granger, the person who was impressed was Michael Garriss ... unless, of course, MichaelGarriss = MichaelGranger.dup :-).
    lol, didnt see that.


    maillist@bestworldweb.homelinux.com Guest

  6. #6

    Default Re: [ANN] Linguistics 0.02

    Harry Ohlsen wrote:
    > [email]maillistbestworldweb.homelinux.com[/email] wrote:
    >
    >> self congratulation?
    >
    >
    > Almost, but not quite. The author is Michael Granger, the person who
    > was impressed was Michael Garriss ... unless, of course,
    > MichaelGarriss = MichaelGranger.dup :-).
    >
    Never yell Michael in a crowded room. ;)

    Michael


    Michael Garriss Guest

  7. #7

    Default Re: Linguistics 0.02

    Harry Ohlsen writes:
    > [...] unless, of course, MichaelGarriss = MichaelGranger.dup :-).
    I only wish I had that particular trick down. =:)

    --
    Michael Granger <gedFaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>

    Michael Granger Guest

  8. #8

    Default Re: [ANN] Linguistics 0.02

    Saluton!

    * Michael Garriss; 2003-09-15, 16:27 UTC:
    > Never yell Michael in a crowded room. ;)
    Would the effect be similar to yelling 'Mr. Kim!' in a crowded room
    in Korea?

    Gis,

    Josef 'Jupp' Schugt
    --
    Scientific RPN calculator (in Ruby) [url]http://rcalc.rubyforge.org/[/url]

    Josef 'Jupp' Schugt Guest

  9. #9

    Default Re: [ANN] Linguistics 0.02

    Michael Garriss wrote:
    > Never yell Michael in a crowded room. ;)
    Slightly OT, but that reminded me of my youth ... quite some time ago ... when we shared a 1 MIPS minicomputer between just under 100 students. More than once, when the system was very loaded and I needed my compile to get done *today* rather than tomorrow, I typed the command, walked into the middle of the terminal room, and yelled an expletive.

    Everyone would stop typing to see what was going on. Worked like a charm :-).

    --------------------------------------------
    Computers are like air conditioners ... they
    stop working properly if you open WINDOWS!



    Harry Ohlsen Guest

  10. #10

    Default Re: Linguistics 0.02

    I was quite impressed with the included doentation on:
    [url]http://www.deveiate.org/code/linguistics.html[/url]

    What tool was used to generate these docs?

    Michael Granger <gedFaerieMUD.org> wrote in message news:<courier.3F66001E.00006B09faeriemud.org>...
    > Harry Ohlsen writes:
    > > [...] unless, of course, MichaelGarriss = MichaelGranger.dup :-).
    >
    > I only wish I had that particular trick down. =:)
    >
    > --
    > Michael Granger <gedFaerieMUD.org>
    > Rubymage, Believer, Architect
    > The FaerieMUD Consortium <http://www.FaerieMUD.org/>
    Ed Baker Guest

  11. #11

    Default Re: Linguistics 0.02

    What url location should be used to obtain the required "readline.rb" module?

    Michael Granger <gedFaerieMUD.org> wrote in message news:<courier.3F66001E.00006B09faeriemud.org>...
    > Harry Ohlsen writes:
    > > [...] unless, of course, MichaelGarriss = MichaelGranger.dup :-).
    >
    > I only wish I had that particular trick down. =:)
    >
    > --
    > Michael Granger <gedFaerieMUD.org>
    > Rubymage, Believer, Architect
    > The FaerieMUD Consortium <http://www.FaerieMUD.org/>
    Ed Baker Guest

  12. #12

    Default Re: Linguistics 0.02

    On Sep 15, 2003, at 6:49 PM, Ed Baker wrote:
    > I was quite impressed with the included doentation on:
    > [url]http://www.deveiate.org/code/linguistics.html[/url]
    >
    > What tool was used to generate these docs?
    If you're referring to the "API Doentation" link on the page
    mentioned above, the tool is RDoc by Dave Thomas:
    [url]http://rdoc.sourceforge.net/[/url].

    Everything else is manually-written HTML.

    --
    Michael Granger <gedFaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>


    Michael Granger Guest

  13. #13

    Default Re: Linguistics 0.02

    On Sep 15, 2003, at 6:49 PM, Ed Baker wrote:
    > What url location should be used to obtain the required "readline.rb"
    > module?
    The module itself doesn't require readline, so I'm guessing you're
    asking about the install.rb script. It doesn't actually require
    readline to be installed; that's detritus that I neglected to delete
    after converting an installer from another project. You can delete the
    whole BEGIN block at the top of install.rb, which should fix the
    problem.

    Readline comes with Ruby, by the way. Your install must not have
    included it for some reason.

    --
    Michael Granger <gedFaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>


    Michael Granger Guest

  14. #14

    Default Re: ruby 1.8 mswin question

    Hello,

    In message "ruby 1.8 mswin question"
    on Sep.16,2003 13:58:45, <infoirvinehosting.net> wrote:
    | The problem I'm having is I installed soap4r. The samples work fine except
    | that whenever I start the scripts with ruby.exe I get a message box that
    | says the application failed to start because iconv.dll is missing. But then
    | the programs seem to work fine when I click the message box.
    |
    | What is this dll for? Can I disable this message or am I missing something I
    | must install? Could somebody direct me to where I can track down a win32
    | binary version of the program I need?

    iconv is codeset conversion library.
    You can get binary from here:
    [url]http://www.meadowy.org/meadow/dists/snapshot/iconv-1.8.win32.zip[/url]

    Regards,
    --
    U.Nakamura <usaosb.att.ne.jp>



    U.Nakamura Guest

  15. #15

    Default Re: Linguistics 0.02

    Hmmmm. I downloaded the module, but when I run rdoc on it, I don't
    seem to get the same results. Especially, the nice way the source
    blocks are displayed.

    Is there a guide to using rdoc somewhere?

    Michael Granger <gedFaerieMUD.org> wrote in message news:<E73107F8-E7F9-11D7-8DEE-000A959D1A74FaerieMUD.org>...
    > On Sep 15, 2003, at 6:49 PM, Ed Baker wrote:
    >
    > > I was quite impressed with the included doentation on:
    > > [url]http://www.deveiate.org/code/linguistics.html[/url]
    > >
    > > What tool was used to generate these docs?
    >
    > If you're referring to the "API Doentation" link on the page
    > mentioned above, the tool is RDoc by Dave Thomas:
    > [url]http://rdoc.sourceforge.net/[/url].
    >
    > Everything else is manually-written HTML.
    Ed Baker Guest

  16. #16

    Default Re: Linguistics 0.02

    On Sep 16, 2003, at 1:32 PM, Ed Baker wrote:
    > Hmmmm. I downloaded the module, but when I run rdoc on it, I don't
    > seem to get the same results. Especially, the nice way the source
    > blocks are displayed.
    >
    > Is there a guide to using rdoc somewhere?
    I don't know of a guide, but I use an alternate wrapper around the RDoc
    library that reads a CATALOG file and auto-generates the command line
    for me, as well as things like automatically uploading it to my
    webserver, etc. The script is in the CVS version of the module in the
    "docs" directory, but the command line equivalent is:

    rdoc --all --inline-source --fmt html --include docs --template css2 \
    --title "Ruby Linguistics Module" --tab-width 4 --main README \
    --webcvs [url]http://cvs.FaerieMUD.org/cgi/viewcvs.cgi/Linguistics/[/url] \
    lib/linguistics.rb lib/linguistics/en.rb \
    lib/linguistics/en/linkpr.rb lib/linguistics/en/infinitive.rb \
    lib/linguistics/en/wordnet.rb README README.english TODO ChangeLog


    Hope this helps.
    --
    Michael Granger <gedFaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>


    Michael Granger Guest

Similar Threads

  1. Linguistics 0.02
    By Mark Wilson in forum Ruby
    Replies: 0
    Last Post: September 16th, 10:55 PM
  2. [ANN] Linguistics-1.01
    By Michael Granger in forum Ruby
    Replies: 3
    Last Post: July 13th, 05:39 AM
  3. Replies: 0
    Last Post: July 13th, 03:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139