Ticket #3 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

WordNet::Synset::Pointer doesn't handle new compound pointer types

Reported by: deveiant Owned by: deveiant
Priority: major Milestone: Updates
Component: Version: 0.02
Keywords: synset instance pointer types Cc:

Description

Some new compound pointer types (e.g., ~i and @i) have been added in recent releases of the WordNet? data files, and trying to extract pointers from the synset for any word which contains it causes a NoMethodError? to be raised.

Minimal testcase:

require 'wordnet'

lex = WordNet::Lexicon.new
syn = lex.lookup_synsets_by_offset( "04456674%n" )

syn.pointerlist
syn.pointers

And the results of running it:

$ ruby experiments/unhandled_pointer_types.rb 
syn.pointerlist
---------------------------------------------------------------------------
"@i 03730777%n 0000|#p 08029251%n 0000"
---------------------------------------------------------------------------

syn.pointers
---------------------------------------------------------------------------
undefined method `index' for nil:NilClass
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:104:in `initialize'
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:73:in `parse'
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:804:in `pointers'
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:803:in `pointers'
        /usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:802:in `pointers'
        /usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
        /Users/ged/source/ruby/WordNet/lib/wordnet/synset.rb:801:in `pointers'
        experiments/unhandled_pointer_types.rb:23
---------------------------------------------------------------------------

Change History

Changed 3 years ago by ged

(In [64]) * Adding minimal testcase for missing synset pointer types bug. (refs #3)

Changed 3 years ago by ged

  • status changed from new to closed
  • resolution set to fixed

(In [66]) - Test and fix for new compound pointer types (fixes #3) - Added mode-specification and path specification to Lexicon constructor. This

is to support modifying WordNet? databases as well as being able to open them read-only. This addresses the "writable data files" bug (fixes #2).

- Moved default location for data files to CONFIGdatadir? - Added quite a bit more documentation which is visible if you use the included

docs/makedocs.rb script or manually specify an 'accessors' option to rdoc.

Note: See TracTickets for help on using tickets.