opener-property-tagger 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,16 @@
1
+ require 'sinatra/base'
2
+ require 'httpclient'
3
+ require 'opener/webservice'
4
+
5
+ module Opener
6
+ class PropertyTagger
7
+ ##
8
+ # Property tagger server powered by Sinatra.
9
+ #
10
+ class Server < Webservice
11
+ set :views, File.expand_path('../views', __FILE__)
12
+ text_processor PropertyTagger
13
+ accepted_params :input
14
+ end # Server
15
+ end # PropertyTagger
16
+ end # Opener
@@ -0,0 +1,5 @@
1
+ module Opener
2
+ class PropertyTagger
3
+ VERSION = '2.0.1'
4
+ end # PropertyTagger
5
+ end # Opener
@@ -0,0 +1,97 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link type="text/css" rel="stylesheet" charset="UTF-8" href="markdown.css"/>
5
+ <title>Property Tagger Webservice</title>
6
+ </head>
7
+ <body>
8
+ <h1>Property Tagger Web Service</h1>
9
+
10
+ <h2>Example Usage</h2>
11
+
12
+ <p>
13
+ <pre>property-tagger-server start</pre>
14
+ <pre>cat input.kaf | property-tagger > output.kaf</pre>
15
+ </p>
16
+
17
+ <h2>Try the webservice</h2>
18
+
19
+ <p>* required</p>
20
+ <p>** When entering a value no response will be displayed in the browser.</p>
21
+
22
+ <form action="<%=url("/")%>" method="POST">
23
+ <div>
24
+ <label for="input"/>Type your text here*</label>
25
+ <br/>
26
+
27
+ <textarea name="input" id="text" rows="10" cols="50"/></textarea>
28
+ </div>
29
+
30
+ <% 10.times do |t| %>
31
+ <div>
32
+ <label for="callbacks">Callback URL <%=t+1%>(**)</label>
33
+ <br />
34
+
35
+ <input id="callbacks" type="text" name="callbacks[]" />
36
+ </div>
37
+ <% end %>
38
+
39
+
40
+ <div>
41
+ <label for="error_callback">Error Callback</label>
42
+ <br />
43
+
44
+ <input id="error_callback" type="text" name="error_callback" />
45
+ </div>
46
+ <input type="submit" value="Submit" />
47
+ </form>
48
+
49
+ <h2>Actions</h2>
50
+
51
+ <p>
52
+ <dl>
53
+ <dt>POST /</dt>
54
+ <dd>Tag the input tokenized text. See arguments listing for more options.</dd>
55
+ <dt>GET /</dt>
56
+ <dd>Show this page</dd>
57
+ </dl>
58
+ </p>
59
+
60
+ <h2>Arguments</h2>
61
+
62
+ <p> The webservice takes the following arguments: </p>
63
+ <p>* required</p>
64
+
65
+ <dl>
66
+ <dt>text*</dt>
67
+ <dd>The input text in KAF format. Sample KAF input:</dd>
68
+ <pre></pre>
69
+
70
+ <dt>callbacks</dt>
71
+ <dd>
72
+ You can provide a list of callback urls. If you provide callback urls
73
+ the POS tagger will run as a background job and a callback
74
+ with the results will be performed (POST) to the first url in the callback
75
+ list. The other urls in callback list will be provided in the "callbacks"
76
+ argument.<br/><br/>
77
+ Using callback you can chain together several OpeNER webservices in
78
+ one call. The first, will call the second, which will call the third, etc.
79
+ See for more information the <a href="http://opener-project.github.io">
80
+ webservice documentation online</a>.
81
+ </dd>
82
+ <dt>error_callback</dt>
83
+ <dd>URL to notify if errors occur in the background process. The error
84
+ callback will do a POST with the error message in the 'error' field.</dd>
85
+ </dt>
86
+
87
+
88
+
89
+ </dl>
90
+
91
+
92
+ <p>
93
+
94
+ </p>
95
+
96
+ </body>
97
+ </html>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link type="text/css" rel="stylesheet" charset="UTF-8" href="markdown.css"/>
5
+ <title>Property Tagger Webservice</title>
6
+ </head>
7
+ <body>
8
+ <h1>Output URL</h1>
9
+ <p>
10
+ When ready, you can view the result
11
+ <a href=<%= output_url %>>here</a>
12
+ </p>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,37 @@
1
+ require File.expand_path('../lib/opener/property_tagger/version', __FILE__)
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'opener-property-tagger'
5
+ gem.version = Opener::PropertyTagger::VERSION
6
+ gem.authors = ['development@olery.com']
7
+ gem.summary = 'Property tagger for hotels in Dutch and English.'
8
+ gem.description = gem.summary
9
+ gem.homepage = 'http://opener-project.github.com/'
10
+ gem.extensions = ['ext/hack/Rakefile']
11
+
12
+ gem.required_ruby_version = '>= 1.9.2'
13
+
14
+ gem.files = Dir.glob([
15
+ 'core/site-packages/pre_build/**/*',
16
+ #'core/data/**/*',
17
+ 'core/*',
18
+ 'ext/**/*',
19
+ 'lib/**/*',
20
+ 'config.ru',
21
+ '*.gemspec',
22
+ '*_requirements.txt',
23
+ 'README.md'
24
+ ]).select { |file| File.file?(file) }
25
+
26
+ gem.executables = Dir.glob('bin/*').map { |file| File.basename(file) }
27
+
28
+ gem.add_dependency 'opener-build-tools', ['>= 0.2.7']
29
+ gem.add_dependency 'rake'
30
+ gem.add_dependency 'sinatra'
31
+ gem.add_dependency 'httpclient'
32
+ gem.add_dependency 'puma'
33
+ gem.add_dependency 'opener-webservice'
34
+
35
+ gem.add_development_dependency 'rspec'
36
+ gem.add_development_dependency 'cucumber'
37
+ end
@@ -0,0 +1 @@
1
+ git+ssh://git@github.com/opener-project/VU-kaf-parser.git#egg=VUKafParserPy
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opener-property-tagger
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.1
5
+ platform: ruby
6
+ authors:
7
+ - development@olery.com
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: opener-build-tools
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.7
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sinatra
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: httpclient
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: puma
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: opener-webservice
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: cucumber
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Property tagger for hotels in Dutch and English.
126
+ email:
127
+ executables:
128
+ - property-tagger
129
+ - property-tagger-server
130
+ extensions:
131
+ - ext/hack/Rakefile
132
+ extra_rdoc_files: []
133
+ files:
134
+ - README.md
135
+ - bin/property-tagger
136
+ - bin/property-tagger-server
137
+ - config.ru
138
+ - core/extract_aspects.py
139
+ - core/hotel_property_tagger_nl_en.py
140
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO
141
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt
142
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt
143
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt
144
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt
145
+ - core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py
146
+ - core/site-packages/pre_build/VUKafParserPy/KafParserMod.py
147
+ - core/site-packages/pre_build/VUKafParserPy/__init__.py
148
+ - ext/hack/Rakefile
149
+ - ext/hack/support.rb
150
+ - lib/opener/property_tagger.rb
151
+ - lib/opener/property_tagger/cli.rb
152
+ - lib/opener/property_tagger/public/markdown.css
153
+ - lib/opener/property_tagger/server.rb
154
+ - lib/opener/property_tagger/version.rb
155
+ - lib/opener/property_tagger/views/index.erb
156
+ - lib/opener/property_tagger/views/result.erb
157
+ - opener-property-tagger.gemspec
158
+ - pre_build_requirements.txt
159
+ homepage: http://opener-project.github.com/
160
+ licenses: []
161
+ metadata: {}
162
+ post_install_message:
163
+ rdoc_options: []
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 1.9.2
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.2.2
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: Property tagger for hotels in Dutch and English.
182
+ test_files: []
183
+ has_rdoc: