rwordnet
rwordnet copied to clipboard
Inconsistenct part-of-speech argument handling
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.
agreed!