opener-constituent-parser-base 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/constituent-parser-en +3 -1
- data/bin/constituent-parser-es +5 -1
- data/bin/constituent-parser-fr +3 -1
- data/bin/constituent-parser-it +3 -1
- data/core/target/ehu-parse-1.0.jar +0 -0
- data/lib/opener/constituent_parsers/base.rb +17 -11
- data/lib/opener/constituent_parsers/base/version.rb +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cea461781745e066d66b104bdcfe5c5d53dd866
|
4
|
+
data.tar.gz: f862a286290a066bb2772a11c1ba295811331818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7bee1ad41b8e61aeb00e16a738f92ae9cedd852a5b76460f7af1d8d6d7fff1850383c535b273a5f2e633dd681d7c2c1b5766b08c63969b9a5afbe9179d83c07
|
7
|
+
data.tar.gz: 865bd41ff6d1e40954ea77b7bc4eefbca4848d3049379ece341eae0d3b1644a3b45c03b3150c944aa584fe3a73bb8944f1c100d02fc47d37e283d7606bfe47e6
|
data/bin/constituent-parser-en
CHANGED
data/bin/constituent-parser-es
CHANGED
data/bin/constituent-parser-fr
CHANGED
data/bin/constituent-parser-it
CHANGED
Binary file
|
@@ -31,6 +31,8 @@ module Opener
|
|
31
31
|
# @return [String]
|
32
32
|
#
|
33
33
|
DEFAULT_LANGUAGE = 'en'.freeze
|
34
|
+
|
35
|
+
ACCEPTED_LANGUAGES = ['en', 'es', 'it', 'fr'].freeze
|
34
36
|
|
35
37
|
##
|
36
38
|
# Hash containing the default options to use.
|
@@ -64,20 +66,24 @@ module Opener
|
|
64
66
|
# @return [Array]
|
65
67
|
#
|
66
68
|
def run(input)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
if ACCEPTED_LANGUAGES.include?(language)
|
70
|
+
input = StringIO.new(input) unless input.kind_of?(IO)
|
71
|
+
annotator = Java::ehu.parse.Annotate.new(language)
|
72
|
+
reader = InputStreamReader.new(input.to_inputstream)
|
73
|
+
kaf = KAFDocument.create_from_stream(reader)
|
74
|
+
kaf.add_linguistic_processor("constituents","ehu-parse-"+language,"now","1.0")
|
72
75
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
if heads?
|
77
|
+
head_finder = CollinsHeadFinder.new(language)
|
78
|
+
annotator.parseWithHeads(kaf, head_finder)
|
79
|
+
else
|
80
|
+
annotator.parse(kaf)
|
81
|
+
end
|
82
|
+
|
83
|
+
return kaf.to_string
|
76
84
|
else
|
77
|
-
|
85
|
+
return input
|
78
86
|
end
|
79
|
-
|
80
|
-
return kaf.to_string
|
81
87
|
end
|
82
88
|
#
|
83
89
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-constituent-parser-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
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-05-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opener-build-tools
|
@@ -69,22 +69,22 @@ dependencies:
|
|
69
69
|
description: Constituent parser that supports various languages.
|
70
70
|
email:
|
71
71
|
executables:
|
72
|
-
- constituent-parser-fr
|
73
72
|
- constituent-parser-en
|
74
73
|
- constituent-parser-es
|
74
|
+
- constituent-parser-fr
|
75
75
|
- constituent-parser-it
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
|
-
- core/target/ehu-parse-1.0.jar
|
80
|
-
- lib/opener/constituent_parsers/base.rb
|
81
|
-
- lib/opener/constituent_parsers/base/version.rb
|
82
|
-
- opener-constituent-parser-base.gemspec
|
83
79
|
- README.md
|
84
|
-
- bin/constituent-parser-fr
|
85
80
|
- bin/constituent-parser-en
|
86
81
|
- bin/constituent-parser-es
|
82
|
+
- bin/constituent-parser-fr
|
87
83
|
- bin/constituent-parser-it
|
84
|
+
- core/target/ehu-parse-1.0.jar
|
85
|
+
- lib/opener/constituent_parsers/base.rb
|
86
|
+
- lib/opener/constituent_parsers/base/version.rb
|
87
|
+
- opener-constituent-parser-base.gemspec
|
88
88
|
homepage:
|
89
89
|
licenses: []
|
90
90
|
metadata: {}
|
@@ -104,9 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.2.2
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Constituent parser that supports various languages.
|
111
111
|
test_files: []
|
112
|
-
has_rdoc: yard
|