Merge pull request #105 from trosborn/master

fixes errors caused by wordnet 1.0.0
This commit is contained in:
Louis Mullie 2015-04-06 16:34:48 -04:00
commit f61adc8187
1 changed files with 22 additions and 24 deletions

View File

@ -12,8 +12,8 @@ class Treat::Workers::Lexicalizers::Sensers::Wordnet
# Patch for bug.
::WordNet.module_eval do
remove_const(:SynsetType)
const_set(:SynsetType,
remove_const(:SYNSET_TYPES)
const_set(:SYNSET_TYPES,
{"n" => "noun", "v" => "verb", "a" => "adj"})
end
@ -51,9 +51,7 @@ class Treat::Workers::Lexicalizers::Sensers::Wordnet
cat = category.to_s.capitalize
@@indexes[cat] ||=
::WordNet.const_get(cat + 'Index').instance
lemma = @@indexes[cat].find(word.value.downcase)
lemma = ::WordNet::Lemma.find(word.value.downcase, cat.to_sym)
return [] if lemma.nil?
synsets = []