opener-pos-tagger 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pos-tagger +2 -2
- data/lib/opener/pos_tagger.rb +1 -1
- data/lib/opener/pos_tagger/cli.rb +34 -49
- data/lib/opener/pos_tagger/version.rb +1 -1
- data/opener-pos-tagger.gemspec +3 -2
- metadata +30 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf7095e2c9fcbfcebc368ca29ee3b6f42871cbf6
|
4
|
+
data.tar.gz: f1718afc6b69c8f1cb7be1b22971fe0e00033a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0bd215b41e2556e6c51e8058d4cdb20a93b1bd339159f12cee7598d77915f23b898559581ec10fa024cc18e9a774d714a956d24998ed8a0a8fb2638a53ea59
|
7
|
+
data.tar.gz: 4a7ae07742a19e592dc69ffb9651a9e33f0f628b34b7f3f65914aee47290c6aa6f1b037e7471c6b7bfd735f3e0788aec11c486796968923e3c7daa77ee4a7068
|
data/bin/pos-tagger
CHANGED
data/lib/opener/pos_tagger.rb
CHANGED
@@ -1,72 +1,57 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
1
|
module Opener
|
4
2
|
class POSTagger
|
5
3
|
##
|
6
|
-
# CLI wrapper around {Opener::POSTagger} using
|
4
|
+
# CLI wrapper around {Opener::POSTagger} using Slop.
|
7
5
|
#
|
8
|
-
# @!attribute [r]
|
9
|
-
# @return [
|
10
|
-
# @!attribute [r] option_parser
|
11
|
-
# @return [OptionParser]
|
6
|
+
# @!attribute [r] parser
|
7
|
+
# @return [Slop]
|
12
8
|
#
|
13
9
|
class CLI
|
14
|
-
attr_reader :
|
10
|
+
attr_reader :parser
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@parser = configure_slop
|
14
|
+
end
|
15
15
|
|
16
16
|
##
|
17
|
-
# @param [
|
17
|
+
# @param [Array] argv
|
18
18
|
#
|
19
|
-
def
|
20
|
-
|
19
|
+
def run(argv = ARGV)
|
20
|
+
parser.parse(argv)
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
##
|
24
|
+
# @return [Slop]
|
25
|
+
#
|
26
|
+
def configure_slop
|
27
|
+
return Slop.new(:strict => false, :indent => 2, :help => true) do
|
28
|
+
banner 'Usage: pos-tagger [OPTIONS]'
|
25
29
|
|
26
|
-
|
27
|
-
show_help
|
28
|
-
end
|
30
|
+
separator <<-EOF.chomp
|
29
31
|
|
30
|
-
|
31
|
-
show_version
|
32
|
-
end
|
32
|
+
About:
|
33
33
|
|
34
|
-
|
34
|
+
POS tagger component with support for various languages such as Dutch and
|
35
|
+
English. This component reads input from STDIN.
|
35
36
|
|
36
|
-
|
37
|
+
Example:
|
37
38
|
|
38
|
-
|
39
|
+
cat some_file.kaf | pos-tagger
|
39
40
|
EOF
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
##
|
44
|
-
# @param [String] input
|
45
|
-
#
|
46
|
-
def run(input)
|
47
|
-
option_parser.parse!(options[:args])
|
48
|
-
|
49
|
-
tagger = POSTagger.new(options)
|
50
|
-
|
51
|
-
stdout = tagger.run(input)
|
52
41
|
|
53
|
-
|
54
|
-
end
|
42
|
+
separator "\nOptions:\n"
|
55
43
|
|
56
|
-
|
44
|
+
on :v, :version, 'Shows the current version' do
|
45
|
+
abort "pos-tagger v#{VERSION} on #{RUBY_DESCRIPTION}"
|
46
|
+
end
|
57
47
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def show_help
|
62
|
-
abort option_parser.to_s
|
63
|
-
end
|
48
|
+
run do |opts, args|
|
49
|
+
tagger = POSTagger.new(:args => args)
|
50
|
+
input = STDIN.tty? ? nil : STDIN.read
|
64
51
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
def show_version
|
69
|
-
abort "#{option_parser.program_name} v#{VERSION} on #{RUBY_DESCRIPTION}"
|
52
|
+
puts tagger.run(input)
|
53
|
+
end
|
54
|
+
end
|
70
55
|
end
|
71
56
|
end # CLI
|
72
57
|
end # POSTagger
|
data/opener-pos-tagger.gemspec
CHANGED
@@ -26,14 +26,15 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_dependency 'opener-pos-tagger-base', ['~> 2.0', '>= 2.1.0']
|
27
27
|
gem.add_dependency 'opener-pos-tagger-en-es', ['~> 2.0', '>= 2.0.2']
|
28
28
|
|
29
|
-
gem.add_dependency 'nokogiri'
|
30
29
|
gem.add_dependency 'opener-webservice', '~> 2.0'
|
31
30
|
gem.add_dependency 'opener-daemons', '~> 2.1'
|
32
31
|
gem.add_dependency 'opener-core', '~> 2.0'
|
33
32
|
|
33
|
+
gem.add_dependency 'nokogiri'
|
34
|
+
gem.add_dependency 'slop', '~> 3.5'
|
35
|
+
|
34
36
|
gem.add_development_dependency 'rspec'
|
35
37
|
gem.add_development_dependency 'cucumber'
|
36
38
|
gem.add_development_dependency 'pry'
|
37
39
|
gem.add_development_dependency 'rake'
|
38
40
|
end
|
39
|
-
|
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: 3.
|
4
|
+
version: 3.1.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-11-
|
11
|
+
date: 2014-11-26 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: nokogiri
|
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: opener-webservice
|
69
55
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,6 +92,34 @@ dependencies:
|
|
106
92
|
version: '2.0'
|
107
93
|
prerelease: false
|
108
94
|
type: :runtime
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: nokogiri
|
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: slop
|
111
|
+
version_requirements: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ~>
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '3.5'
|
116
|
+
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ~>
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '3.5'
|
121
|
+
prerelease: false
|
122
|
+
type: :runtime
|
109
123
|
- !ruby/object:Gem::Dependency
|
110
124
|
name: rspec
|
111
125
|
version_requirements: !ruby/object:Gem::Requirement
|