opener-constituent-parser-de 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +41 -0
  3. data/bin/constituent-parser-de +8 -0
  4. data/core/convert_penn_to_kaf.py +127 -0
  5. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO +10 -0
  6. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt +7 -0
  7. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt +1 -0
  8. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt +11 -0
  9. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt +1 -0
  10. data/core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py +161 -0
  11. data/core/site-packages/pre_build/VUKafParserPy/KafParserMod.py +326 -0
  12. data/core/site-packages/pre_build/VUKafParserPy/__init__.py +7 -0
  13. data/core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/PKG-INFO +10 -0
  14. data/core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/SOURCES.txt +6 -0
  15. data/core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/dependency_links.txt +1 -0
  16. data/core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/installed-files.txt +19 -0
  17. data/core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/top_level.txt +1 -0
  18. data/core/site-packages/pre_build/VUSentimentLexicon/DE-lexicon/Sentiment-German-HotelDomain.xml +12847 -0
  19. data/core/site-packages/pre_build/VUSentimentLexicon/DE-lexicon/germanLex.txt +8883 -0
  20. data/core/site-packages/pre_build/VUSentimentLexicon/EN-lexicon/Sentiment-English-HotelDomain.xml +28197 -0
  21. data/core/site-packages/pre_build/VUSentimentLexicon/EN-lexicon/Sentiment-English-general.xml +73998 -0
  22. data/core/site-packages/pre_build/VUSentimentLexicon/ES-lexicon/es-sentiment_lexicon.lmf +106035 -0
  23. data/core/site-packages/pre_build/VUSentimentLexicon/FR-lexicon/fr-sentiment_lexicon-old.lmf +232008 -0
  24. data/core/site-packages/pre_build/VUSentimentLexicon/FR-lexicon/fr-sentiment_lexicon.lmf +141651 -0
  25. data/core/site-packages/pre_build/VUSentimentLexicon/IT-lexicon/it-sentiment_lexicon.lmf +200790 -0
  26. data/core/site-packages/pre_build/VUSentimentLexicon/LexiconMod.py +137 -0
  27. data/core/site-packages/pre_build/VUSentimentLexicon/NL-lexicon/Sentiment-Dutch-HotelDomain.xml +15007 -0
  28. data/core/site-packages/pre_build/VUSentimentLexicon/NL-lexicon/Sentiment-Dutch-general.xml +83143 -0
  29. data/core/site-packages/pre_build/VUSentimentLexicon/__init__.py +5 -0
  30. data/core/stanford_parser_de.py +142 -0
  31. data/core/tree.py +1438 -0
  32. data/core/vendor/stanford-parser/stanford-parser-2.0.5-models.jar +0 -0
  33. data/core/vendor/stanford-parser/stanford-parser.jar +0 -0
  34. data/ext/hack/Rakefile +13 -0
  35. data/ext/hack/support.rb +50 -0
  36. data/lib/opener/constituent_parsers/de.rb +100 -0
  37. data/lib/opener/constituent_parsers/de/version.rb +7 -0
  38. data/opener-constituent-parser-de.gemspec +34 -0
  39. data/pre_build_requirements.txt +1 -0
  40. data/pre_install_requirements.txt +1 -0
  41. metadata +139 -0
@@ -0,0 +1,13 @@
1
+ require 'rake'
2
+ require_relative 'support'
3
+
4
+ desc 'Verifies the requirements'
5
+ task :requirements do
6
+ verify_requirements
7
+ end
8
+
9
+ task :default => :requirements do
10
+ path = File.join(PYTHON_SITE_PACKAGES, 'pre_install')
11
+
12
+ pip_install(PRE_INSTALL_REQUIREMENTS, path)
13
+ end
@@ -0,0 +1,50 @@
1
+ require 'opener/build-tools'
2
+
3
+ include Opener::BuildTools::Requirements
4
+ include Opener::BuildTools::Python
5
+ include Opener::BuildTools::Files
6
+
7
+ # Directory where packages will be installed to.
8
+ PYTHON_SITE_PACKAGES = File.expand_path(
9
+ '../../../core/site-packages',
10
+ __FILE__
11
+ )
12
+
13
+ # Directory containing the temporary files.
14
+ TMP_DIRECTORY = File.expand_path('../../../tmp', __FILE__)
15
+
16
+ # Path to the pip requirements file used to install requirements before
17
+ # packaging the Gem.
18
+ PRE_BUILD_REQUIREMENTS = File.expand_path(
19
+ '../../../pre_build_requirements.txt',
20
+ __FILE__
21
+ )
22
+
23
+ # Path to the pip requirements file used to install requirements upon Gem
24
+ # installation.
25
+ PRE_INSTALL_REQUIREMENTS = File.expand_path(
26
+ '../../../pre_install_requirements.txt',
27
+ __FILE__
28
+ )
29
+
30
+ # Path to the directory containing the Stanford parser files.
31
+ STANFORD_DIRECTORY = File.expand_path(
32
+ '../../../core/vendor/stanford-parser',
33
+ __FILE__
34
+ )
35
+
36
+ # Name of the Stanford zip archive.
37
+ STANFORD_ARCHIVE = 'stanford-parser-2013-04-05.zip'
38
+
39
+ # URL to the zip archive of the Stanford parser.
40
+ STANFORD_ARCHIVE_URL = "http://nlp.stanford.edu/software/#{STANFORD_ARCHIVE}"
41
+
42
+ ##
43
+ # Verifies the requirements to install thi Gem.
44
+ #
45
+ def verify_requirements
46
+ require_executable('python')
47
+ require_version('python', python_version, '2.7.0')
48
+ require_executable('pip')
49
+ require_version('pip', pip_version, '1.3.1')
50
+ end
@@ -0,0 +1,100 @@
1
+ require 'open3'
2
+
3
+ require_relative 'de/version'
4
+
5
+ module Opener
6
+ module ConstituentParsers
7
+ ##
8
+ # Constituent parser kernel for the German language.
9
+ #
10
+ # @!attribute [r] args
11
+ # @return [Array]
12
+ # @!attribute [r] options
13
+ # @return [Hash]
14
+ #
15
+ class DE
16
+ attr_reader :args, :options
17
+
18
+ ##
19
+ # Hash containing the default options to use.
20
+ #
21
+ # @return [Hash]
22
+ #
23
+ DEFAULT_OPTIONS = {
24
+ :args => []
25
+ }.freeze
26
+
27
+ ##
28
+ # @param [Hash] options
29
+ #
30
+ # @option options [Array] :args The commandline arguments to pass to the
31
+ # underlying Python code.
32
+ #
33
+ # @see Opener::ConstituentParsers::DEFAULT_OPTIONS
34
+ #
35
+ def initialize(options = {})
36
+ options = DEFAULT_OPTIONS.merge(options)
37
+ @args = options.delete(:args) || []
38
+ @options = options
39
+ end
40
+
41
+ ##
42
+ # Builds the command used to execute the kernel.
43
+ #
44
+ # @return [String]
45
+ #
46
+ def command
47
+ return "python -E -O #{kernel} #{args.join(' ')}"
48
+ end
49
+
50
+ ##
51
+ # Runs the command and returns the output of STDOUT, STDERR and the
52
+ # process information.
53
+ #
54
+ # @param [String] input The input to process.
55
+ # @return [Array]
56
+ #
57
+ def run(input)
58
+ unless File.file?(kernel)
59
+ raise "The Python kernel (#{kernel}) does not exist"
60
+ end
61
+
62
+ return Open3.capture3(command, :stdin_data => input)
63
+ end
64
+
65
+ ##
66
+ # Runs the command and takes care of error handling/aborting based on the
67
+ # output.
68
+ #
69
+ # @see #run
70
+ #
71
+ def run!(input)
72
+ stdout, stderr, process = run(input)
73
+
74
+ if process.success?
75
+ puts stdout
76
+
77
+ STDERR.puts(stderr) unless stderr.empty?
78
+ else
79
+ abort stderr
80
+ end
81
+ end
82
+
83
+ protected
84
+
85
+ ##
86
+ # @return [String]
87
+ #
88
+ def core_dir
89
+ return File.expand_path('../../../../core', __FILE__)
90
+ end
91
+
92
+ ##
93
+ # @return [String]
94
+ #
95
+ def kernel
96
+ return File.join(core_dir, 'stanford_parser_de.py')
97
+ end
98
+ end # DE
99
+ end # ConstituentParsers
100
+ end # Opener
@@ -0,0 +1,7 @@
1
+ module Opener
2
+ module ConstituentParsers
3
+ class DE
4
+ VERSION = '1.0.0'
5
+ end # DE
6
+ end # ConstituentParsers
7
+ end # Opener
@@ -0,0 +1,34 @@
1
+ require File.expand_path(
2
+ '../lib/opener/constituent_parsers/de/version',
3
+ __FILE__
4
+ )
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'opener-constituent-parser-de'
8
+ gem.version = Opener::ConstituentParsers::DE::VERSION
9
+ gem.authors = ['development@olery.com']
10
+ gem.summary = 'Constituent parser for the German language'
11
+ gem.description = gem.summary
12
+ gem.has_rdoc = 'yard'
13
+
14
+ gem.required_ruby_version = '>= 1.9.2'
15
+
16
+ gem.files = Dir.glob([
17
+ 'core/site-packages/pre_build/**/*',
18
+ 'core/vendor/**/*',
19
+ 'core/*.py',
20
+ 'ext/**/*',
21
+ 'lib/**/*',
22
+ '*.gemspec',
23
+ '*_requirements.txt',
24
+ 'README.md'
25
+ ]).select { |f| File.file?(f) }
26
+
27
+ gem.executables = Dir.glob('bin/*').map { |f| File.basename(f) }
28
+
29
+ gem.add_dependency 'opener-build-tools', ['>= 0.2.7']
30
+
31
+ gem.add_development_dependency 'rspec'
32
+ gem.add_development_dependency 'cucumber'
33
+ gem.add_development_dependency 'rake'
34
+ end
@@ -0,0 +1 @@
1
+ git+ssh://git@github.com/opener-project/VU-kaf-parser.git#egg=VUKafParserPy
@@ -0,0 +1 @@
1
+ lxml
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opener-constituent-parser-de
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - development@olery.com
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-19 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: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
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: cucumber
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
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: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Constituent parser for the German language
70
+ email:
71
+ executables:
72
+ - constituent-parser-de
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - README.md
77
+ - bin/constituent-parser-de
78
+ - core/convert_penn_to_kaf.py
79
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO
80
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt
81
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt
82
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt
83
+ - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt
84
+ - core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py
85
+ - core/site-packages/pre_build/VUKafParserPy/KafParserMod.py
86
+ - core/site-packages/pre_build/VUKafParserPy/__init__.py
87
+ - core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/PKG-INFO
88
+ - core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/SOURCES.txt
89
+ - core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/dependency_links.txt
90
+ - core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/installed-files.txt
91
+ - core/site-packages/pre_build/VUSentimentLexicon-1.0-py2.7.egg-info/top_level.txt
92
+ - core/site-packages/pre_build/VUSentimentLexicon/DE-lexicon/Sentiment-German-HotelDomain.xml
93
+ - core/site-packages/pre_build/VUSentimentLexicon/DE-lexicon/germanLex.txt
94
+ - core/site-packages/pre_build/VUSentimentLexicon/EN-lexicon/Sentiment-English-HotelDomain.xml
95
+ - core/site-packages/pre_build/VUSentimentLexicon/EN-lexicon/Sentiment-English-general.xml
96
+ - core/site-packages/pre_build/VUSentimentLexicon/ES-lexicon/es-sentiment_lexicon.lmf
97
+ - core/site-packages/pre_build/VUSentimentLexicon/FR-lexicon/fr-sentiment_lexicon-old.lmf
98
+ - core/site-packages/pre_build/VUSentimentLexicon/FR-lexicon/fr-sentiment_lexicon.lmf
99
+ - core/site-packages/pre_build/VUSentimentLexicon/IT-lexicon/it-sentiment_lexicon.lmf
100
+ - core/site-packages/pre_build/VUSentimentLexicon/LexiconMod.py
101
+ - core/site-packages/pre_build/VUSentimentLexicon/NL-lexicon/Sentiment-Dutch-HotelDomain.xml
102
+ - core/site-packages/pre_build/VUSentimentLexicon/NL-lexicon/Sentiment-Dutch-general.xml
103
+ - core/site-packages/pre_build/VUSentimentLexicon/__init__.py
104
+ - core/stanford_parser_de.py
105
+ - core/tree.py
106
+ - core/vendor/stanford-parser/stanford-parser-2.0.5-models.jar
107
+ - core/vendor/stanford-parser/stanford-parser.jar
108
+ - ext/hack/Rakefile
109
+ - ext/hack/support.rb
110
+ - lib/opener/constituent_parsers/de.rb
111
+ - lib/opener/constituent_parsers/de/version.rb
112
+ - opener-constituent-parser-de.gemspec
113
+ - pre_build_requirements.txt
114
+ - pre_install_requirements.txt
115
+ homepage:
116
+ licenses: []
117
+ metadata: {}
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 1.9.2
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ requirements: []
133
+ rubyforge_project:
134
+ rubygems_version: 2.2.2
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: Constituent parser for the German language
138
+ test_files: []
139
+ has_rdoc: yard