wordnet 1.0.0.pre.126 → 1.0.0.pre.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/wordnet/synset.rb +1 -1
- data/spec/wordnet/synset_spec.rb +42 -16
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
data/lib/wordnet/synset.rb
CHANGED
@@ -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]
|
197
|
+
:recurses => row[:recurses] && row[:recurses] != 0,
|
198
198
|
}
|
199
199
|
hash
|
200
200
|
end
|
data/spec/wordnet/synset_spec.rb
CHANGED
@@ -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
|
43
|
-
|
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 "
|
47
|
-
|
48
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
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
metadata.gz.sig
CHANGED
Binary file
|