rwordnet2 2.0.1
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.
- checksums.yaml +7 -0
- data/History.txt +21 -0
- data/README.markdown +76 -0
- data/WordNet-3.0/AUTHORS +6 -0
- data/WordNet-3.0/COPYING +31 -0
- data/WordNet-3.0/LICENSE +31 -0
- data/WordNet-3.0/README +101 -0
- data/WordNet-3.0/dict/data.adj +18185 -0
- data/WordNet-3.0/dict/data.adv +3650 -0
- data/WordNet-3.0/dict/data.noun +82144 -0
- data/WordNet-3.0/dict/data.verb +13796 -0
- data/WordNet-3.0/dict/index.adj +21508 -0
- data/WordNet-3.0/dict/index.adv +4510 -0
- data/WordNet-3.0/dict/index.noun +117827 -0
- data/WordNet-3.0/dict/index.verb +11558 -0
- data/examples/benchmark.rb +14 -0
- data/examples/dictionary.rb +20 -0
- data/examples/full_hypernym.rb +9 -0
- data/examples/morphy.rb +20 -0
- data/examples/synset_find.rb +8 -0
- data/lib/rwordnet/db.rb +25 -0
- data/lib/rwordnet/lemma.rb +87 -0
- data/lib/rwordnet/pointer.rb +32 -0
- data/lib/rwordnet/pointers.rb +82 -0
- data/lib/rwordnet/synset.rb +286 -0
- data/lib/rwordnet/version.rb +3 -0
- data/lib/rwordnet.rb +5 -0
- data/morphy/exceptions/adj.exc +1490 -0
- data/morphy/exceptions/adv.exc +7 -0
- data/morphy/exceptions/noun.exc +2054 -0
- data/morphy/exceptions/verb.exc +2401 -0
- data/test/test_helper.rb +35 -0
- data/test/unit/db_test.rb +14 -0
- data/test/unit/lemma_test.rb +94 -0
- data/test/unit/pointer_test.rb +26 -0
- data/test/unit/synset_test.rb +83 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8355a85f694a17df95d77417b9f5cc6d381cc699ba5793e6a9825d6869a2ecdd
|
4
|
+
data.tar.gz: 9522791ec40dc6bada5338f6286828a549c5c005b0df4ddbecf7bc37f57a3605
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d086934ecb51bc6e3f9a49c2b44eb13fd6d82da93dd37d86f6f65e6651be62f59b8841a7e66f3d69fde4480bb1d0cc7b2dc115139a857c89c7e8e9d760100994
|
7
|
+
data.tar.gz: ff4aa21b74e6c22f2ffdf7a2d984eb81e92ed6dbdc4a4c54494e55346cb31bc3a4935ae9ca7f86f096203f6b8bfba4a495b8efb80cc42a531b4a6ad1fc1bb865
|
data/History.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# rWordNet 1.0.0
|
2
|
+
* Performance fixes for the lookup
|
3
|
+
* Find using Lemma.find / Lemma.find_all
|
4
|
+
* using ruby style constant names like `VerbPointers` -> `VERB_POINTERS`
|
5
|
+
* renamed WordNet::WordNetDB to WordNet::DB
|
6
|
+
* renaming a few methods in Lemma like `p_cnt` -> `pointer_count`
|
7
|
+
* make Pointer a real class
|
8
|
+
* renaming a few methods in SynSet like `get_relation` -> `relation`
|
9
|
+
|
10
|
+
# rWordNet 0.1.3
|
11
|
+
* Fixed a terrible bug that caused Indices to re-read the *entire* database on every failed lookup.
|
12
|
+
|
13
|
+
# rWordNet 0.1.2
|
14
|
+
* Added unique (integer) ids to lemmas [Wolfram Sieber]
|
15
|
+
|
16
|
+
# rWordNet 0.1.1
|
17
|
+
* Maintenance release, fixing some broken unit tests.
|
18
|
+
* Updated the interface for using Indices; where before you could instantiate an Index by calling, e.g., NounIndex.new, now you instantiate them as singleton instances (`NounIndex.instance`).
|
19
|
+
|
20
|
+
# rWordNet 0.1.0
|
21
|
+
* Initial release
|
data/README.markdown
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# A pure Ruby interface to WordNet #
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/rwordnet)
|
4
|
+
[](https://travis-ci.org/doches/rwordnet)
|
5
|
+
[](https://inch-ci.org/github/doches/rwordnet)
|
6
|
+
[](https://codeclimate.com/github/doches/rwordnet)
|
7
|
+
[](https://codeclimate.com/github/doches/rwordnet/coverage)
|
8
|
+
|
9
|
+
## Summary ##
|
10
|
+
|
11
|
+
+ Works directly on the database that comes with WordNet
|
12
|
+
+ No gem or native dependencies
|
13
|
+
+ *Very* easy to install
|
14
|
+
+ Small footprint (8.1M vs 24M for Ruby-Wordnet+DB)
|
15
|
+
+ Can use a custom, existing WordNet installation
|
16
|
+
|
17
|
+
## About ##
|
18
|
+
|
19
|
+
This library implements a pure Ruby interface to the WordNet lexical/semantic
|
20
|
+
database. Unlike existing ruby bindings, this one doesn't require you to convert
|
21
|
+
the original WordNet database into a new database format; instead it can work directly
|
22
|
+
on the database that comes with WordNet.
|
23
|
+
|
24
|
+
If you're doing something data-intensive you will achieve much better performance
|
25
|
+
with Michael Granger's [Ruby-WordNet](http://www.deveiate.org/projects/Ruby-WordNet/),
|
26
|
+
since it converts the WordNet database into a BerkelyDB file for quicker access. rwordnet has a much smaller footprint, with no gem or native dependencies, and requires about a third of the space on disk as Ruby-Wordnet + DB. In
|
27
|
+
writing rwordnet, I've focused more on usability and ease of installation ( *gem install
|
28
|
+
rwordnet* ) at the expense of some performance. Use at your own risk, etc.
|
29
|
+
|
30
|
+
| Note |
|
31
|
+
| --- |
|
32
|
+
| `2.0.0` changed how you require rwordnet from `require 'wordnet'` to `require 'rwordnet'` (note the extra `r`!). |
|
33
|
+
|
34
|
+
## Installation ##
|
35
|
+
|
36
|
+
One of the chief benefits of rwordnet over Ruby-WordNet is how easy it is to install:
|
37
|
+
|
38
|
+
gem install rwordnet
|
39
|
+
|
40
|
+
That's it! rwordnet comes bundled with the WordNet database which it uses by default,
|
41
|
+
so there's absolutely nothing else to download, install, or configure.
|
42
|
+
Of course, if you want to use your own WordNet installation, that's easy too -- just
|
43
|
+
set the path to WordNet's database files before using the library (see examples below).
|
44
|
+
|
45
|
+
## Usage ##
|
46
|
+
|
47
|
+
The other benefit of rwordnet over Ruby-WordNet is that it's so much easier (IMHO) to
|
48
|
+
use.
|
49
|
+
|
50
|
+
As an example, consider finding all of the noun glosses for a given word:
|
51
|
+
|
52
|
+
```Ruby
|
53
|
+
require 'rwordnet'
|
54
|
+
|
55
|
+
lemma = WordNet::Lemma.find("fruit", :noun)
|
56
|
+
lemma.synsets.each { |synset| puts synset.gloss }
|
57
|
+
```
|
58
|
+
|
59
|
+
...or all of the glosses, period:
|
60
|
+
|
61
|
+
```Ruby
|
62
|
+
lemmas = WordNet::Lemma.find_all("fruit")
|
63
|
+
synsets = lemmas.map { |lemma| lemma.synsets }
|
64
|
+
words = synsets.flatten
|
65
|
+
words.each { |word| puts word.gloss }
|
66
|
+
```
|
67
|
+
|
68
|
+
Have your own WordNet database that you've marked up with extra attributes and whatnot?
|
69
|
+
No problem:
|
70
|
+
|
71
|
+
```Ruby
|
72
|
+
require 'rwordnet'
|
73
|
+
|
74
|
+
WordNet::DB.path = "/path/to/WordNet-3.0"
|
75
|
+
lemmas = WordNet::Lemma.find_all("fruit")
|
76
|
+
```
|
data/WordNet-3.0/AUTHORS
ADDED
data/WordNet-3.0/COPYING
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.
|
data/WordNet-3.0/LICENSE
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.
|
data/WordNet-3.0/README
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
|
2
|
+
This is the README file for WordNet 3.0
|
3
|
+
|
4
|
+
1. About WordNet
|
5
|
+
|
6
|
+
WordNet was developed at Princeton University's Cognitive Science
|
7
|
+
Laboratory under the direction of George Miller, James S. McDonnell
|
8
|
+
Distinguished University Professor of Psychology, Emeritus. Over the
|
9
|
+
years many linguists, lexicographers, students, and software engineers
|
10
|
+
have contributed to the project.
|
11
|
+
|
12
|
+
WordNet is an online lexical reference system. Word forms in WordNet
|
13
|
+
are represented in their familiar orthography; word meanings are
|
14
|
+
represented by synonym sets (synsets) - lists of synonymous word forms
|
15
|
+
that are interchangeable in some context. Two kinds of relations are
|
16
|
+
recognized: lexical and semantic. Lexical relations hold between word
|
17
|
+
forms; semantic relations hold between word meanings.
|
18
|
+
|
19
|
+
To learn more about WordNet, the book "WordNet: An Electronic Lexical
|
20
|
+
Database," containing an updated version of "Five Papers on WordNet"
|
21
|
+
and additional papers by WordNet users, is available from MIT Press:
|
22
|
+
|
23
|
+
http://mitpress.mit.edu/book-home.tcl?isbn=026206197X
|
24
|
+
|
25
|
+
2. The WordNet Web Site
|
26
|
+
|
27
|
+
We maintain a Web site at:
|
28
|
+
|
29
|
+
http://wordnet.princeton.edu
|
30
|
+
|
31
|
+
Information about WordNet, access to our online interface, and the
|
32
|
+
various WordNet packages that you can download are available from our
|
33
|
+
web site. All of the software documentation is available online, as
|
34
|
+
well as a FAQ. On this site we also have information about other
|
35
|
+
applications that use WordNet. If you have an application that you
|
36
|
+
would like included, please send e-mail to the above address.
|
37
|
+
|
38
|
+
3. Contacting Us
|
39
|
+
|
40
|
+
Ongoing deveopment work and WordNet related projects are done by a
|
41
|
+
small group of researchers, lexicographers, and systems programmers.
|
42
|
+
Since our resources are VERY limited, we request that you please
|
43
|
+
confine correspondence to WordNet topics only. Please check the
|
44
|
+
documentation, FAQ, and other resources for the answer to your
|
45
|
+
question or problem before contacting us.
|
46
|
+
|
47
|
+
If you have trouble installing or downloading WordNet, have a bug to
|
48
|
+
report, or any other problem, please refer to the online FAQ file
|
49
|
+
first. If you can heal thyself, please do so. The FAQ will be
|
50
|
+
updated over time. And if you do find a previously unreported
|
51
|
+
problem, please use our Bug Report Form:
|
52
|
+
|
53
|
+
http://wordnet.princeton.edu/cgi-bin/bugsubmit.pl
|
54
|
+
|
55
|
+
When reporting a problem, please be as specific as possible, stating
|
56
|
+
the computer platform you are using, which interface you are using,
|
57
|
+
and the exact error. The more details you can provide, the more
|
58
|
+
likely it is that you will get an answer.
|
59
|
+
|
60
|
+
There is a WordNet user discussion group mailing list that we invite
|
61
|
+
our users to join. Users use this list to ask questions of one
|
62
|
+
another, announce extensions to WordNet that they've developed, and
|
63
|
+
other topics of general usefulness to the user community.
|
64
|
+
|
65
|
+
Information on joining the user discussion list, reporting bugs and other
|
66
|
+
contact information is in found on our website at:
|
67
|
+
|
68
|
+
http://wordnet.princeton.edu/contact
|
69
|
+
|
70
|
+
4. Current Release
|
71
|
+
|
72
|
+
WordNet Version 3.0 is the latest version available for download. Two
|
73
|
+
basic database packages are available - one for Windows and one for
|
74
|
+
Unix platforms (including Mac OS X). See the file ChangeLog (Unix) or
|
75
|
+
CHANGES.txt (Windows) for a list of changes from previous versions.
|
76
|
+
|
77
|
+
WordNet packages can either be downloaded from our web site via:
|
78
|
+
|
79
|
+
http://wordnet.princeton.edu/obtain
|
80
|
+
|
81
|
+
The Windows package is a self-extracting archive that installs itself
|
82
|
+
when you double-click on it.
|
83
|
+
|
84
|
+
Beginning with Version 2.1, we changed the Unix package to a GNU Autotools
|
85
|
+
package. The WordNet browser makes use of the open source Tcl and Tk
|
86
|
+
packages. Many systems come with either or both pre-installed. If
|
87
|
+
your system doesn't (some systems have Tcl installed, but not Tk)
|
88
|
+
Tcl/Tk can be downloaded from:
|
89
|
+
|
90
|
+
http://www.tcl.tk/
|
91
|
+
|
92
|
+
Tcl and Tk must be installed BEFORE you compile WordNet. You must also
|
93
|
+
have a C compiler before installing Tcl/Tk or WordNet. WordNet has
|
94
|
+
been built and tested with the GNU gcc compiler. This is
|
95
|
+
pre-installed on most Unix systems, and can be downloaded from:
|
96
|
+
|
97
|
+
http://gcc.gnu.org/
|
98
|
+
|
99
|
+
See the file INSTALL for detailed WordNet installation instructions.
|
100
|
+
|
101
|
+
|