opener-pos-tagger 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3442af871dcdee3a432932cd231dd5d9cafc10ce
4
- data.tar.gz: bd0aab2fb211ab510d75883076b6ff9b7831f2af
3
+ metadata.gz: 265d6d03c32e0facbfe14fb9e40b00ef400318a3
4
+ data.tar.gz: 744bf220b17323b4167286118d13c138d05a2cf3
5
5
  SHA512:
6
- metadata.gz: 278744148ee9765d7ecf642fc6818d94679a726bb50cb6c8615073d2e91d504fe18a096aa0c4a8adc74ed7d5d00a516fcd3d4bd1e98ecfb22cf9a8c7cc6a4b7a
7
- data.tar.gz: 878aef62111793d6fb38a23a0e5d5baa39b6c6889179d636163ab88eff973ac000ace121aed8d9cfcceb584d8468875d6649731d7bc98e6a8b04a6a4b78686f6
6
+ metadata.gz: 611d76b145ce73e77738a7fa27d4bcffeba2663a079c72762793c7d6aa7fb0b2c19bf2b57b0b3fc9bdfabc01cb9fc05a49b75c4434dfeac0ca25868ca292b993
7
+ data.tar.gz: 55e715455ea8bfd992c576ee71ab334bbff12d6499796eaadc9b98d8211a1dfb99a10559be8a438a41a4e91f1d81c1ff3cecdb495748d7a240e9dac8a3018712
@@ -0,0 +1,13 @@
1
+ Copyright 2014 OpeNER Project Consortium
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md CHANGED
@@ -1,31 +1,38 @@
1
- POS-tagger
2
- ------------
1
+ # POS-tagger
3
2
 
4
3
  Component that wraps the different existing POS Taggers.
5
4
 
6
5
  ### Confused by some terminology?
7
6
 
8
- This software is part of a larger collection of natural language processing tools known as "the OpeNER project". You can find more information about the project at [the OpeNER portal](http://opener-project.github.io). There you can also find references to terms like KAF (an XML standard to represent linguistic annotations in texts), component, cores, scenario's and pipelines.
7
+ This software is part of a larger collection of natural language processing
8
+ tools known as "the OpeNER project". You can find more information about the
9
+ project at [the OpeNER portal](http://opener-project.github.io). There you can
10
+ also find references to terms like KAF (an XML standard to represent linguistic
11
+ annotations in texts), component, cores, scenario's and pipelines.
9
12
 
10
- Quick Use Example
11
- -----------------
13
+ ## Quick Use Example
12
14
 
13
15
  Installing the pos-tagger can be done by executing:
14
16
 
15
17
  gem install opener-pos-tagger
16
18
 
17
- Please bare in mind that all components in OpeNER take KAF as an input and output KAF by default.
19
+ Please keep in mind that all components in OpeNER take KAF as an input and
20
+ output KAF by default.
18
21
 
19
22
  ### Command line interface
20
23
 
21
- You should now be able to call the POS tagger as a regular shell command: by its name. Once installed the gem normalyl sits in your path so you can call it directly from anywhere.
24
+ You should now be able to call the POS tagger as a regular shell command: by its
25
+ name. Once installed the gem normalyl sits in your path so you can call it
26
+ directly from anywhere.
22
27
 
23
- This aplication reads a text from standard input in order to identify the language.
28
+ This aplication reads a text from standard input in order to identify the
29
+ language.
24
30
 
25
- POS Tagging some text (assuming that the above text is in a file called *english.kaf*):
31
+ POS Tagging some text (assuming that the above text is in a file called
32
+ `english.kaf`):
26
33
 
27
34
  cat english.kaf | pos-tagger
28
-
35
+
29
36
  Will result in
30
37
 
31
38
  <?xml version='1.0' encoding='UTF-8'?>
@@ -80,7 +87,8 @@ You can launch a language identification webservice by executing:
80
87
 
81
88
  pos-tagger-server
82
89
 
83
- This will launch a mini webserver with the webservice. It defaults to port 9292, so you can access it at <http://localhost:9292>.
90
+ This will launch a mini webserver with the webservice. It defaults to port 9292,
91
+ so you can access it at <http://localhost:9292>.
84
92
 
85
93
  To launch it on a different port provide the `-p [port-number]` option like this:
86
94
 
@@ -88,19 +96,23 @@ To launch it on a different port provide the `-p [port-number]` option like this
88
96
 
89
97
  It then launches at <http://localhost:1234>
90
98
 
91
- Documentation on the Webservice is provided by surfing to the urls provided above. For more information on how to launch a webservice run the command with the ```-h``` option.
92
-
99
+ Documentation on the Webservice is provided by surfing to the urls provided
100
+ above. For more information on how to launch a webservice run the command with
101
+ the `--help` option.
93
102
 
94
103
  ### Daemon
95
104
 
96
- Last but not least the POS tagger comes shipped with a daemon that can read jobs (and write) jobs to and from Amazon SQS queues. For more information type:
105
+ Last but not least the POS tagger comes shipped with a daemon that can read jobs
106
+ (and write) jobs to and from Amazon SQS queues. For more information type:
97
107
 
98
108
  pos-tagger-daemon -h
99
109
 
100
- Description of dependencies
101
- ---------------------------
110
+ ## Description of dependencies
102
111
 
103
- This component runs best if you run it in an environment suited for OpeNER components. You can find an installation guide and helper tools in the [OpeNER installer](https://github.com/opener-project/opener-installer) and an [installation guide on the Opener Website](http://opener-project.github.io/getting-started/how-to/local-installation.html)
112
+ This component runs best if you run it in an environment suited for OpeNER
113
+ components. You can find an installation guide and helper tools in the
114
+ [OpeNER installer](https://github.com/opener-project/opener-installer) and an
115
+ [installation guide on the Opener Website](http://opener-project.github.io/getting-started/how-to/local-installation.html)
104
116
 
105
117
  At least you need the following system setup:
106
118
 
@@ -113,34 +125,30 @@ At least you need the following system setup:
113
125
 
114
126
  * Maven (for building the Gem)
115
127
 
116
- Language Extension
117
- ------------------
128
+ ## Language Extension
118
129
 
119
130
  TODO
120
131
 
121
- The Core
122
- --------
132
+ ## The Core
123
133
 
124
- The component is a fat wrapper around the actual language technology core. You can find the core technolies in the following repositories:
134
+ The component is a fat wrapper around the actual language technology core. You
135
+ can find the core technolies in the following repositories:
125
136
 
126
137
  <https://github.com/opener-project/?query=pos>
127
138
  <https://github.com/opener-project/?query=pos>
128
139
 
129
- Where to go from here
130
- ---------------------
140
+ ## Where to go from here
131
141
 
132
142
  * [Check the project website](http://opener-project.github.io)
133
143
  * [Checkout the webservice](http://opener.olery.com/pos-tagger)
134
144
 
135
- Report problem/Get help
136
- -----------------------
145
+ ## Report problem/Get help
137
146
 
138
- If you encounter problems, please email <support@opener-project.eu> or leave an issue in the
147
+ If you encounter problems, please email <support@opener-project.eu> or leave an
148
+ issue in the
139
149
  [issue tracker](https://github.com/opener-project/pos-tagger/issues).
140
150
 
141
-
142
- Contributing
143
- ------------
151
+ ## Contributing
144
152
 
145
153
  1. Fork it <http://github.com/opener-project/pos-tagger/fork>
146
154
  2. Create your feature branch (`git checkout -b my-new-feature`)
@@ -2,9 +2,9 @@
2
2
 
3
3
  require 'opener/daemons'
4
4
 
5
- exec_path = File.expand_path('../../exec/pos-tagger.rb', __FILE__)
5
+ controller = Opener::Daemons::Controller.new(
6
+ :name => 'opener-pos-tagger',
7
+ :exec_path => File.expand_path('../../exec/pos-atgger.rb', __FILE__)
8
+ )
6
9
 
7
- Opener::Daemons::Controller.new(
8
- :name => 'pos-tagger',
9
- :exec_path => exec_path
10
- )
10
+ controller.run
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'puma/cli'
3
+ require 'opener/webservice'
4
4
 
5
- rack_config = File.expand_path('../../config.ru', __FILE__)
5
+ parser = Opener::Webservice::OptionParser.new(
6
+ 'opener-pos-tagger',
7
+ File.expand_path('../../config.ru', __FILE__)
8
+ )
6
9
 
7
- cli = Puma::CLI.new([rack_config] + ARGV)
8
- cli.run
10
+ parser.run
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'opener/daemons'
4
- require_relative '../lib/opener/pos_tagger'
5
4
 
6
- options = Opener::Daemons::OptParser.parse!(ARGV)
7
- daemon = Opener::Daemons::Daemon.new(Opener::POSTagger, options)
5
+ require_relative '../lib/opener/tokenizer'
6
+
7
+ daemon = Opener::Daemons::Daemon.new(Opener::POSTagger)
8
8
 
9
9
  daemon.start
@@ -3,7 +3,6 @@ require 'opener/pos_taggers/en'
3
3
  require 'nokogiri'
4
4
  require 'open3'
5
5
  require 'optparse'
6
- require 'opener/core'
7
6
 
8
7
  require_relative 'pos_tagger/version'
9
8
  require_relative 'pos_tagger/cli'
@@ -46,19 +45,15 @@ module Opener
46
45
  # @return [Array]
47
46
  #
48
47
  def run(input)
49
- begin
50
- language = language_from_kaf(input)
48
+ language = language_from_kaf(input)
51
49
 
52
- unless valid_language?(language)
53
- raise ArgumentError, "The specified language (#{language}) is invalid"
54
- end
50
+ unless valid_language?(language)
51
+ raise ArgumentError, "The specified language (#{language}) is invalid"
52
+ end
55
53
 
56
- kernel = language_constant(language).new(:args => options[:args])
54
+ kernel = language_constant(language).new(:args => options[:args])
57
55
 
58
- return kernel.run(input)
59
- rescue Exception => error
60
- return Opener::Core::ErrorLayer.new(input, error.message, self.class).add
61
- end
56
+ return kernel.run(input)
62
57
  end
63
58
 
64
59
  alias tag run
@@ -1,5 +1,3 @@
1
- require 'sinatra/base'
2
- require 'httpclient'
3
1
  require 'opener/webservice'
4
2
 
5
3
  module Opener
@@ -7,10 +5,11 @@ module Opener
7
5
  ##
8
6
  # POS Tagger server powered by Sinatra.
9
7
  #
10
- class Server < Webservice
8
+ class Server < Webservice::Server
11
9
  set :views, File.expand_path('../views', __FILE__)
12
- text_processor POSTagger
13
- accepted_params :input
10
+
11
+ self.text_processor = POSTagger
12
+ self.accepted_params = [:input]
14
13
  end # Server
15
14
  end # POSTagger
16
15
  end # Opener
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  class POSTagger
3
- VERSION = "2.2.0"
3
+ VERSION = '3.0.0'
4
4
  end
5
5
  end
@@ -10,11 +10,14 @@ Gem::Specification.new do |gem|
10
10
  gem.has_rdoc = "yard"
11
11
  gem.required_ruby_version = ">= 1.9.2"
12
12
 
13
+ gem.license = 'Apache 2.0'
14
+
13
15
  gem.files = Dir.glob([
14
16
  'lib/**/*',
15
17
  'config.ru',
16
18
  '*.gemspec',
17
19
  'README.md',
20
+ 'LICENSE.txt',
18
21
  'exec/**/*'
19
22
  ]).select { |file| File.file?(file) }
20
23
 
@@ -22,14 +25,11 @@ Gem::Specification.new do |gem|
22
25
 
23
26
  gem.add_dependency 'opener-pos-tagger-base', ['~> 2.0', '>= 2.1.0']
24
27
  gem.add_dependency 'opener-pos-tagger-en-es', ['~> 2.0', '>= 2.0.2']
25
- gem.add_dependency 'opener-webservice'
26
28
 
27
29
  gem.add_dependency 'nokogiri'
28
- gem.add_dependency 'sinatra', '~>1.4.2'
29
- gem.add_dependency 'httpclient'
30
- gem.add_dependency 'puma'
31
- gem.add_dependency 'opener-daemons'
32
- gem.add_dependency 'opener-core', '~>1.0'
30
+ gem.add_dependency 'opener-webservice', '~> 2.0'
31
+ gem.add_dependency 'opener-daemons', '~> 2.1'
32
+ gem.add_dependency 'opener-core', '~> 2.0'
33
33
 
34
34
  gem.add_development_dependency 'rspec'
35
35
  gem.add_development_dependency 'cucumber'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-pos-tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opener-pos-tagger-base
@@ -50,20 +50,6 @@ dependencies:
50
50
  version: 2.0.2
51
51
  prerelease: false
52
52
  type: :runtime
53
- - !ruby/object:Gem::Dependency
54
- name: opener-webservice
55
- version_requirements: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - '>='
58
- - !ruby/object:Gem::Version
59
- version: '0'
60
- requirement: !ruby/object:Gem::Requirement
61
- requirements:
62
- - - '>='
63
- - !ruby/object:Gem::Version
64
- version: '0'
65
- prerelease: false
66
- type: :runtime
67
53
  - !ruby/object:Gem::Dependency
68
54
  name: nokogiri
69
55
  version_requirements: !ruby/object:Gem::Requirement
@@ -79,59 +65,31 @@ dependencies:
79
65
  prerelease: false
80
66
  type: :runtime
81
67
  - !ruby/object:Gem::Dependency
82
- name: sinatra
68
+ name: opener-webservice
83
69
  version_requirements: !ruby/object:Gem::Requirement
84
70
  requirements:
85
71
  - - ~>
86
72
  - !ruby/object:Gem::Version
87
- version: 1.4.2
73
+ version: '2.0'
88
74
  requirement: !ruby/object:Gem::Requirement
89
75
  requirements:
90
76
  - - ~>
91
77
  - !ruby/object:Gem::Version
92
- version: 1.4.2
93
- prerelease: false
94
- type: :runtime
95
- - !ruby/object:Gem::Dependency
96
- name: httpclient
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - '>='
105
- - !ruby/object:Gem::Version
106
- version: '0'
107
- prerelease: false
108
- type: :runtime
109
- - !ruby/object:Gem::Dependency
110
- name: puma
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - '>='
114
- - !ruby/object:Gem::Version
115
- version: '0'
116
- requirement: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - '>='
119
- - !ruby/object:Gem::Version
120
- version: '0'
78
+ version: '2.0'
121
79
  prerelease: false
122
80
  type: :runtime
123
81
  - !ruby/object:Gem::Dependency
124
82
  name: opener-daemons
125
83
  version_requirements: !ruby/object:Gem::Requirement
126
84
  requirements:
127
- - - '>='
85
+ - - ~>
128
86
  - !ruby/object:Gem::Version
129
- version: '0'
87
+ version: '2.1'
130
88
  requirement: !ruby/object:Gem::Requirement
131
89
  requirements:
132
- - - '>='
90
+ - - ~>
133
91
  - !ruby/object:Gem::Version
134
- version: '0'
92
+ version: '2.1'
135
93
  prerelease: false
136
94
  type: :runtime
137
95
  - !ruby/object:Gem::Dependency
@@ -140,12 +98,12 @@ dependencies:
140
98
  requirements:
141
99
  - - ~>
142
100
  - !ruby/object:Gem::Version
143
- version: '1.0'
101
+ version: '2.0'
144
102
  requirement: !ruby/object:Gem::Requirement
145
103
  requirements:
146
104
  - - ~>
147
105
  - !ruby/object:Gem::Version
148
- version: '1.0'
106
+ version: '2.0'
149
107
  prerelease: false
150
108
  type: :runtime
151
109
  - !ruby/object:Gem::Dependency
@@ -223,12 +181,14 @@ files:
223
181
  - config.ru
224
182
  - opener-pos-tagger.gemspec
225
183
  - README.md
184
+ - LICENSE.txt
226
185
  - exec/pos-tagger.rb
227
186
  - bin/pos-tagger-server
228
187
  - bin/pos-tagger
229
188
  - bin/pos-tagger-daemon
230
189
  homepage: http://opener-project.github.com/
231
- licenses: []
190
+ licenses:
191
+ - Apache 2.0
232
192
  metadata: {}
233
193
  post_install_message:
234
194
  rdoc_options: []