wordnet 1.0.0.pre.141 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/lib/wordnet/lexicon.rb +1 -1
- data/lib/wordnet/synset.rb +93 -0
- data/spec/wordnet/lexicon_spec.rb +2 -2
- metadata +2 -2
- metadata.gz.sig +3 -1
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/wordnet/lexicon.rb
CHANGED
@@ -16,7 +16,7 @@ require 'wordnet/word'
|
|
16
16
|
#
|
17
17
|
# == Creating a Lexicon
|
18
18
|
#
|
19
|
-
# To create a Lexicon,
|
19
|
+
# To create a Lexicon, point it at a database using [Sequel database connection
|
20
20
|
# criteria]{http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html}:
|
21
21
|
#
|
22
22
|
# lex = WordNet::Lexicon.new( 'postgres://localhost/wordnet30' )
|
data/lib/wordnet/synset.rb
CHANGED
@@ -59,6 +59,99 @@ require 'wordnet/model'
|
|
59
59
|
# # #<WordNet::Synset:0x7ffbf25d8068 {115266164} 'starting point,
|
60
60
|
# # terminus a quo' (noun): [noun.time] earliest limiting point>]
|
61
61
|
#
|
62
|
+
# == Traversal
|
63
|
+
#
|
64
|
+
# Synset also provides a few 'traversal' methods which provide recursive searching
|
65
|
+
# of a Synset's semantic links:
|
66
|
+
#
|
67
|
+
# # Recursively search for more-general terms for the synset, and print out
|
68
|
+
# # each one with indentation according to how distantly it's related.
|
69
|
+
# lexicon[ :fencing, 'sword' ].
|
70
|
+
# traverse(:hypernyms).with_depth.
|
71
|
+
# each {|ss, depth| puts "%s%s [%d]" % [' ' * (depth-1), ss.words.first, ss.synsetid] }
|
72
|
+
# # (outputs:)
|
73
|
+
# play [100041468]
|
74
|
+
# action [100037396]
|
75
|
+
# act [100030358]
|
76
|
+
# event [100029378]
|
77
|
+
# psychological feature [100023100]
|
78
|
+
# abstract entity [100002137]
|
79
|
+
# entity [100001740]
|
80
|
+
# combat [101170962]
|
81
|
+
# battle [100958896]
|
82
|
+
# group action [101080366]
|
83
|
+
# event [100029378]
|
84
|
+
# psychological feature [100023100]
|
85
|
+
# abstract entity [100002137]
|
86
|
+
# entity [100001740]
|
87
|
+
# act [100030358]
|
88
|
+
# event [100029378]
|
89
|
+
# psychological feature [100023100]
|
90
|
+
# abstract entity [100002137]
|
91
|
+
# entity [100001740]
|
92
|
+
#
|
93
|
+
# See the <b>Traversal Methods</b> section for more details.
|
94
|
+
#
|
95
|
+
# == Low-Level API
|
96
|
+
#
|
97
|
+
# This library is implemented using Sequel::Model, an ORM layer on top of the
|
98
|
+
# excellent Sequel database toolkit. This means that in addition to the
|
99
|
+
# high-level methods above, you can also make use of a database-oriented
|
100
|
+
# API if you need to do something not provided by a high-level method.
|
101
|
+
#
|
102
|
+
# In order to make use of this API, you'll need to be familiar with
|
103
|
+
# {Sequel}[http://sequel.rubyforge.org/], especially
|
104
|
+
# {Datasets}[http://sequel.rubyforge.org/rdoc/files/doc/dataset_basics_rdoc.html] and
|
105
|
+
# {Model Associations}[http://sequel.rubyforge.org/rdoc/files/doc/association_basics_rdoc.html].
|
106
|
+
# Most of Ruby-WordNet's functionality is implemented in terms of one or both
|
107
|
+
# of these.
|
108
|
+
#
|
109
|
+
# === Datasets
|
110
|
+
#
|
111
|
+
# The main dataset is available from WordNet::Synset.dataset:
|
112
|
+
#
|
113
|
+
# WordNet::Synset.dataset
|
114
|
+
# # => #<Sequel::SQLite::Dataset: "SELECT * FROM `synsets`">
|
115
|
+
#
|
116
|
+
# In addition to this, Synset also defines a few other canned datasets. To facilitate
|
117
|
+
# searching by part of speech on the Synset class:
|
118
|
+
#
|
119
|
+
# * WordNet::Synset.nouns
|
120
|
+
# * WordNet::Synset.verbs
|
121
|
+
# * WordNet::Synset.adjectives
|
122
|
+
# * WordNet::Synset.adverbs
|
123
|
+
# * WordNet::Synset.adjective_satellites
|
124
|
+
#
|
125
|
+
# or by the semantic links for a particular Synset:
|
126
|
+
#
|
127
|
+
# * WordNet::Synset#also_see_dataset
|
128
|
+
# * WordNet::Synset#attributes_dataset
|
129
|
+
# * WordNet::Synset#causes_dataset
|
130
|
+
# * WordNet::Synset#domain_categories_dataset
|
131
|
+
# * WordNet::Synset#domain_member_categories_dataset
|
132
|
+
# * WordNet::Synset#domain_member_regions_dataset
|
133
|
+
# * WordNet::Synset#domain_member_usages_dataset
|
134
|
+
# * WordNet::Synset#domain_regions_dataset
|
135
|
+
# * WordNet::Synset#domain_usages_dataset
|
136
|
+
# * WordNet::Synset#entailments_dataset
|
137
|
+
# * WordNet::Synset#hypernyms_dataset
|
138
|
+
# * WordNet::Synset#hyponyms_dataset
|
139
|
+
# * WordNet::Synset#instance_hypernyms_dataset
|
140
|
+
# * WordNet::Synset#instance_hyponyms_dataset
|
141
|
+
# * WordNet::Synset#member_holonyms_dataset
|
142
|
+
# * WordNet::Synset#member_meronyms_dataset
|
143
|
+
# * WordNet::Synset#part_holonyms_dataset
|
144
|
+
# * WordNet::Synset#part_meronyms_dataset
|
145
|
+
# * WordNet::Synset#semlinks_dataset
|
146
|
+
# * WordNet::Synset#semlinks_to_dataset
|
147
|
+
# * WordNet::Synset#senses_dataset
|
148
|
+
# * WordNet::Synset#similar_words_dataset
|
149
|
+
# * WordNet::Synset#substance_holonyms_dataset
|
150
|
+
# * WordNet::Synset#substance_meronyms_dataset
|
151
|
+
# * WordNet::Synset#sumo_terms_dataset
|
152
|
+
# * WordNet::Synset#verb_groups_dataset
|
153
|
+
# * WordNet::Synset#words_dataset
|
154
|
+
#
|
62
155
|
class WordNet::Synset < WordNet::Model( :synsets )
|
63
156
|
include WordNet::Constants
|
64
157
|
|
@@ -24,7 +24,7 @@ require 'wordnet'
|
|
24
24
|
describe WordNet::Lexicon do
|
25
25
|
|
26
26
|
before( :all ) do
|
27
|
-
setup_logging(
|
27
|
+
setup_logging()
|
28
28
|
@devdb = Pathname( 'wordnet-defaultdb/data/wordnet-defaultdb/wordnet30.sqlite' ).
|
29
29
|
expand_path
|
30
30
|
end
|
@@ -125,7 +125,7 @@ describe WordNet::Lexicon do
|
|
125
125
|
|
126
126
|
context "with a PostgreSQL database", :requires_pg do
|
127
127
|
|
128
|
-
let( :lexicon ) { WordNet::Lexicon.new(
|
128
|
+
let( :lexicon ) { WordNet::Lexicon.new('postgres:/wordnet30') }
|
129
129
|
|
130
130
|
context "via its index operator" do
|
131
131
|
|
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
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
|
37
37
|
Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
|
38
38
|
cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
39
|
-
date: 2012-
|
39
|
+
date: 2012-10-01 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sequel
|
metadata.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
8�C�W^ӻV���0E5�ঐP�/7D
|
2
|
+
�H&�%P X`ڄ���+�E�0tEiEb5���(�~�Ͷ���wnS֛�d(��(jG�h��A���#]Q�'.l�-�"N!��b�.�i{��,�%'X@�a�.^T���~Y:�����e;b�0
|
3
|
+
�ϱ�^�vo��x|��}�yY���M
|