rstt 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rstt +2 -1
- data/lib/rstt/version.rb +1 -1
- data/lib/tasks/{config.thor → configure.rb} +27 -21
- metadata +16 -16
data/bin/rstt
CHANGED
@@ -28,7 +28,8 @@ opts = Slop.parse do
|
|
28
28
|
|
29
29
|
on :c, :configure=, "configure Rstt by setting TreeTagger path and installed languages [ARG path]", optional: false do
|
30
30
|
print "initilizing ..\n"
|
31
|
-
|
31
|
+
run = File.join(File.dirname(__FILE__), '..', 'lib','tasks','configure.rb')
|
32
|
+
print `#{run} init #{self[:configure]}`
|
32
33
|
end
|
33
34
|
|
34
35
|
|
data/lib/rstt/version.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require "thor"
|
2
3
|
|
3
|
-
class
|
4
|
+
class Configure < Thor
|
4
5
|
include Thor::Actions
|
5
6
|
|
6
7
|
desc "init PATH", "add TreeTagger path to module (--force replace old one)"
|
7
|
-
method_options :force => :boolean
|
8
|
+
# method_options :force => :boolean
|
9
|
+
# method_options :required
|
8
10
|
def init(path)
|
9
11
|
if options.force?
|
10
12
|
remove
|
@@ -28,10 +30,21 @@ class Config < Thor
|
|
28
30
|
puts "specify path as argument:\n"
|
29
31
|
puts " thor config:init /path/to/your/TreeTagger/installation/"
|
30
32
|
end
|
31
|
-
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "get_languages", "see possible languages"
|
37
|
+
def get_languages
|
38
|
+
languages = []
|
39
|
+
get_files_of_dir do |file|
|
40
|
+
languages << file.split("-")[2] if file.include?("tree-tagger")
|
41
|
+
end
|
42
|
+
|
43
|
+
languages.uniq
|
32
44
|
end
|
33
45
|
|
34
|
-
|
46
|
+
private
|
47
|
+
# desc "set_languages", "set installed languages"
|
35
48
|
def set_languages
|
36
49
|
puts "setting languages .."
|
37
50
|
languages = {}
|
@@ -41,41 +54,30 @@ class Config < Thor
|
|
41
54
|
foos = file.split("-")
|
42
55
|
languages[foos.first] = {utf8: foos.last.include?("utf")} unless foos.first.include?(".")
|
43
56
|
end
|
44
|
-
|
45
|
-
insert_into_file
|
57
|
+
|
58
|
+
insert_into_file settings_path, after: /^ TT_HOME = (.+)\n/ do
|
46
59
|
" LANGUAGES = #{languages}\n"
|
47
60
|
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
desc "get_languages", "see possible languages"
|
52
|
-
def get_languages
|
53
|
-
languages = []
|
54
|
-
get_files_of_dir do |file|
|
55
|
-
languages << file.split("-")[2] if file.include?("tree-tagger")
|
56
|
-
end
|
57
61
|
|
58
|
-
languages.uniq
|
59
62
|
end
|
60
63
|
|
61
|
-
private
|
62
64
|
def insert(path)
|
63
65
|
puts "insert path .."
|
64
|
-
insert_into_file
|
66
|
+
insert_into_file settings_path, after: "module Rstt\n" do
|
65
67
|
" TT_HOME = \"#{path}\"\n"
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
69
71
|
def remove
|
70
72
|
puts "removing old .."
|
71
|
-
gsub_file
|
73
|
+
gsub_file settings_path, /^ TT_HOME = (.+)\n/ do |match|
|
72
74
|
match = ""
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
76
78
|
def get_path
|
77
79
|
path = ""
|
78
|
-
gsub_file
|
80
|
+
gsub_file settings_path, /^ TT_HOME = (.+)\n/ do |match|
|
79
81
|
path = match
|
80
82
|
end
|
81
83
|
path.chomp.split(" = ").last.gsub("\"",'')
|
@@ -87,6 +89,10 @@ class Config < Thor
|
|
87
89
|
yield file
|
88
90
|
end
|
89
91
|
end
|
92
|
+
|
93
|
+
def settings_path
|
94
|
+
File.join(File.dirname(__FILE__), '..','rstt','tt_settings.rb')
|
95
|
+
end
|
90
96
|
end
|
91
97
|
|
92
|
-
|
98
|
+
Configure.start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rstt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70266634468060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70266634468060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yard
|
27
|
-
requirement: &
|
27
|
+
requirement: &70266634464660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70266634464660
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: syntax
|
38
|
-
requirement: &
|
38
|
+
requirement: &70266634462560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70266634462560
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: thor
|
49
|
-
requirement: &
|
49
|
+
requirement: &70266634456440 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70266634456440
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: active_support
|
60
|
-
requirement: &
|
60
|
+
requirement: &70266634452940 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70266634452940
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: celluloid
|
71
|
-
requirement: &
|
71
|
+
requirement: &70266634451840 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70266634451840
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: slop
|
82
|
-
requirement: &
|
82
|
+
requirement: &70266634450540 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70266634450540
|
91
91
|
description: another ruby wrapper for Stuttgarter Tree Tagger
|
92
92
|
email:
|
93
93
|
- pscholz.le@gmail.com
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- lib/rstt/preprocess.rb
|
110
110
|
- lib/rstt/tt_settings.rb
|
111
111
|
- lib/rstt/version.rb
|
112
|
-
- lib/tasks/
|
112
|
+
- lib/tasks/configure.rb
|
113
113
|
- rstt.gemspec
|
114
114
|
- spec/rstt_preprocessing_spec.rb
|
115
115
|
- spec/rstt_spec.rb
|