ruby-wordnet: traverse

P

Paul Nulty

Hello,

is anybody familiar with the Ruby-Wordnet module? If so, do you have
any idea about this error?


/usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:104:in
`initialize': undefined method `index' for nil:NilClass
(NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:73:in
`parse'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:769:in
`pointers'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:768:in
`pointers'
from /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:767:in
`pointers'
from /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:766:in
`pointers'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:810:in
`fetchSynsetPointers'
... 7 levels...
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:693:in
`traverse'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:705:in
`traverse'
from /home/paul/ruby/wntest.rb:56
from /home/paul/ruby/wntest.rb:45


caused by this code:

k = lex.lookupSynsets("hospital", WordNet::Noun )
puts k[0].traverse:)hypernyms)

problem is that it randomly works for lots of words but not for
others. it doesn't work for "hospital" or "vessel" but does for almost
all other words in my set.
 
M

Michael Granger

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,038
Members
48,768
Latest member
first4landlord

Latest Threads

Top