wordnet 0.0.5 → 1.0.0.pre.126
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/.gemtest +0 -0
- data/History.rdoc +5 -0
- data/LICENSE +9 -9
- data/Manifest.txt +39 -0
- data/README.rdoc +60 -0
- data/Rakefile +47 -267
- data/TODO +9 -0
- data/WordNet30-license.txt +31 -0
- data/examples/add-laced-boots.rb +35 -0
- data/examples/clothes-with-collars.rb +42 -0
- data/examples/clothesWithTongues.rb +0 -0
- data/examples/domainTree.rb +0 -0
- data/examples/memberTree.rb +0 -0
- data/lib/wordnet/constants.rb +259 -296
- data/lib/wordnet/lexicallink.rb +34 -0
- data/lib/wordnet/lexicon.rb +158 -386
- data/lib/wordnet/mixins.rb +62 -0
- data/lib/wordnet/model.rb +78 -0
- data/lib/wordnet/morph.rb +25 -0
- data/lib/wordnet/semanticlink.rb +52 -0
- data/lib/wordnet/sense.rb +55 -0
- data/lib/wordnet/sumoterm.rb +21 -0
- data/lib/wordnet/synset.rb +404 -859
- data/lib/wordnet/utils.rb +126 -0
- data/lib/wordnet/word.rb +119 -0
- data/lib/wordnet.rb +113 -76
- data/spec/lib/helpers.rb +102 -133
- data/spec/linguawordnet.tests.rb +38 -0
- data/spec/wordnet/lexicon_spec.rb +96 -186
- data/spec/wordnet/model_spec.rb +59 -0
- data/spec/wordnet/semanticlink_spec.rb +42 -0
- data/spec/wordnet/synset_spec.rb +27 -256
- data/spec/wordnet/word_spec.rb +58 -0
- data/spec/wordnet_spec.rb +52 -0
- data.tar.gz.sig +0 -0
- metadata +227 -188
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -720
- data/README +0 -93
- data/Rakefile.local +0 -46
- data/convertdb.rb +0 -417
- data/examples/addLacedBoots.rb +0 -27
- data/examples/clothesWithCollars.rb +0 -36
- data/rake/dependencies.rb +0 -76
- data/rake/helpers.rb +0 -384
- data/rake/manual.rb +0 -755
- data/rake/packaging.rb +0 -112
- data/rake/publishing.rb +0 -303
- data/rake/rdoc.rb +0 -35
- data/rake/style.rb +0 -62
- data/rake/svn.rb +0 -469
- data/rake/testing.rb +0 -192
- data/rake/verifytask.rb +0 -64
- data/utils.rb +0 -838
data/.gemtest
ADDED
File without changes
|
data/History.rdoc
ADDED
data/LICENSE
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2002-2010, Michael Granger
|
2
2
|
All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without
|
5
5
|
modification, are permitted provided that the following conditions are met:
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
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
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
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
17
|
|
18
18
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
19
19
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
data/Manifest.txt
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
History.rdoc
|
2
|
+
LICENSE
|
3
|
+
Manifest.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
TODO
|
7
|
+
WordNet30-license.txt
|
8
|
+
examples/add-laced-boots.rb
|
9
|
+
examples/clothes-with-collars.rb
|
10
|
+
examples/clothesWithTongues.rb
|
11
|
+
examples/distance.rb
|
12
|
+
examples/domainTree.rb
|
13
|
+
examples/gcs.rb
|
14
|
+
examples/holonymTree.rb
|
15
|
+
examples/hypernymTree.rb
|
16
|
+
examples/hyponymTree.rb
|
17
|
+
examples/memberTree.rb
|
18
|
+
examples/meronymTree.rb
|
19
|
+
lib/wordnet.rb
|
20
|
+
lib/wordnet/constants.rb
|
21
|
+
lib/wordnet/lexicallink.rb
|
22
|
+
lib/wordnet/lexicon.rb
|
23
|
+
lib/wordnet/mixins.rb
|
24
|
+
lib/wordnet/model.rb
|
25
|
+
lib/wordnet/morph.rb
|
26
|
+
lib/wordnet/semanticlink.rb
|
27
|
+
lib/wordnet/sense.rb
|
28
|
+
lib/wordnet/sumoterm.rb
|
29
|
+
lib/wordnet/synset.rb
|
30
|
+
lib/wordnet/utils.rb
|
31
|
+
lib/wordnet/word.rb
|
32
|
+
spec/lib/helpers.rb
|
33
|
+
spec/linguawordnet.tests.rb
|
34
|
+
spec/wordnet/lexicon_spec.rb
|
35
|
+
spec/wordnet/model_spec.rb
|
36
|
+
spec/wordnet/semanticlink_spec.rb
|
37
|
+
spec/wordnet/synset_spec.rb
|
38
|
+
spec/wordnet/word_spec.rb
|
39
|
+
spec/wordnet_spec.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
= Ruby-WordNet
|
2
|
+
|
3
|
+
* http://deveiate.org/projects/Ruby-WordNet
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
7
|
+
This library is a Ruby interface to WordNet®. WordNet® is an online lexical
|
8
|
+
reference system whose design is inspired by current psycholinguistic theories
|
9
|
+
of human lexical memory. English nouns, verbs, adjectives and adverbs are
|
10
|
+
organized into synonym sets, each representing one underlying lexical
|
11
|
+
concept. Different relations link the synonym sets.
|
12
|
+
|
13
|
+
It uses WordNet-SQL, which is a conversion of the lexicon flatfiles into a
|
14
|
+
relational database format. You can either install the 'wordnet-defaultdb' gem,
|
15
|
+
which packges up the SQLite3 version of WordNet-SQL, or install your own and
|
16
|
+
point the lexicon at it by passing a Sequel URL to the constructor.
|
17
|
+
|
18
|
+
TO-DO: More details and better writing later.
|
19
|
+
|
20
|
+
|
21
|
+
== Requirements
|
22
|
+
|
23
|
+
* Ruby >= 1.9.2
|
24
|
+
* Sequel >= 3.29.0
|
25
|
+
|
26
|
+
|
27
|
+
== Authors
|
28
|
+
|
29
|
+
* Michael Granger <ged@FaerieMUD.org>
|
30
|
+
|
31
|
+
|
32
|
+
== License
|
33
|
+
|
34
|
+
Copyright (c) 2010-2011, The FaerieMUD Consortium
|
35
|
+
All rights reserved.
|
36
|
+
|
37
|
+
Redistribution and use in source and binary forms, with or without
|
38
|
+
modification, are permitted provided that the following conditions are met:
|
39
|
+
|
40
|
+
* Redistributions of source code must retain the above copyright notice,
|
41
|
+
this list of conditions and the following disclaimer.
|
42
|
+
|
43
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
44
|
+
this list of conditions and the following disclaimer in the documentation
|
45
|
+
and/or other materials provided with the distribution.
|
46
|
+
|
47
|
+
* Neither the name of the author/s, nor the names of the project's
|
48
|
+
contributors may be used to endorse or promote products derived from this
|
49
|
+
software without specific prior written permission.
|
50
|
+
|
51
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
52
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
53
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
54
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
55
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
56
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
57
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
58
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
59
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
60
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
CHANGED
@@ -1,291 +1,71 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# WordNet rakefile
|
4
|
-
#
|
5
|
-
# Based on various other Rakefiles, especially one by Ben Bleything
|
6
|
-
#
|
7
|
-
# Copyright (c) 2008 The FaerieMUD Consortium
|
8
|
-
#
|
9
|
-
# Authors:
|
10
|
-
# * Michael Granger <ged@FaerieMUD.org>
|
11
|
-
#
|
1
|
+
#!/usr/bin/env rake
|
12
2
|
|
13
|
-
|
14
|
-
require 'pathname'
|
15
|
-
basedir = Pathname.new( __FILE__ ).dirname
|
3
|
+
require 'pathname'
|
16
4
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
$
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
require 'rbconfig'
|
26
|
-
require 'rubygems'
|
27
|
-
require 'rake'
|
28
|
-
require 'rake/rdoctask'
|
29
|
-
require 'rake/testtask'
|
30
|
-
require 'rake/packagetask'
|
31
|
-
require 'rake/clean'
|
32
|
-
|
33
|
-
$dryrun = false
|
34
|
-
|
35
|
-
### Config constants
|
36
|
-
BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
|
37
|
-
BINDIR = BASEDIR + 'bin'
|
38
|
-
LIBDIR = BASEDIR + 'lib'
|
39
|
-
EXTDIR = BASEDIR + 'ext'
|
40
|
-
DOCSDIR = BASEDIR + 'docs'
|
41
|
-
PKGDIR = BASEDIR + 'pkg'
|
42
|
-
|
43
|
-
PROJECT_NAME = 'WordNet'
|
44
|
-
PKG_NAME = PROJECT_NAME.downcase
|
45
|
-
PKG_SUMMARY = 'a Ruby interface to the WordNet Lexical Database'
|
46
|
-
VERSION_FILE = LIBDIR + 'wordnet.rb'
|
47
|
-
PKG_VERSION = VERSION_FILE.read[ /VERSION = '(\d+\.\d+\.\d+)'/, 1 ]
|
48
|
-
PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
|
49
|
-
GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
|
50
|
-
|
51
|
-
ARTIFACTS_DIR = Pathname.new( ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' )
|
52
|
-
|
53
|
-
TEXT_FILES = %w( Rakefile ChangeLog README LICENSE ).collect {|filename| BASEDIR + filename }
|
54
|
-
BIN_FILES = Pathname.glob( BINDIR + '*' ).delete_if {|item| item =~ /\.svn/ }
|
55
|
-
LIB_FILES = Pathname.glob( LIBDIR + '**/*.rb' ).delete_if {|item| item =~ /\.svn/ }
|
56
|
-
EXT_FILES = Pathname.glob( EXTDIR + '**/*.{c,h,rb}' ).delete_if {|item| item =~ /\.svn/ }
|
57
|
-
|
58
|
-
SPECDIR = BASEDIR + 'spec'
|
59
|
-
SPECLIBDIR = SPECDIR + 'lib'
|
60
|
-
SPEC_FILES = Pathname.glob( SPECDIR + '**/*_spec.rb' ).delete_if {|item| item =~ /\.svn/ } +
|
61
|
-
Pathname.glob( SPECLIBDIR + '**/*.rb' ).delete_if {|item| item =~ /\.svn/ }
|
62
|
-
|
63
|
-
TESTDIR = BASEDIR + 'tests'
|
64
|
-
TEST_FILES = Pathname.glob( TESTDIR + '**/*.tests.rb' ).delete_if {|item| item =~ /\.svn/ }
|
65
|
-
|
66
|
-
RAKE_TASKDIR = BASEDIR + 'rake'
|
67
|
-
RAKE_TASKLIBS = Pathname.glob( RAKE_TASKDIR + '*.rb' )
|
68
|
-
|
69
|
-
LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
|
70
|
-
|
71
|
-
EXTRA_PKGFILES = []
|
72
|
-
EXTRA_PKGFILES.concat Pathname.glob( BASEDIR + 'convertdb.rb' ).delete_if {|item| item =~ /\.svn/ }
|
73
|
-
EXTRA_PKGFILES.concat Pathname.glob( BASEDIR + 'utils.rb' ).delete_if {|item| item =~ /\.svn/ }
|
74
|
-
EXTRA_PKGFILES.concat Pathname.glob( BASEDIR + 'examples/*.rb' ).delete_if {|item| item =~ /\.svn/ }
|
75
|
-
|
76
|
-
RELEASE_FILES = TEXT_FILES +
|
77
|
-
SPEC_FILES +
|
78
|
-
TEST_FILES +
|
79
|
-
BIN_FILES +
|
80
|
-
LIB_FILES +
|
81
|
-
EXT_FILES +
|
82
|
-
RAKE_TASKLIBS +
|
83
|
-
EXTRA_PKGFILES
|
84
|
-
|
85
|
-
RELEASE_FILES << LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
|
86
|
-
|
87
|
-
COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
|
88
|
-
RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
|
89
|
-
RCOV_OPTS = [
|
90
|
-
'--exclude', RCOV_EXCLUDES,
|
91
|
-
'--xrefs',
|
92
|
-
'--save',
|
93
|
-
'--callsites',
|
94
|
-
#'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
|
95
|
-
]
|
96
|
-
|
97
|
-
|
98
|
-
# Subversion constants -- directory names for releases and tags
|
99
|
-
SVN_TRUNK_DIR = 'trunk'
|
100
|
-
SVN_RELEASES_DIR = 'releases'
|
101
|
-
SVN_BRANCHES_DIR = 'branches'
|
102
|
-
SVN_TAGS_DIR = 'tags'
|
103
|
-
|
104
|
-
SVN_DOTDIR = BASEDIR + '.svn'
|
105
|
-
SVN_ENTRIES = SVN_DOTDIR + 'entries'
|
106
|
-
|
107
|
-
|
108
|
-
### Load some task libraries that need to be loaded early
|
109
|
-
require RAKE_TASKDIR + 'helpers.rb'
|
110
|
-
require RAKE_TASKDIR + 'svn.rb'
|
111
|
-
require RAKE_TASKDIR + 'verifytask.rb'
|
112
|
-
|
113
|
-
# Define some constants that depend on the 'svn' tasklib
|
114
|
-
PKG_BUILD = get_svn_rev( BASEDIR ) || 0
|
115
|
-
SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
|
116
|
-
SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
|
117
|
-
|
118
|
-
# Documentation constants
|
119
|
-
RDOCDIR = DOCSDIR + 'api'
|
120
|
-
RDOC_OPTIONS = [
|
121
|
-
'-w', '4',
|
122
|
-
'-SHN',
|
123
|
-
'-i', '.',
|
124
|
-
'-m', 'README',
|
125
|
-
'-W', 'http://deveiate.org/projects/Ruby-WordNet/browser/trunk/'
|
126
|
-
]
|
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
|
127
12
|
|
128
|
-
|
129
|
-
|
130
|
-
SMTP_PORT = 465 # SMTP + SSL
|
13
|
+
Hoe.plugin :mercurial
|
14
|
+
Hoe.plugin :signing
|
131
15
|
|
132
|
-
|
133
|
-
PROJECT_HOST = 'deveiate.org'
|
134
|
-
PROJECT_PUBDIR = "/usr/local/www/public/code"
|
135
|
-
PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
|
136
|
-
PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
|
137
|
-
PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
|
16
|
+
Hoe.plugins.delete :rubyforge
|
138
17
|
|
139
|
-
|
140
|
-
|
141
|
-
|
18
|
+
BASEDIR = Pathname( __FILE__ ).dirname
|
19
|
+
LIBDIR = BASEDIR + 'lib'
|
20
|
+
DATADIR = BASEDIR + 'data'
|
142
21
|
|
143
|
-
|
144
|
-
|
145
|
-
|
22
|
+
hoespec = Hoe.spec( 'wordnet' ) do
|
23
|
+
self.name = 'wordnet'
|
24
|
+
self.readme_file = 'README.rdoc'
|
25
|
+
self.history_file = 'History.rdoc'
|
26
|
+
self.extra_rdoc_files = FileList[ '*.rdoc' ]
|
146
27
|
|
147
|
-
|
148
|
-
DEVELOPMENT_DEPENDENCIES = {
|
149
|
-
'amatch' => '>= 0.2.3',
|
150
|
-
'rake' => '>= 0.8.1',
|
151
|
-
'rcodetools' => '>= 0.7.0.0',
|
152
|
-
'rcov' => '>= 0',
|
153
|
-
'RedCloth' => '>= 4.0.3',
|
154
|
-
'rspec' => '>= 0',
|
155
|
-
'rubyforge' => '>= 0',
|
156
|
-
'termios' => '>= 0',
|
157
|
-
'text-format' => '>= 1.0.0',
|
158
|
-
'tmail' => '>= 1.2.3.1',
|
159
|
-
'ultraviolet' => '>= 0.10.2',
|
160
|
-
'libxml-ruby' => '>= 0.8.3',
|
161
|
-
}
|
28
|
+
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
162
29
|
|
163
|
-
|
164
|
-
|
165
|
-
'
|
166
|
-
}
|
30
|
+
self.dependency 'sequel', '~> 3.29'
|
31
|
+
self.dependency 'sqlite3', '~> 1.3', :developer
|
32
|
+
self.dependency 'rspec', '~> 2.7', :developer
|
167
33
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
34
|
+
self.spec_extras[:licenses] = ["BSD"]
|
35
|
+
self.spec_extras[:post_install_message] = %{
|
36
|
+
If you don't already have a WordNet database installed somewhere,
|
37
|
+
you'll need to either download and install one from:
|
172
38
|
|
173
|
-
|
174
|
-
gem.description = <<-EOD
|
175
|
-
A Ruby implementation of the WordNet lexical dictionary an online lexical reference system whose
|
176
|
-
design is inspired by current psycholinguistic theories of human lexical memory.
|
177
|
-
EOD
|
39
|
+
http://wnsql.sourceforge.net/
|
178
40
|
|
179
|
-
|
180
|
-
|
181
|
-
gem.homepage = 'http://deveiate.org/projects/Ruby-WordNet'
|
182
|
-
gem.rubyforge_project = RUBYFORGE_PROJECT
|
41
|
+
or just install the 'wordnet-defaultdb' gem, which will install
|
42
|
+
the SQLite version for you.
|
183
43
|
|
184
|
-
|
185
|
-
gem.rdoc_options = RDOC_OPTIONS
|
44
|
+
}.gsub( /^\t/, '' )
|
186
45
|
|
187
|
-
|
188
|
-
|
46
|
+
self.require_ruby_version( '>=1.9.2' )
|
189
47
|
|
190
|
-
|
191
|
-
collect {|f| f.relative_path_from(BASEDIR).to_s }
|
192
|
-
gem.test_files = SPEC_FILES.
|
193
|
-
collect {|f| f.relative_path_from(BASEDIR).to_s }
|
194
|
-
|
195
|
-
DEPENDENCIES.each do |name, version|
|
196
|
-
version = '>= 0' if version.length.zero?
|
197
|
-
gem.add_runtime_dependency( name, version )
|
198
|
-
end
|
199
|
-
|
200
|
-
DEVELOPMENT_DEPENDENCIES.each do |name, version|
|
201
|
-
version = '>= 0' if version.length.zero?
|
202
|
-
gem.add_development_dependency( name, version )
|
203
|
-
end
|
204
|
-
|
205
|
-
REQUIREMENTS.each do |name, version|
|
206
|
-
gem.requirements << [ name, version ].compact.join(' ')
|
207
|
-
end
|
48
|
+
self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags )
|
208
49
|
end
|
209
50
|
|
210
|
-
|
211
|
-
MANUALDIR = DOCSDIR + 'manual'
|
212
|
-
|
213
|
-
$trace = Rake.application.options.trace ? true : false
|
214
|
-
$dryrun = Rake.application.options.dryrun ? true : false
|
51
|
+
ENV['VERSION'] ||= hoespec.spec.version.to_s
|
215
52
|
|
53
|
+
task 'hg:precheckin' => [ :check_history, :spec ]
|
216
54
|
|
217
|
-
|
218
|
-
|
219
|
-
|
55
|
+
### Make the ChangeLog update if the repo has changed since it was last built
|
56
|
+
file '.hg/branch'
|
57
|
+
file 'ChangeLog' => '.hg/branch' do |task|
|
58
|
+
$stderr.puts "Updating the changelog..."
|
220
59
|
begin
|
221
|
-
|
222
|
-
rescue
|
223
|
-
|
224
|
-
[ tasklib, err.class.name, err.message ]
|
225
|
-
trace "Backtrace: \n " + err.backtrace.join( "\n " )
|
226
|
-
rescue => err
|
227
|
-
log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
|
228
|
-
[ tasklib, err.class.name, err.message ]
|
229
|
-
trace "Backtrace: \n " + err.backtrace.join( "\n " )
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# Load any project-specific rules defined in 'Rakefile.local' if it exists
|
234
|
-
import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
|
235
|
-
|
236
|
-
|
237
|
-
#####################################################################
|
238
|
-
### T A S K S
|
239
|
-
#####################################################################
|
240
|
-
|
241
|
-
### Default task
|
242
|
-
task :default => [:clean, :local, :spec, :rdoc, :package]
|
243
|
-
|
244
|
-
### Task the local Rakefile can append to -- no-op by default
|
245
|
-
task :local
|
246
|
-
|
247
|
-
|
248
|
-
### Task: clean
|
249
|
-
CLEAN.include 'coverage'
|
250
|
-
CLOBBER.include 'artifacts', 'coverage.info', PKGDIR
|
251
|
-
|
252
|
-
# Target to hinge on ChangeLog updates
|
253
|
-
file SVN_ENTRIES
|
254
|
-
|
255
|
-
### Task: changelog
|
256
|
-
file 'ChangeLog' => SVN_ENTRIES.to_s do |task|
|
257
|
-
log "Updating #{task.name}"
|
258
|
-
|
259
|
-
changelog = make_svn_changelog()
|
260
|
-
File.open( task.name, 'w' ) do |fh|
|
261
|
-
fh.print( changelog )
|
60
|
+
content = make_changelog()
|
61
|
+
rescue NoMethodError
|
62
|
+
abort "This task requires hoe-mercurial (gem install hoe-mercurial)"
|
262
63
|
end
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
### Task: cruise (Cruisecontrol task)
|
267
|
-
desc "Cruisecontrol build"
|
268
|
-
task :cruise => [:clean, :spec, :package] do |task|
|
269
|
-
raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
|
270
|
-
artifact_dir = ARTIFACTS_DIR.cleanpath
|
271
|
-
artifact_dir.mkpath
|
272
|
-
|
273
|
-
coverage = BASEDIR + 'coverage'
|
274
|
-
if coverage.exist? && coverage.directory?
|
275
|
-
$stderr.puts "Copying coverage stats..."
|
276
|
-
FileUtils.cp_r( 'coverage', artifact_dir )
|
64
|
+
File.open( task.name, 'w', 0644 ) do |fh|
|
65
|
+
fh.print( content )
|
277
66
|
end
|
278
|
-
|
279
|
-
$stderr.puts "Copying packages..."
|
280
|
-
FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
|
281
67
|
end
|
282
68
|
|
283
|
-
|
284
|
-
|
285
|
-
task :update_build do
|
286
|
-
log "Updating the build system"
|
287
|
-
sh 'svn', 'up', RAKE_TASKDIR
|
288
|
-
log "Updating the Rakefile"
|
289
|
-
sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
|
290
|
-
end
|
69
|
+
# Rebuild the ChangeLog immediately before release
|
70
|
+
task :prerelease => 'ChangeLog'
|
291
71
|
|
data/TODO
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
WordNet Release 3.0
|
2
|
+
|
3
|
+
This software and database is being provided to you, the LICENSEE, by
|
4
|
+
Princeton University under the following license. By obtaining, using
|
5
|
+
and/or copying this software and database, you agree that you have
|
6
|
+
read, understood, and will comply with these terms and conditions.:
|
7
|
+
|
8
|
+
Permission to use, copy, modify and distribute this software and
|
9
|
+
database and its documentation for any purpose and without fee or
|
10
|
+
royalty is hereby granted, provided that you agree to comply with
|
11
|
+
the following copyright notice and statements, including the disclaimer,
|
12
|
+
and that the same appear on ALL copies of the software, database and
|
13
|
+
documentation, including modifications that you make for internal
|
14
|
+
use or for distribution.
|
15
|
+
|
16
|
+
WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved.
|
17
|
+
|
18
|
+
THIS SOFTWARE AND DATABASE IS PROVIDED "AS IS" AND PRINCETON
|
19
|
+
UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
20
|
+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PRINCETON
|
21
|
+
UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANT-
|
22
|
+
ABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE
|
23
|
+
OF THE LICENSED SOFTWARE, DATABASE OR DOCUMENTATION WILL NOT
|
24
|
+
INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR
|
25
|
+
OTHER RIGHTS.
|
26
|
+
|
27
|
+
The name of Princeton University or Princeton may not be used in
|
28
|
+
advertising or publicity pertaining to distribution of the software
|
29
|
+
and/or database. Title to copyright in this software, database and
|
30
|
+
any associated documentation shall at all times remain with
|
31
|
+
Princeton University and LICENSEE agrees to preserve same.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
BEGIN {
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
basedir = Pathname.new( __FILE__ ).dirname.parent
|
7
|
+
libdir = basedir + 'lib'
|
8
|
+
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
9
|
+
}
|
10
|
+
|
11
|
+
require 'wordnet'
|
12
|
+
|
13
|
+
#
|
14
|
+
# Add a synset for laced boots
|
15
|
+
#
|
16
|
+
|
17
|
+
lex = WordNet::Lexicon.new
|
18
|
+
|
19
|
+
boot = lex[ :boot ]
|
20
|
+
laced_boot = WordNet::Synset.create( "laced boot", "n" )
|
21
|
+
tongue = lex.lookup_synsets( "tongue", "n", 6 )
|
22
|
+
|
23
|
+
laced_boot.add_hypernyms( boot )
|
24
|
+
laced_boot.add_component_meronyms( tongue )
|
25
|
+
|
26
|
+
lex.unlock {
|
27
|
+
laced_boot.write
|
28
|
+
boot.write
|
29
|
+
tongue.write
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
BEGIN {
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
basedir = Pathname.new( __FILE__ ).dirname.parent
|
7
|
+
libdir = basedir + 'lib'
|
8
|
+
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
9
|
+
}
|
10
|
+
|
11
|
+
require 'wordnet'
|
12
|
+
|
13
|
+
#
|
14
|
+
# Find all articles of clothing that have collars (Adapted from the synopsis
|
15
|
+
# of Lingua::Wordnet::Analysis)
|
16
|
+
#
|
17
|
+
|
18
|
+
# Create the lexicon
|
19
|
+
lex = WordNet::Lexicon.new
|
20
|
+
|
21
|
+
# Look up the clothing synset as the origin
|
22
|
+
clothing = lex[:clothing].synsets_dataset.nouns.
|
23
|
+
filter { :definition.like('%a covering%') }.first
|
24
|
+
collar = lex[:collar].synsets_dataset.nouns.
|
25
|
+
filter { :definition.like('%band that fits around the neck%') }.first
|
26
|
+
|
27
|
+
puts "Looking for instances of:",
|
28
|
+
" #{collar}",
|
29
|
+
"in the hyponyms of",
|
30
|
+
" #{clothing}",
|
31
|
+
""
|
32
|
+
|
33
|
+
# Now traverse all hyponyms of the clothing synset, and check for "collar" among
|
34
|
+
# each one's "member" meronyms, printing any we find
|
35
|
+
clothing.traverse( :hyponyms ) do |syn|
|
36
|
+
if syn.search( :member_meronyms, collar )
|
37
|
+
puts "Has a collar: #{syn}"
|
38
|
+
else
|
39
|
+
puts "Doesn't have a collar: #{syn}" if $VERBOSE
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
File without changes
|
data/examples/domainTree.rb
CHANGED
File without changes
|
data/examples/memberTree.rb
CHANGED
File without changes
|