wordnet 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/History.md +33 -0
- data/README.md +140 -1
- data/lib/wordnet/constants.rb +0 -1
- data/lib/wordnet/lexicallink.rb +0 -1
- data/lib/wordnet/lexicon.rb +7 -6
- data/lib/wordnet/model.rb +0 -2
- data/lib/wordnet/morph.rb +12 -1
- data/lib/wordnet/semanticlink.rb +8 -1
- data/lib/wordnet/sense.rb +44 -1
- data/lib/wordnet/sumoterm.rb +0 -1
- data/lib/wordnet/synset.rb +1 -2
- data/lib/wordnet/word.rb +0 -1
- data/lib/wordnet.rb +1 -2
- data/spec/helpers.rb +17 -5
- data.tar.gz.sig +0 -0
- metadata +63 -138
- metadata.gz.sig +0 -0
- data/.gems +0 -6
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.simplecov +0 -8
- data/ChangeLog +0 -829
- data/Gemfile +0 -2
- data/History.rdoc +0 -21
- data/LICENSE +0 -27
- data/Manifest.txt +0 -37
- data/README.rdoc +0 -101
- data/Rakefile +0 -102
- data/TODO +0 -9
- data/certs/ged.pem +0 -26
- data/examples/gcs.rb +0 -44
- data/examples/hypernym_tree.rb +0 -34
- data/wordnet.gemspec +0 -63
data/Gemfile
DELETED
data/History.rdoc
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
== v1.1.0 [2017-09-26] Michael Granger <ged@FaerieMUD.org>
|
2
|
-
|
3
|
-
Enhancements:
|
4
|
-
|
5
|
-
- Update to WordNet 3.1 (from SQLUNet 5.2.0), Sequel 5.0.
|
6
|
-
- Made fetching Synset by ordinal deterministic
|
7
|
-
- Documentation updates/fixes
|
8
|
-
|
9
|
-
|
10
|
-
== v1.0.1 [2016-09-18] Michael Granger <ged@FaerieMUD.org>
|
11
|
-
|
12
|
-
- Finish up and fix WordNet::Sense
|
13
|
-
- Add Wordnet::Synset#wordlist
|
14
|
-
- Documentation fixes, fixes for newer Ruby versions
|
15
|
-
|
16
|
-
|
17
|
-
== v1.0.0 [2012-08-22] Michael Granger <ged@FaerieMUD.org>
|
18
|
-
|
19
|
-
Converted to use Sequel and wnsql.
|
20
|
-
|
21
|
-
|
data/LICENSE
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
Copyright (c) 2002-2010, Michael Granger
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
6
|
-
|
7
|
-
* Redistributions of source code must retain the above copyright notice,
|
8
|
-
this list of conditions and the following disclaimer.
|
9
|
-
|
10
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
this list of conditions and the following disclaimer in the documentation
|
12
|
-
and/or other materials provided with the distribution.
|
13
|
-
|
14
|
-
* Neither the name of the author/s, nor the names of the project's
|
15
|
-
contributors may be used to endorse or promote products derived from this
|
16
|
-
software without specific prior written permission.
|
17
|
-
|
18
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
19
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
20
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
22
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
24
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
25
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
26
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Manifest.txt
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
.gems
|
2
|
-
.ruby-gemset
|
3
|
-
.ruby-version
|
4
|
-
.simplecov
|
5
|
-
ChangeLog
|
6
|
-
Gemfile
|
7
|
-
History.rdoc
|
8
|
-
LICENSE
|
9
|
-
Manifest.txt
|
10
|
-
README.md
|
11
|
-
README.rdoc
|
12
|
-
Rakefile
|
13
|
-
TODO
|
14
|
-
WordNet30-license.txt
|
15
|
-
certs/ged.pem
|
16
|
-
examples/gcs.rb
|
17
|
-
examples/hypernym_tree.rb
|
18
|
-
lib/wordnet.rb
|
19
|
-
lib/wordnet/constants.rb
|
20
|
-
lib/wordnet/lexicallink.rb
|
21
|
-
lib/wordnet/lexicon.rb
|
22
|
-
lib/wordnet/model.rb
|
23
|
-
lib/wordnet/morph.rb
|
24
|
-
lib/wordnet/semanticlink.rb
|
25
|
-
lib/wordnet/sense.rb
|
26
|
-
lib/wordnet/sumoterm.rb
|
27
|
-
lib/wordnet/synset.rb
|
28
|
-
lib/wordnet/word.rb
|
29
|
-
spec/helpers.rb
|
30
|
-
spec/wordnet/lexicon_spec.rb
|
31
|
-
spec/wordnet/model_spec.rb
|
32
|
-
spec/wordnet/semanticlink_spec.rb
|
33
|
-
spec/wordnet/sense_spec.rb
|
34
|
-
spec/wordnet/synset_spec.rb
|
35
|
-
spec/wordnet/word_spec.rb
|
36
|
-
spec/wordnet_spec.rb
|
37
|
-
wordnet.gemspec
|
data/README.rdoc
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
= Ruby-WordNet
|
2
|
-
|
3
|
-
* https://bitbucket.org/ged/ruby-wordnet/
|
4
|
-
|
5
|
-
== Description
|
6
|
-
|
7
|
-
This library is a Ruby interface to WordNet®[http://wordnet.princeton.edu/].
|
8
|
-
WordNet® is an online lexical reference system whose design is inspired by
|
9
|
-
current psycholinguistic theories of human lexical memory. English nouns,
|
10
|
-
verbs, adjectives and adverbs are organized into synonym sets, each
|
11
|
-
representing one underlying lexical concept. Different relations link the
|
12
|
-
synonym sets.
|
13
|
-
|
14
|
-
This library uses SqlUNET[http://sqlunet.sourceforge.net/], which is a
|
15
|
-
conversion of the WordNet (along with a number of other linguistic databases)
|
16
|
-
lexicon flatfiles into a relational database format. You can either install the
|
17
|
-
{wordnet-defaultdb}[https://rubygems.org/gems/wordnet-defaultdb] gem, which
|
18
|
-
packages up the SQLite3 version of SqlUNet, or install your own and point the
|
19
|
-
lexicon at it by passing {Sequel connection
|
20
|
-
parameters}[http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html]
|
21
|
-
to the constructor.
|
22
|
-
|
23
|
-
=== Usage
|
24
|
-
|
25
|
-
There are three major parts to this library:
|
26
|
-
|
27
|
-
[WordNet::Lexicon] the interface to the dictionary, used to connect to the
|
28
|
-
database and look up Words and Synsets.
|
29
|
-
[WordNet::Word] the English word entries in the Lexicon that are mapped
|
30
|
-
to Synsets via one or more Senses.
|
31
|
-
[WordNet::Synset] the main artifact of WordNet: a "synonym set". These
|
32
|
-
are connected to one or more Words through a Sense,
|
33
|
-
and are connected to each other via SemanticLinks.
|
34
|
-
|
35
|
-
The other object classes exist mostly as a way of representing relationships
|
36
|
-
between the main three:
|
37
|
-
|
38
|
-
[WordNet::Sense] represents a link between one or more Words and
|
39
|
-
one or more Synsets for one meaning of the word.
|
40
|
-
[WordNet::SemanticLink] represents a link between Synsets
|
41
|
-
[WordNet::LexicalLink] represents a link between Words in Synsets
|
42
|
-
[WordNet::Morph] an interface to a lookup table of irregular word
|
43
|
-
forms mapped to their base form (lemma)
|
44
|
-
|
45
|
-
The last class (WordNet::Model) is the abstract superclass for all the others,
|
46
|
-
and inherits most of its functionality from Sequel::Model, the ORM layer
|
47
|
-
of the Sequel toolkit. It's mostly just a container for the database
|
48
|
-
connection, with some convenience methods to allow the database connection
|
49
|
-
to be deferred until runtime instead of when the library loads.
|
50
|
-
|
51
|
-
The library also comes with the beginnings of support for the SUMO-WordNet
|
52
|
-
mapping:
|
53
|
-
|
54
|
-
[WordNet::SumoTerm] {Suggested Upper Merged Ontology}[http://www.ontologyportal.org/]
|
55
|
-
terms, with associations back to related Synsets.
|
56
|
-
|
57
|
-
As mentioned above, SqlUNet has done an amazing job of linking up a number of
|
58
|
-
other useful linguistic lexicons via WordNet synsets. I plan on adding support
|
59
|
-
for at minimum VerbNet, FrameNet, and PropBank.
|
60
|
-
|
61
|
-
|
62
|
-
== Requirements
|
63
|
-
|
64
|
-
* Ruby >= 2.3
|
65
|
-
* Sequel >= 5.0
|
66
|
-
|
67
|
-
|
68
|
-
== Authors
|
69
|
-
|
70
|
-
* Michael Granger <ged@FaerieMUD.org>
|
71
|
-
|
72
|
-
|
73
|
-
== License
|
74
|
-
|
75
|
-
Copyright (c) 2002-2017, Michael Granger
|
76
|
-
All rights reserved.
|
77
|
-
|
78
|
-
Redistribution and use in source and binary forms, with or without
|
79
|
-
modification, are permitted provided that the following conditions are met:
|
80
|
-
|
81
|
-
* Redistributions of source code must retain the above copyright notice,
|
82
|
-
this list of conditions and the following disclaimer.
|
83
|
-
|
84
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
85
|
-
this list of conditions and the following disclaimer in the documentation
|
86
|
-
and/or other materials provided with the distribution.
|
87
|
-
|
88
|
-
* Neither the name of the author/s, nor the names of the project's
|
89
|
-
contributors may be used to endorse or promote products derived from this
|
90
|
-
software without specific prior written permission.
|
91
|
-
|
92
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
93
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
94
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
95
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
96
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
97
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
98
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
99
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
100
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
101
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
|
3
|
-
require 'pathname'
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'hoe'
|
7
|
-
rescue LoadError => err
|
8
|
-
$stderr.puts "Couldn't load hoe: %p: %s" % [ err.class, err.message ] if
|
9
|
-
Rake.application.options.trace
|
10
|
-
abort "This Rakefile requires hoe (gem install hoe)"
|
11
|
-
end
|
12
|
-
|
13
|
-
GEMSPEC = 'wordnet.gemspec'
|
14
|
-
|
15
|
-
Hoe.plugin :mercurial
|
16
|
-
Hoe.plugin :signing
|
17
|
-
|
18
|
-
Hoe.plugins.delete :rubyforge
|
19
|
-
|
20
|
-
BASEDIR = Pathname( __FILE__ ).dirname
|
21
|
-
LIBDIR = BASEDIR + 'lib'
|
22
|
-
DATADIR = BASEDIR + 'data'
|
23
|
-
|
24
|
-
hoespec = Hoe.spec( 'wordnet' ) do
|
25
|
-
self.readme_file = 'README.rdoc'
|
26
|
-
self.history_file = 'History.rdoc'
|
27
|
-
self.extra_rdoc_files = FileList[ '*.rdoc' ]
|
28
|
-
self.license 'BSD-3-Clause'
|
29
|
-
|
30
|
-
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
31
|
-
|
32
|
-
self.dependency 'sequel', '~> 5.0'
|
33
|
-
self.dependency 'loggability', '~> 0.11'
|
34
|
-
|
35
|
-
self.dependency 'sqlite3', '~> 1.3', :developer
|
36
|
-
self.dependency 'rspec', '~> 3.5', :developer
|
37
|
-
self.dependency 'simplecov', '~> 0.12', :developer
|
38
|
-
|
39
|
-
self.spec_extras[:post_install_message] = %{
|
40
|
-
If you don't already have a WordNet database installed somewhere,
|
41
|
-
you'll need to either download and install one from:
|
42
|
-
|
43
|
-
http://wnsql.sourceforge.net/
|
44
|
-
|
45
|
-
or just install the 'wordnet-defaultdb' gem, which will install
|
46
|
-
the SQLite version for you.
|
47
|
-
|
48
|
-
}.gsub( /^\t/, '' )
|
49
|
-
|
50
|
-
self.require_ruby_version( '>=2.2.0' )
|
51
|
-
|
52
|
-
self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags )
|
53
|
-
self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
|
54
|
-
|
55
|
-
self.rdoc_locations << "deveiate:/usr/local/www/public/code/ruby-#{remote_rdoc_dir}"
|
56
|
-
end
|
57
|
-
|
58
|
-
ENV['VERSION'] ||= hoespec.spec.version.to_s
|
59
|
-
|
60
|
-
# Run the tests before checking in
|
61
|
-
task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
|
62
|
-
|
63
|
-
# Rebuild the ChangeLog immediately before release
|
64
|
-
task :prerelease => 'ChangeLog'
|
65
|
-
CLOBBER.include( 'ChangeLog' )
|
66
|
-
|
67
|
-
desc "Build a coverage report"
|
68
|
-
task :coverage do
|
69
|
-
ENV["COVERAGE"] = 'yes'
|
70
|
-
Rake::Task[:spec].invoke
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
# Use the fivefish formatter for docs generated from development checkout
|
75
|
-
if File.directory?( '.hg' )
|
76
|
-
require 'rdoc/task'
|
77
|
-
|
78
|
-
Rake::Task[ 'docs' ].clear
|
79
|
-
RDoc::Task.new( 'docs' ) do |rdoc|
|
80
|
-
rdoc.main = "README.rdoc"
|
81
|
-
rdoc.rdoc_files.include( "*.rdoc", "*.md", "ChangeLog", "lib/**/*.rb" )
|
82
|
-
rdoc.generator = :fivefish
|
83
|
-
rdoc.title = 'Ruby WordNet'
|
84
|
-
rdoc.rdoc_dir = 'doc'
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
task :gemspec => [ 'ChangeLog', GEMSPEC ]
|
89
|
-
file GEMSPEC => __FILE__ do |task|
|
90
|
-
spec = $hoespec.spec
|
91
|
-
spec.files.delete( '.gemtest' )
|
92
|
-
spec.signing_key = nil
|
93
|
-
spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
|
94
|
-
spec.cert_chain = [ 'certs/ged.pem' ]
|
95
|
-
File.open( task.name, 'w' ) do |fh|
|
96
|
-
fh.write( spec.to_ruby )
|
97
|
-
end
|
98
|
-
end
|
99
|
-
CLOBBER.include( GEMSPEC )
|
100
|
-
|
101
|
-
task :default => :gemspec
|
102
|
-
|
data/TODO
DELETED
data/certs/ged.pem
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
|
3
|
-
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
4
|
-
HhcNMTcwOTI3MDAzMDQ0WhcNMTgwOTI3MDAzMDQ0WjA+MQwwCgYDVQQDDANnZWQx
|
5
|
-
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
6
|
-
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/JWGRHO+USzR97vXjkFgt
|
7
|
-
83qeNf2KHkcvrRTSnR64i6um/ziin0I0oX23H7VYrDJC9A/uoUa5nGRJS5Zw/+wW
|
8
|
-
ENcvWVZS4iUzi4dsYJGY6yEOsXh2CcF46+QevV8iE+UmbkU75V7Dy1JCaUOyizEt
|
9
|
-
TH5UHsOtUU7k9TYARt/TgYZKuaoAMZZd5qyVqhF1vV+7/Qzmp89NGflXf2xYP26a
|
10
|
-
4MAX2qqKX/FKXqmFO+AGsbwYTEds1mksBF3fGsFgsQWxftG8GfZQ9+Cyu2+l1eOw
|
11
|
-
cZ+lPcg834G9DrqW2zhqUoLr1MTly4pqxYGb7XoDhoR7dd1kFE2a067+DzWC/ADt
|
12
|
-
+QkcqWUm5oh1fN0eqr7NsZlVJDulFgdiiYPQiIN7UNsii4Wc9aZqBoGcYfBeQNPZ
|
13
|
-
soo/6za/bWajOKUmDhpqvaiRv9EDpVLzuj53uDoukMMwxCMfgb04+ckQ0t2G7wqc
|
14
|
-
/D+K9JW9DDs3Yjgv9k4h7YMhW5gftosd+NkNC/+Y2CkCAwEAAaN1MHMwCQYDVR0T
|
15
|
-
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFHKN/nkRusdqCJEuq3lgB3fJvyTg
|
16
|
-
MBwGA1UdEQQVMBOBEWdlZEBGYWVyaWVNVUQub3JnMBwGA1UdEgQVMBOBEWdlZEBG
|
17
|
-
YWVyaWVNVUQub3JnMA0GCSqGSIb3DQEBBQUAA4IBgQB/qyi5pCjK8ceoKalfVAjS
|
18
|
-
vG64FEnLnD1bm39T5UaFIRmo+abZtfpg2QhwKvPbPjOicau2+m+MDQ2Cc3tgyaC3
|
19
|
-
dZxcP6w8APFg4AId09uWAZKf0xajvBMS2aOz8Bbmag6fwqRRkTMqsNYnmqcF7aRT
|
20
|
-
DuEzbEMfaOUYjU9RuB48vr4q8yRft0ww+3jq5iwNkrX1buL2pwBbyvgms6D/BV41
|
21
|
-
MaTVMjsHqJUwU2xVfhGtxGAWAer5S1HGYHkbio6mGVtiie0uWjmnzi7ppIlMr48a
|
22
|
-
7BNTsoZ+/JRk3iQWmmNsyFT7xfqBKye7cH11BX8V8P4MeGB5YWlMI+Myj5DZY3fQ
|
23
|
-
st2AGD4rb1l0ia7PfubcBThSIdz61eCb8gRi/RiZZwb3/7+eyEncLJzt2Ob9fGSF
|
24
|
-
X0qdrKi+2aZZ0NGuFj9AItBsVmAvkBGIpX4TEKQp5haEbPpmaqO5nIIhV26PXmyT
|
25
|
-
OMKv6pWsoS81vw5KAGBmfX8nht/Py90DQrbRvakATGI=
|
26
|
-
-----END CERTIFICATE-----
|
data/examples/gcs.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#encoding: utf-8
|
3
|
-
|
4
|
-
#
|
5
|
-
# Find least general hypernymial synsets between all noun senses of two words.
|
6
|
-
#
|
7
|
-
|
8
|
-
$LOAD_PATH.unshift "lib"
|
9
|
-
|
10
|
-
require 'wordnet'
|
11
|
-
require 'loggability'
|
12
|
-
|
13
|
-
raise RuntimeError, "You must specify two words." if ARGV.length != 2
|
14
|
-
|
15
|
-
lex = WordNet::Lexicon.new
|
16
|
-
|
17
|
-
word1_syns = lex.lookup_synsets( ARGV[0], :noun )
|
18
|
-
word2_syns = lex.lookup_synsets( ARGV[1], :noun )
|
19
|
-
|
20
|
-
logger = Loggability[ WordNet ]
|
21
|
-
|
22
|
-
# Use the analyzer to traverse hypernyms of the synset, adding a string for each
|
23
|
-
# one with indentation for the level
|
24
|
-
word1_syns.each do |syn|
|
25
|
-
logger.debug ">>> Searching with #{syn.wordlist.join(', ')} as the origin."
|
26
|
-
|
27
|
-
word2_syns.each do |syn2|
|
28
|
-
logger.debug " Comparing #{syn2.wordlist.join(', ')} to the origin."
|
29
|
-
|
30
|
-
# The intersection of the two synsets is the most-specific hypernym they
|
31
|
-
# share in common.
|
32
|
-
common_syn = (syn | syn2)
|
33
|
-
|
34
|
-
# Skip common synsets that are too abstract
|
35
|
-
if common_syn && common_syn.lexical_domain != 'noun.tops'
|
36
|
-
puts syn, syn2, ' ' + common_syn.to_s, ''
|
37
|
-
else
|
38
|
-
logger.debug " No synsets in common."
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
logger.debug " done with #{syn.wordlist}"
|
43
|
-
end
|
44
|
-
|
data/examples/hypernym_tree.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#encoding: utf-8
|
3
|
-
|
4
|
-
#
|
5
|
-
# Find all the hypernyms of all senses of a given noun and display them in a
|
6
|
-
# heirarchy
|
7
|
-
#
|
8
|
-
|
9
|
-
$LOAD_PATH.unshift "lib"
|
10
|
-
require 'wordnet'
|
11
|
-
|
12
|
-
raise RuntimeError, "No word specified." if ARGV.empty?
|
13
|
-
|
14
|
-
# Create the lexicon
|
15
|
-
lex = WordNet::Lexicon.new
|
16
|
-
|
17
|
-
# Look up the synsets for the specified word
|
18
|
-
origins = lex.lookup_synsets( *ARGV )
|
19
|
-
|
20
|
-
|
21
|
-
# Iterate over the synsets for the different senses of the word
|
22
|
-
origins.each.with_index do |syn, i|
|
23
|
-
hypernyms = []
|
24
|
-
|
25
|
-
# Traverse the hypernyms
|
26
|
-
syn.traverse( :hypernyms ).with_depth.each do |hyper_syn, depth|
|
27
|
-
indent = ' ' * depth
|
28
|
-
hypernyms << "%s%s" % [ indent, hyper_syn ]
|
29
|
-
end
|
30
|
-
|
31
|
-
puts "\nHypernym tree for #{syn} (sense #{i + 1}):", *hypernyms
|
32
|
-
puts "Tree has #{hypernyms.length} synsets."
|
33
|
-
end
|
34
|
-
|
data/wordnet.gemspec
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: wordnet 1.1.0.pre20170926144654 ruby lib
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "wordnet".freeze
|
6
|
-
s.version = "1.1.0.pre20170926144654"
|
7
|
-
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1".freeze) if s.respond_to? :required_rubygems_version=
|
9
|
-
s.require_paths = ["lib".freeze]
|
10
|
-
s.authors = ["Michael Granger".freeze]
|
11
|
-
s.cert_chain = ["certs/ged.pem".freeze]
|
12
|
-
s.date = "2017-09-26"
|
13
|
-
s.description = "This library is a Ruby interface to WordNet\u00AE[http://wordnet.princeton.edu/].\nWordNet\u00AE is an online lexical reference system whose design is inspired\nby current psycholinguistic theories of human lexical memory. English\nnouns, verbs, adjectives and adverbs are organized into synonym sets, each\nrepresenting one underlying lexical concept. Different relations link\nthe synonym sets.\n\nThis library uses WordNet-SQL[http://wnsql.sourceforge.net/], which is a\nconversion of the lexicon flatfiles into a relational database format. You\ncan either install the 'wordnet-defaultdb' gem, which packages up the\nSQLite3 version of WordNet-SQL, or install your own and point the lexicon\nat it by passing \n{Sequel connection parameters}[http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html]\nto the constructor.".freeze
|
14
|
-
s.email = ["ged@FaerieMUD.org".freeze]
|
15
|
-
s.extra_rdoc_files = ["History.rdoc".freeze, "Manifest.txt".freeze, "README.md".freeze, "README.rdoc".freeze, "WordNet30-license.txt".freeze, "History.rdoc".freeze, "README.rdoc".freeze]
|
16
|
-
s.files = [".gems".freeze, ".ruby-gemset".freeze, ".ruby-version".freeze, ".simplecov".freeze, "ChangeLog".freeze, "Gemfile".freeze, "History.rdoc".freeze, "LICENSE".freeze, "Manifest.txt".freeze, "README.md".freeze, "README.rdoc".freeze, "Rakefile".freeze, "TODO".freeze, "WordNet30-license.txt".freeze, "certs/ged.pem".freeze, "examples/gcs.rb".freeze, "examples/hypernym_tree.rb".freeze, "lib/wordnet.rb".freeze, "lib/wordnet/constants.rb".freeze, "lib/wordnet/lexicallink.rb".freeze, "lib/wordnet/lexicon.rb".freeze, "lib/wordnet/model.rb".freeze, "lib/wordnet/morph.rb".freeze, "lib/wordnet/semanticlink.rb".freeze, "lib/wordnet/sense.rb".freeze, "lib/wordnet/sumoterm.rb".freeze, "lib/wordnet/synset.rb".freeze, "lib/wordnet/word.rb".freeze, "spec/helpers.rb".freeze, "spec/wordnet/lexicon_spec.rb".freeze, "spec/wordnet/model_spec.rb".freeze, "spec/wordnet/semanticlink_spec.rb".freeze, "spec/wordnet/sense_spec.rb".freeze, "spec/wordnet/synset_spec.rb".freeze, "spec/wordnet/word_spec.rb".freeze, "spec/wordnet_spec.rb".freeze, "wordnet.gemspec".freeze]
|
17
|
-
s.homepage = "http://deveiate.org/projects/Ruby-WordNet".freeze
|
18
|
-
s.licenses = ["BSD-3-Clause".freeze]
|
19
|
-
s.post_install_message = "\nIf you don't already have a WordNet database installed somewhere,\nyou'll need to either download and install one from:\n\n http://wnsql.sourceforge.net/\n\nor just install the 'wordnet-defaultdb' gem, which will install\nthe SQLite version for you.\n\n".freeze
|
20
|
-
s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
|
21
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.2.0".freeze)
|
22
|
-
s.rubygems_version = "2.6.13".freeze
|
23
|
-
s.summary = "This library is a Ruby interface to WordNet\u00AE[http://wordnet.princeton.edu/]".freeze
|
24
|
-
|
25
|
-
if s.respond_to? :specification_version then
|
26
|
-
s.specification_version = 4
|
27
|
-
|
28
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
29
|
-
s.add_runtime_dependency(%q<sequel>.freeze, ["~> 5.0"])
|
30
|
-
s.add_runtime_dependency(%q<loggability>.freeze, ["~> 0.11"])
|
31
|
-
s.add_development_dependency(%q<hoe-mercurial>.freeze, ["~> 1.4"])
|
32
|
-
s.add_development_dependency(%q<hoe-deveiate>.freeze, ["~> 0.9"])
|
33
|
-
s.add_development_dependency(%q<hoe-highline>.freeze, ["~> 0.2"])
|
34
|
-
s.add_development_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
35
|
-
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5"])
|
36
|
-
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.12"])
|
37
|
-
s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
38
|
-
s.add_development_dependency(%q<hoe>.freeze, ["~> 3.16"])
|
39
|
-
else
|
40
|
-
s.add_dependency(%q<sequel>.freeze, ["~> 5.0"])
|
41
|
-
s.add_dependency(%q<loggability>.freeze, ["~> 0.11"])
|
42
|
-
s.add_dependency(%q<hoe-mercurial>.freeze, ["~> 1.4"])
|
43
|
-
s.add_dependency(%q<hoe-deveiate>.freeze, ["~> 0.9"])
|
44
|
-
s.add_dependency(%q<hoe-highline>.freeze, ["~> 0.2"])
|
45
|
-
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
46
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.5"])
|
47
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.12"])
|
48
|
-
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
49
|
-
s.add_dependency(%q<hoe>.freeze, ["~> 3.16"])
|
50
|
-
end
|
51
|
-
else
|
52
|
-
s.add_dependency(%q<sequel>.freeze, ["~> 5.0"])
|
53
|
-
s.add_dependency(%q<loggability>.freeze, ["~> 0.11"])
|
54
|
-
s.add_dependency(%q<hoe-mercurial>.freeze, ["~> 1.4"])
|
55
|
-
s.add_dependency(%q<hoe-deveiate>.freeze, ["~> 0.9"])
|
56
|
-
s.add_dependency(%q<hoe-highline>.freeze, ["~> 0.2"])
|
57
|
-
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
58
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.5"])
|
59
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.12"])
|
60
|
-
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
61
|
-
s.add_dependency(%q<hoe>.freeze, ["~> 3.16"])
|
62
|
-
end
|
63
|
-
end
|