Sha256: 938cf43ce056eb44db81c8e42a578cc966b9be6a9342307fdd5243604c348415

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 Bytes

Contents

#!/usr/bin/env rspec
require_relative '../helpers'

require 'rspec'
require 'wordnet'


#####################################################################
###	C O N T E X T S
#####################################################################

describe 'WordNet::SemanticLink', :requires_database do

	let( :described_class ) { WordNet::SemanticLink }

	let( :lexicon ) { WordNet::Lexicon.new($dburi) }
	let( :word )    { lexicon[96814]        } # 'parody'
	let( :synset )  { word.synsets.first    }
	let( :semlink ) { synset.semlinks.first }


	it "links two synsets together" do
		expect( semlink.origin ).to be_a( WordNet::Synset )
		expect( semlink.target ).to be_a( WordNet::Synset )
	end

	it "has a Symbolic type" do
		expect( semlink.type ).to eq( :hypernym )
	end

	it "has a human-readable type name" do
		expect( semlink.typename ).to eq( 'hypernym' )
	end


end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wordnet-1.2.0 spec/wordnet/semanticlink_spec.rb
wordnet-1.1.1 spec/wordnet/semanticlink_spec.rb
wordnet-1.1.0 spec/wordnet/semanticlink_spec.rb