opener-tree-tagger 4.0.0 → 4.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/tree-tagger +2 -2
- data/lib/opener/tree_tagger.rb +1 -1
- data/lib/opener/tree_tagger/cli.rb +43 -46
- data/lib/opener/tree_tagger/version.rb +1 -1
- data/opener-tree-tagger.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17794acc1c73c9e2734d93fc7ad30343262806cd
|
4
|
+
data.tar.gz: 8382d7a3f899f08568a9c021ef97199c00f4f24d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee5d95a22c467df609e58065aafc0962ef7dc9c12726c936dd5439786edce6330658096b01e91a1f2c3b43f022c36cee241f27ce83ccf481166faf5f6886780b
|
7
|
+
data.tar.gz: 64fdfc566d03364ff5f7ce483fdaffe521b06c2b06355c089b7c222a8dac0b30146eadf1e8c8d536e4dad8cb24b90276e81a824a8b08ec28aef405a3d0107e23
|
data/bin/tree-tagger
CHANGED
data/lib/opener/tree_tagger.rb
CHANGED
@@ -1,67 +1,64 @@
|
|
1
1
|
module Opener
|
2
2
|
class TreeTagger
|
3
|
+
##
|
4
|
+
# CLI wrapper around {Opener::TreeTagger} using Slop.
|
5
|
+
#
|
6
|
+
# @!attribute [r] parser
|
7
|
+
# @return [Slop]
|
8
|
+
#
|
3
9
|
class CLI
|
4
|
-
attr_reader :
|
10
|
+
attr_reader :parser
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@parser = configure_slop
|
14
|
+
end
|
5
15
|
|
6
16
|
##
|
7
17
|
# @param [Array] argv
|
8
|
-
# @param [Hash] options
|
9
18
|
#
|
10
|
-
def
|
11
|
-
|
12
|
-
|
19
|
+
def run(argv = ARGV)
|
20
|
+
parser.parse(argv)
|
21
|
+
end
|
13
22
|
|
14
|
-
|
15
|
-
|
16
|
-
|
23
|
+
##
|
24
|
+
# @return [Slop]
|
25
|
+
#
|
26
|
+
def configure_slop
|
27
|
+
return Slop.new(:strict => false, :indent => 2, :help => true) do
|
28
|
+
banner 'Usage: tree-tagger [OPTIONS]'
|
17
29
|
|
18
|
-
|
30
|
+
separator <<-EOF.chomp
|
19
31
|
|
20
|
-
|
21
|
-
@options[:logging] = true
|
22
|
-
end
|
32
|
+
About:
|
23
33
|
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
opts.separator <<-EOF
|
34
|
+
Rule base POS tagging using TreeTagger, supports various languages such as
|
35
|
+
Dutch and English. This command reads input from STDIN.
|
29
36
|
|
30
|
-
|
37
|
+
Example:
|
31
38
|
|
32
|
-
|
33
|
-
cat example.kaf | #{opts.program_name} -l # Logs information to STDERR
|
39
|
+
cat some_file.kaf | tree-tagger
|
34
40
|
EOF
|
35
|
-
end
|
36
|
-
end
|
37
41
|
|
38
|
-
|
39
|
-
# @param [String] input
|
40
|
-
#
|
41
|
-
def run(input)
|
42
|
-
option_parser.parse!(argv)
|
42
|
+
separator "\nOptions:\n"
|
43
43
|
|
44
|
-
|
44
|
+
on :v, :version, 'Shows the current version' do
|
45
|
+
abort "tree-tagger v#{VERSION} on #{RUBY_DESCRIPTION}"
|
46
|
+
end
|
45
47
|
|
46
|
-
|
47
|
-
end
|
48
|
+
on :'no-time', 'Disables adding of dynamic timestamps'
|
48
49
|
|
49
|
-
|
50
|
+
run do |opts, args|
|
51
|
+
if opts[:'no-time']
|
52
|
+
args = args + ['--no-time']
|
53
|
+
end
|
50
54
|
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
def show_help
|
55
|
-
abort option_parser.to_s
|
56
|
-
end
|
55
|
+
tagger = TreeTagger.new(:args => args)
|
56
|
+
input = STDIN.tty? ? nil : STDIN.read
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def show_version
|
62
|
-
abort "#{option_parser.program_name} v#{VERSION} on #{RUBY_DESCRIPTION}"
|
58
|
+
puts tagger.run(input)
|
59
|
+
end
|
60
|
+
end
|
63
61
|
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
62
|
+
end # CLI
|
63
|
+
end # TreeTagger
|
64
|
+
end # Opener
|
data/opener-tree-tagger.gemspec
CHANGED
@@ -34,6 +34,7 @@ Gem::Specification.new do |gem|
|
|
34
34
|
gem.add_dependency 'rake'
|
35
35
|
gem.add_dependency 'nokogiri'
|
36
36
|
gem.add_dependency 'cliver'
|
37
|
+
gem.add_dependency 'slop', '~> 3.5'
|
37
38
|
|
38
39
|
gem.add_development_dependency 'rspec', '~> 3.0'
|
39
40
|
gem.add_development_dependency 'cucumber'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-tree-tagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rubenIzquierdo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: opener-daemons
|
@@ -95,6 +95,20 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: slop
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '3.5'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.5'
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: rspec
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|