Paul Nulty
2/20/2007 5:08:00 PM
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.