rwordnet icon indicating copy to clipboard operation
rwordnet copied to clipboard

Inconsistenct part-of-speech argument handling

Open kliuless opened this issue 8 years ago • 1 comments

Examples:

# these work fine
WordNet::Lemma.find('turtle', :noun)
WordNet::Lemma.find('turtle', 'noun')
WordNet::Lemma.find('turtle', :n)

# this does not
WordNet::Lemma.find('turtle', 'n')
# => Errno::ENOENT: No such file or directory @ rb_sysopen - .../gems/rwordnet-2.0.0/WordNet-3.0/dict/index.n
# this works fine
WordNet::Synset.find('turtle', 'noun')

# these do not (NoMethodError: undefined method `has_key?' for nil:NilClass)
WordNet::Synset.find('turtle', :noun)
WordNet::Synset.find('turtle', :n)
WordNet::Synset.find('turtle', 'n')

I suggest having centralized logic to perform this normalization, so both Lemma and Synset can take advantage of it.

kliuless avatar Jun 12 '17 16:06 kliuless

agreed!

jtoy avatar Feb 01 '23 13:02 jtoy