Commits

Michael Granger committed d9968c6

Fix Linguistics::EN::WordNet.synsets.

Comments (0)

Files changed (3)

lib/linguistics/en/wordnet.rb

 # 
 module Linguistics::EN::WordNet
 
-	@has_wordnet	= false
-	@error		= nil
-	@lexicon		= nil
+	@has_wordnet  = false
+	@error		  = nil
+	@lexicon      = nil
 
 	# Load WordNet if possible, saving the error that occurs if anything goes wrong.
 	begin
 	### the WordNet lexicon and return an Array of WordNet::Synset objects. If
 	### +pos+ is +nil+, return synsets for all parts of speech.
 	def synsets( *args )
-		return Linguistics::EN.lexicon.lookup_synsets( self.to_s, *args )
+		return Linguistics::EN::WordNet.lexicon.lookup_synsets( self.to_s, *args )
 	end
 
 

spec/lib/helpers.rb

 	$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
 }
 
-require 'yaml'
 require 'linguistics'
 
 require 'rspec'

spec/linguistics/en/wordnet_spec.rb

 			"jackal".en.synset.should be_a( WordNet::Synset )
 		end
 
+		it "can load all synsets for a word" do
+			result = "appear".en.synsets
+			result.should have( 7 ).members
+			result.should include( WordNet::Synset[200422090] )
+		end
+
 	end