uwn-api 0.0.2 → 0.0.3
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 +4 -12
- data/README.md +14 -8
- data/lib/uwn/api/statement.rb +2 -2
- data/lib/uwn/api/version.rb +1 -1
- data/test/unit/uwn_verify_tree.rb +1 -10
- data/test/unit/uwn_word.rb +62 -0
- data/uwn-api.gemspec +3 -3
- metadata +24 -22
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MjBjYjEwM2YyMjFkNzg3MDQ2N2Y5OGFmZTcyMGJjMTU5MzAyZGEzMQ==
|
3
|
+
metadata.gz: 55ec0efd35c25afa3d95150bc5ea7f860645c224
|
4
|
+
data.tar.gz: 9f7c63af7dcb22b690bd2fe1af5b18717a4a5b9e
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MzBmMDcyMmVmNjA2NmExY2E3MDM5ODgyMWY3OWJlMDFjOTM1MGNmNmQ4YjBj
|
11
|
-
ZTU4ODJlNDRlNDE1NDU4NWYwYWVhOTE1MGI1NDM2OGI5NGYzNTE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NTY0ZWUyNTZiOGY5NDc4NzU4OTQ0ZWVkZDkwYTYzYTlmY2Q1NmQ0NDFmMjYw
|
14
|
-
NWU4NjI4MTBhZTBhZmI3MDUwNWI4N2QyNTJmOTBlOTBiODg2MDFjM2VlMjg5
|
15
|
-
YjI2ZDhlZmY3YTYyYmZjMWNhNzdlZTk3OWRkNjRjYzczY2ZmZGQ=
|
6
|
+
metadata.gz: 052dd954438f763abd269d3aab382ee61c21ad9f216776f7a9d06428ee80a0da56abcf4e923eb5571eef87082e2e9b6891080d5796c332e4ee9bff9a45c2761f
|
7
|
+
data.tar.gz: 0307d511916383cdbbe1eadece38527ec16f5ba720c18555bc77e69792be6331669313abd4b4efc9f8e6bfc4bc9f2331d6e0f236162c42e1b8d6421988734a92
|
data/README.md
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
This project is a Ruby on Rails (gem) wrapper for the UWN database (build from Wordnet), using JRuby (Java) and uwnapi.jar (included). Ruby MRI users will NOT be successful using this gem!!
|
4
4
|
|
5
5
|
* UWN/MENTA: Towards a Universal Multilingual Wordnet API.
|
6
|
-
* http://www.mpi-inf.mpg.de/yago-naga/uwn/
|
6
|
+
* http://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/uwn/
|
7
|
+
|
8
|
+
*NOTE: This gem is mentioned on the UWN/MENTA website as thrid party ruby wrapper!*
|
7
9
|
|
8
10
|
## Installation
|
9
11
|
|
@@ -20,7 +22,7 @@ Or install it yourself as (RubyGems):
|
|
20
22
|
$ gem install uwn-api
|
21
23
|
|
22
24
|
## Changelog
|
23
|
-
|
25
|
+
|
24
26
|
* Version (0.0.2)
|
25
27
|
|
26
28
|
Bug fix, meaning with missing synset (Java Nullpointer Exception)
|
@@ -35,19 +37,23 @@ Or install it yourself as (RubyGems):
|
|
35
37
|
Depth search over multiple nodes
|
36
38
|
|
37
39
|
|
38
|
-
## Usage
|
40
|
+
## Usage/ Setup
|
39
41
|
|
40
42
|
### Download and install
|
41
43
|
|
42
|
-
Before using UWN you'll need to download Wordnet and UWN plugin libraries (http://www.mpi-inf.mpg.de/yago-naga/uwn/
|
44
|
+
Before using UWN you'll need to download UWNAPI, Wordnet, and UWN plugin libraries (http://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/uwn/) which are ~100Mb, and place it in the appropriate directory.
|
45
|
+
|
46
|
+
* http://resources.mpi-inf.mpg.de/yago-naga/uwn/uwnapi.zip (main program with `/plugins` dir)
|
47
|
+
* http://resources.mpi-inf.mpg.de/yago-naga/uwn/wordnet.zip
|
48
|
+
* http://resources.mpi-inf.mpg.de/yago-naga/uwn/uwn.zip
|
49
|
+
* http://resources.mpi-inf.mpg.de/yago-naga/uwn/etymwn.zip
|
43
50
|
|
44
|
-
Place the uwn.dat/plg (and/or) wordnet.dat/plg into your plugins directory
|
45
|
-
|
46
|
-
~/yourgems/uwn-api/lib/uwn/api/deps/plugins (default directory)
|
51
|
+
Place the `uwn.dat/plg` (and/or) `wordnet.dat/plg` into your plugins directory: `~/yourgems/uwn-api/lib/uwn/api/deps/plugins` (default directory)
|
47
52
|
|
48
|
-
OR Point Uwn::Api::Connect to the plugins path.
|
53
|
+
OR `Point Uwn::Api::Connect` to the plugins path.
|
49
54
|
|
50
55
|
```ruby
|
56
|
+
require "uwn/api"
|
51
57
|
uwn = Uwn::Api::Connect.new plugins_path: "/location/of/your/plugins"
|
52
58
|
```
|
53
59
|
|
data/lib/uwn/api/statement.rb
CHANGED
@@ -77,9 +77,9 @@ module Uwn
|
|
77
77
|
def synset
|
78
78
|
unless @object.nil?
|
79
79
|
os = @object.get_object.to_s
|
80
|
-
return os unless os.match(/([s][\/][
|
80
|
+
return os unless os.match(/([s][\/][a-z]){1}[0-9]+/).nil?
|
81
81
|
su = @object.get_subject.to_s
|
82
|
-
return su unless su.match(/([s][\/][
|
82
|
+
return su unless su.match(/([s][\/][a-z]){1}[0-9]+/).nil?
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
data/lib/uwn/api/version.rb
CHANGED
@@ -124,15 +124,6 @@ class UwnVerifyTree < Test::Unit::TestCase
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
-
|
128
|
-
meaning = @uwn.meaning("loot", "eng")
|
129
|
-
begin
|
130
|
-
meaning.synsets.each do |synset|
|
131
|
-
assert synset.is_a?(Uwn::Api::Statement), "expected a statement"
|
132
|
-
end
|
133
|
-
rescue Exception => e
|
134
|
-
assert false, "crashing on predicate_match"
|
135
|
-
end
|
136
|
-
end
|
127
|
+
|
137
128
|
|
138
129
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../lib/uwn/api")
|
4
|
+
|
5
|
+
|
6
|
+
#
|
7
|
+
# Test the constructed tree for faults
|
8
|
+
#
|
9
|
+
|
10
|
+
class UwnVerifyTree < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@uwn = Uwn::Api::Connect.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_predicate_match_for_empty_synset
|
20
|
+
meaning = @uwn.meaning("loot", "eng")
|
21
|
+
begin
|
22
|
+
meaning.synonyms
|
23
|
+
meaning.synsets.each do |synset|
|
24
|
+
assert synset.is_a?(Uwn::Api::Statement), "expected a statement"
|
25
|
+
end
|
26
|
+
rescue Exception => e
|
27
|
+
assert false, "crashing on predicate_match"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_behaviour_behavior
|
32
|
+
# puts "-- running"
|
33
|
+
meaning = @uwn.meaning("CRM", "eng")
|
34
|
+
# puts meaning.inspect
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_adverbs
|
38
|
+
words = ["above", "along", "below", "beside", "between", "during", "for", "from", "in", "near", "on", "outside", "over", "past", "through", "towards", "under", "up", "with"]
|
39
|
+
words.each do |word|
|
40
|
+
meaning = @uwn.meaning(word, "eng")
|
41
|
+
# skip unable to find
|
42
|
+
if meaning.statements.size <= 0
|
43
|
+
puts "word: #{word}"
|
44
|
+
next
|
45
|
+
end
|
46
|
+
assert meaning.lexical_categories.map(&:lexcat).include?("adverb"), "word: `#{word}` not an adverb"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_verbs
|
51
|
+
words = ["go", "do"]
|
52
|
+
words.each do |word|
|
53
|
+
meaning = @uwn.meaning(word, "eng")
|
54
|
+
assert meaning.lexical_categories.map(&:lexcat).include?("verb"), "word: `#{word}` not a verb"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
|
data/uwn-api.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'uwn/api/version'
|
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "
|
21
|
+
spec.add_development_dependency "bundler", "> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
|
24
24
|
# dependencies
|
25
|
-
spec.add_development_dependency "test-unit", "
|
25
|
+
spec.add_development_dependency "test-unit", "> 2.0.0"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,59 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uwn-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Blommesteijn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.3'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
|
-
- - "
|
16
|
+
- - ">"
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '1.3'
|
19
|
+
name: bundler
|
25
20
|
prerelease: false
|
26
21
|
type: :development
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- - "
|
24
|
+
- - ">"
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - ">="
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '0'
|
33
|
+
name: rake
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: test-unit
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
|
-
- - "
|
38
|
+
- - ">="
|
46
39
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
|
-
- - "
|
44
|
+
- - ">"
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: 2.0.0
|
47
|
+
name: test-unit
|
53
48
|
prerelease: false
|
54
49
|
type: :development
|
55
|
-
|
56
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.0
|
55
|
+
description: 'UWN/MENTA: Towards a Universal Multilingual Wordnet API; (Ruby on Rails)
|
56
|
+
gem wrapper for JRuby.'
|
57
57
|
email:
|
58
58
|
- dennis@blommesteijn.com
|
59
59
|
executables: []
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- test/unit/uwn_connect.rb
|
84
84
|
- test/unit/uwn_verify_statement.rb
|
85
85
|
- test/unit/uwn_verify_tree.rb
|
86
|
+
- test/unit/uwn_word.rb
|
86
87
|
- uwn-api.gemspec
|
87
88
|
homepage: ''
|
88
89
|
licenses:
|
@@ -104,12 +105,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
107
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.4.8
|
108
109
|
signing_key:
|
109
110
|
specification_version: 4
|
110
|
-
summary:
|
111
|
+
summary: 'UWN/MENTA: Towards a Universal Multilingual Wordnet API; (Ruby on Rails)
|
111
112
|
gem wrapper for JRuby.'
|
112
113
|
test_files:
|
113
114
|
- test/unit/uwn_connect.rb
|
114
115
|
- test/unit/uwn_verify_statement.rb
|
115
116
|
- test/unit/uwn_verify_tree.rb
|
117
|
+
- test/unit/uwn_word.rb
|