wlapi 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +19 -9
- data/lib/wlapi/api.rb +9 -6
- data/test/test_api.rb +3 -3
- metadata +10 -15
- data/INSTALL +0 -5
- data/README.rdoc +0 -22
- data/Rakefile +0 -14
- data/wlapi.gemspec +0 -19
data/README
CHANGED
@@ -1,22 +1,32 @@
|
|
1
|
-
WLAPI
|
1
|
+
= WLAPI
|
2
2
|
|
3
|
-
RubyGems
|
4
|
-
Developers Homepage
|
5
|
-
WLAPI Project Page
|
3
|
+
* {RubyGems}[http://rubygems.org/gems/wlapi]
|
4
|
+
* Developers {Homepage}[http://www.uni-trier.de/index.php?id=24140]
|
5
|
+
* {WLAPI Project Page}[http://wlapi.rubyforge.org/]
|
6
6
|
|
7
|
-
DESCRIPTION
|
7
|
+
== DESCRIPTION
|
8
8
|
|
9
9
|
WLAPI is a simple API for Wortschatz Leipzig project.
|
10
10
|
|
11
|
-
|
11
|
+
== INSTALLATION
|
12
|
+
|
13
|
+
WLAPI is provided as a .gem package. Simply install it via RubyGems.
|
14
|
+
|
15
|
+
== SYNOPSIS
|
12
16
|
$ require 'wlapi'
|
13
17
|
$ api = WLAPI::API.new
|
14
18
|
$ api.synonyms('Haus', 15) # returns an array with string values (UTF8 encoded)
|
19
|
+
$ api.domain('Auto') # returns an array with strings
|
20
|
+
|
21
|
+
See documentation in the WLAPI::API class for details on particular methods.
|
22
|
+
|
23
|
+
== SUPPORT
|
24
|
+
|
25
|
+
If you have question, bug reports or any suggestions, please drop me an email :) Any help is deeply appreciated!
|
15
26
|
|
16
|
-
|
27
|
+
== LICENSE
|
17
28
|
|
18
|
-
|
29
|
+
WLAPI is a copyrighted software by Andrei Beliankou, 2010, 2011
|
19
30
|
|
20
|
-
WLAPI is a copyrighted software by Andrei Beliankou, 2010.
|
21
31
|
You may use, redistribute and change it under the terms
|
22
32
|
provided in the LICENSE file.
|
data/lib/wlapi/api.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
# 2010-, Andrei Beliankou
|
3
3
|
|
4
|
-
|
4
|
+
#:title: Ruby based API for Wortschatz Leipzig web services
|
5
|
+
#:main: README
|
5
6
|
|
6
7
|
|
7
8
|
# SAVON is a SOAP client.
|
@@ -14,6 +15,7 @@ include REXML
|
|
14
15
|
# Top level namespace wrapper for WLAPI
|
15
16
|
module WLAPI
|
16
17
|
|
18
|
+
VERSION = '0.7.2'
|
17
19
|
# This class represents an interface to the linguistic web services
|
18
20
|
# provided by the University of Leipzig.
|
19
21
|
#
|
@@ -135,7 +137,7 @@ module WLAPI
|
|
135
137
|
arg1 = ['Wort', word]
|
136
138
|
arg2 = ['Limit', limit]
|
137
139
|
answer = query(@cl_Synonyms, @services['Synonyms'], arg1, arg2)
|
138
|
-
# Synonym service
|
140
|
+
# Synonym service provides multiple values, so we take only odd.
|
139
141
|
return get_answer(answer, '[position() mod 2 = 1 ]')
|
140
142
|
end
|
141
143
|
|
@@ -230,7 +232,8 @@ module WLAPI
|
|
230
232
|
arg1 = ['Wort', word]
|
231
233
|
arg2 = ['Wortart', pos]
|
232
234
|
arg3 = ['Limit', limit]
|
233
|
-
answer = query(@cl_LeftCollocationFinder,
|
235
|
+
answer = query(@cl_LeftCollocationFinder,
|
236
|
+
@services['LeftCollocationFinder'], arg1, arg2, arg3)
|
234
237
|
return get_answer(answer)
|
235
238
|
end
|
236
239
|
|
@@ -239,7 +242,7 @@ module WLAPI
|
|
239
242
|
arg1 = ['Wort', word]
|
240
243
|
arg2 = ['Mindestsignifikanz', sign]
|
241
244
|
arg3 = ['Limit', limit]
|
242
|
-
raise 'Not implemented yet!'
|
245
|
+
raise NotImplementedError, 'Not implemented yet!'
|
243
246
|
end
|
244
247
|
|
245
248
|
# Returns statistically significant co-occurrences of the input word.
|
@@ -250,7 +253,7 @@ module WLAPI
|
|
250
253
|
arg1 = ['Wort', word]
|
251
254
|
arg2 = ['Mindestsignifikanz', sign]
|
252
255
|
arg3 = ['Limit', limit]
|
253
|
-
raise 'Not implemented yet!'
|
256
|
+
raise NotImplementedError, 'Not implemented yet!'
|
254
257
|
end
|
255
258
|
|
256
259
|
# Returns the intersection of the co-occurrences of the two given words.
|
@@ -265,7 +268,7 @@ module WLAPI
|
|
265
268
|
arg2 = ['Wort 2', word2]
|
266
269
|
arg3 = ['Limit', limit]
|
267
270
|
# we are not going to implement it now
|
268
|
-
raise 'Will never be implemented!'
|
271
|
+
raise NotImplementedError, 'Will never be implemented!'
|
269
272
|
end
|
270
273
|
|
271
274
|
private
|
data/test/test_api.rb
CHANGED
@@ -207,19 +207,19 @@ class TestApi < Test::Unit::TestCase
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def test_cooccurrences
|
210
|
-
assert_raise(
|
210
|
+
assert_raise(NotImplementedError) do
|
211
211
|
@api.cooccurrences(@word, 1, 10)
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
215
215
|
def test_cooccurrences_all
|
216
|
-
assert_raise(
|
216
|
+
assert_raise(NotImplementedError) do
|
217
217
|
@api.cooccurrences_all(@word, 1, 10)
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
221
|
def test_intersection
|
222
|
-
assert_raise(
|
222
|
+
assert_raise(NotImplementedError) do
|
223
223
|
@api.intersection(@word, @word, 10)
|
224
224
|
end
|
225
225
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wlapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrei Beliankou
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-04-07 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -39,26 +39,21 @@ executables: []
|
|
39
39
|
extensions: []
|
40
40
|
|
41
41
|
extra_rdoc_files:
|
42
|
-
- README
|
42
|
+
- README
|
43
43
|
- LICENSE
|
44
44
|
files:
|
45
|
-
- README.rdoc
|
46
|
-
- wlapi.gemspec
|
47
|
-
- INSTALL
|
48
|
-
- test/test_api.rb
|
49
|
-
- LICENSE
|
50
|
-
- Rakefile
|
51
|
-
- README
|
52
45
|
- lib/wlapi/api.rb
|
53
46
|
- lib/wlapi.rb
|
47
|
+
- README
|
48
|
+
- LICENSE
|
49
|
+
- test/test_api.rb
|
54
50
|
has_rdoc: true
|
55
51
|
homepage: http://www.uni-trier.de/index.php?id=34451
|
56
52
|
licenses: []
|
57
53
|
|
58
54
|
post_install_message:
|
59
|
-
rdoc_options:
|
60
|
-
|
61
|
-
- README.rdoc
|
55
|
+
rdoc_options: []
|
56
|
+
|
62
57
|
require_paths:
|
63
58
|
- lib
|
64
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/INSTALL
DELETED
data/README.rdoc
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
= WLAPI
|
2
|
-
|
3
|
-
* {RubyGems}[http://rubygems.org/gems/wlapi]
|
4
|
-
* Developers {Homepage}[http://www.uni-trier.de/index.php?id=24140]
|
5
|
-
* {WLAPI Project Page}[http://wlapi.rubyforge.org/]
|
6
|
-
|
7
|
-
== DESCRIPTION
|
8
|
-
|
9
|
-
WLAPI is a simple API for Wortschatz Leipzig project.
|
10
|
-
|
11
|
-
== SYNOPSIS
|
12
|
-
$ require 'wlapi'
|
13
|
-
$ api = WLAPI::API.new
|
14
|
-
$ api.synonyms('Haus', 15) # returns an array with string values (UTF8 encoded)
|
15
|
-
|
16
|
-
See RDOC documentation for details on particular methods.
|
17
|
-
|
18
|
-
== LICENSE
|
19
|
-
|
20
|
-
WLAPI is a copyrighted software by Andrei Beliankou, 2010.
|
21
|
-
You may use, redistribute and change it under the terms
|
22
|
-
provided in the LICENSE file.
|
data/Rakefile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
# we can require 'rake/clean' to add 'clobber' and 'clean' tasks
|
4
|
-
require 'rake/clean'
|
5
|
-
require 'rake/testtask'
|
6
|
-
|
7
|
-
|
8
|
-
SRC = FileList['*.rb']
|
9
|
-
|
10
|
-
CLOBBER.include('doc', '**/*.html', '*.gem')
|
11
|
-
|
12
|
-
Rake::TestTask.new do |t|
|
13
|
-
t.test_files = FileList['test/*.rb']
|
14
|
-
end
|
data/wlapi.gemspec
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = "wlapi"
|
3
|
-
s.summary = "WLAPI is a programmatic API for web services provided by the project Wortschatz, University of Leipzig. Use different linguistic services such as synonym and collocation search." # it is the description for 'gem list -d'
|
4
|
-
s.description = "WLAPI is a programmatic API for web services provided by the project Wortschatz, University of Leipzig." # it appears on the RubyGems page
|
5
|
-
s.rubyforge_project = "wlapi"
|
6
|
-
s.requirements = [ 'Using this gem requires understanding of the linguistic background behind the WL project.' ] # it isn't currently used
|
7
|
-
s.version = "0.7.1"
|
8
|
-
s.author = "Andrei Beliankou"
|
9
|
-
s.email = "a.belenkow@uni-trier.de"
|
10
|
-
s.homepage = "http://www.uni-trier.de/index.php?id=34451"
|
11
|
-
# s.require_paths = 'lib' # it is the default value, why to use?
|
12
|
-
s.add_dependency('savon')
|
13
|
-
s.rdoc_options = ["-m", "README.rdoc"]
|
14
|
-
s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
|
15
|
-
s.platform = Gem::Platform::RUBY
|
16
|
-
s.required_ruby_version = '>=1.8.5'
|
17
|
-
s.files = Dir['**/*']
|
18
|
-
s.test_files = ["test/test_api.rb"]
|
19
|
-
end
|