wordnet 1.0.0.pre.126 → 1.0.0.pre.127

Sign up to get free protection for your applications and to get access to all the features.
@@ -194,7 +194,7 @@ class WordNet::Synset < WordNet::Model( :synsets )
194
194
  :id => row[:linkid],
195
195
  :typename => row[:link],
196
196
  :type => row[:link].gsub( /\s+/, '_' ).to_sym,
197
- :recurses => row[:recurses].nonzero? ? true : false,
197
+ :recurses => row[:recurses] && row[:recurses] != 0,
198
198
  }
199
199
  hash
200
200
  end
@@ -27,31 +27,57 @@ describe WordNet::Synset, :requires_database => true do
27
27
  @lexicon = WordNet::Lexicon.new
28
28
  end
29
29
 
30
- before( :each ) do
31
- # floor, level, storey, story (noun): [noun.artifact] a structure
32
- # consisting of a room or set of rooms at a single position along a
33
- # vertical scale (hypernym: 1, hyponym: 5, part meronym: 1)
34
- @synset = WordNet::Synset[ 103365991 ]
35
- end
36
-
37
30
  after( :all ) do
38
31
  reset_logging()
39
32
  end
40
33
 
41
34
 
42
- it "knows what lexical domain it's from" do
43
- @synset.lexical_domain.should == 'noun.artifact'
35
+ it "knows what kinds of lexical domains are available" do
36
+ described_class.lexdomains.should be_a( Hash )
37
+ described_class.lexdomains.should include( 'noun.cognition' )
38
+ described_class.lexdomains['noun.cognition'].should be_a( Hash )
39
+ described_class.lexdomains['noun.cognition'][:pos].should == 'n'
40
+ end
41
+
42
+ it "knows what kinds of semantic links are available" do
43
+ described_class.linktypes.should be_a( Hash )
44
+ hypernym = described_class.linktypes[:hypernym]
45
+ hypernym.should be_a( Hash )
46
+ hypernym[:typename].should == 'hypernym'
47
+ hypernym[:recurses].should be_true()
44
48
  end
45
49
 
46
- it "can make a Sequel dataset for any of its semantic link relationships" do
47
- ds = @synset.semanticlink_dataset( :member_meronyms )
48
- ds.should be_a( Sequel::Dataset )
49
- ds.first_source_table.should == :synsets
50
+ it "knows what parts of speech are supported" do
51
+ described_class.postypes.should be_a( Hash )
52
+ described_class.postypes['noun'].should == :n
50
53
  end
51
54
 
52
- it "can make an Enumerator for any of its semantic link relationships" do
53
- enum = @synset.semanticlink_enum( :member_meronyms )
54
- enum.should be_a( Enumerator )
55
+
56
+ context "for 'floor, level, storey, story (noun)' [103365991]" do
57
+
58
+ before( :each ) do
59
+ # floor, level, storey, story (noun): [noun.artifact] a structure
60
+ # consisting of a room or set of rooms at a single position along a
61
+ # vertical scale (hypernym: 1, hyponym: 5, part meronym: 1)
62
+ @synset = WordNet::Synset[ 103365991 ]
63
+ end
64
+
65
+
66
+ it "knows what lexical domain it's from" do
67
+ @synset.lexical_domain.should == 'noun.artifact'
68
+ end
69
+
70
+ it "can make a Sequel dataset for any of its semantic link relationships" do
71
+ ds = @synset.semanticlink_dataset( :member_meronyms )
72
+ ds.should be_a( Sequel::Dataset )
73
+ ds.first_source_table.should == :synsets
74
+ end
75
+
76
+ it "can make an Enumerator for any of its semantic link relationships" do
77
+ enum = @synset.semanticlink_enum( :member_meronyms )
78
+ enum.should be_a( Enumerator )
79
+ end
80
+
55
81
  end
56
82
 
57
83
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.126
4
+ version: 1.0.0.pre.127
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
metadata.gz.sig CHANGED
Binary file