opener-pos-tagger-fr 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f475080332107b2fd90c50078811f5987e2d931c
4
+ data.tar.gz: c134d6658d70777e5e93fb399cb0be48f9c964c2
5
+ SHA512:
6
+ metadata.gz: a9ef3b74a990e5210c2be9e881a65445d83a1d21c649ac02fd594e599da0a481186d94d83fe019d169f274cc7bd09f1c2796794c47a92c0f6d9a8139beab9eea
7
+ data.tar.gz: b45d9f1100e485411cef605486e47f4fef7fb1161b83116cf2d0803ba5b06e324d4f46520244c2ae1736c041e27f406fd0b5fd94b19b5ea4759862aba67f4fb1
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ [![Build Status](https://drone.io/github.com/opener-project/pos-tagger-fr/status.png)](https://drone.io/github.com/opener-project/pos-tagger-fr/latest)
2
+
3
+ # French POS Tagger
4
+
5
+ This repository contains the source code for the French POS tagger of the
6
+ OpeNER project.
7
+
8
+ ## Requirements
9
+
10
+ * Java 1.7 or newer
11
+ * Ruby 1.9.2 or newer
12
+ * Maven
13
+ * Bundler
14
+
15
+ ## Installation
16
+
17
+ Using RubyGems:
18
+
19
+ gem install opener-pos-tagger-fr
20
+
21
+ Using Bundler:
22
+
23
+ gem 'opener-pos-tagger-fr',
24
+ :git => 'git@github.com/opener-project/pos-tagger-fr.git',
25
+ :branch => 'master'
26
+
27
+ Using specific install:
28
+
29
+ gem install specific_install
30
+ gem specific_install opener-pos-tagger-fr \
31
+ -l https://github.com/opener-project/pos-tagger-fr.git
32
+
33
+ ## Usage
34
+
35
+ cat some_input_file.kaf | pos-tagger-fr
36
+
37
+ ## Contributing
38
+
39
+ First make sure all the required dependencies are installed:
40
+
41
+ bundle install
42
+
43
+ Then compile the required Java code:
44
+
45
+ bundle exec rake java:compile
46
+
47
+ For this you'll need to have Java 1.7 and Maven installed. These requirements
48
+ are verified for you before the Rake task calls Maven.
49
+
50
+ ## Testing
51
+
52
+ To run the tests (which are powered by Cucumber), simply run the following:
53
+
54
+ bundle exec rake
55
+
56
+ This will take care of verifying the requirements, installing the required Java
57
+ packages and running the tests.
58
+
59
+ For more information on the available Rake tasks run the following:
60
+
61
+ bundle exec rake -T
62
+
63
+ ## Structure
64
+
65
+ This repository comes in two parts: a collection of Java source files and Ruby
66
+ source files. The Java code can be found in the `core/` directory, everything
67
+ else will be Ruby source code.
data/bin/pos-tagger-fr ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/opener/pos_taggers/fr'
4
+
5
+ # STDIN.tty? returns `false` if data is being piped into the current process.
6
+ if STDIN.tty?
7
+ input = nil
8
+ else
9
+ input = STDIN.read
10
+ end
11
+
12
+ kernel = Opener::POSTaggers::FR.new(:args => ARGV)
13
+ stdout, stderr, process = kernel.run(input)
14
+
15
+ if process.success?
16
+ puts stdout
17
+
18
+ STDERR.puts(stderr) unless stderr.empty?
19
+ else
20
+ abort stderr
21
+ end
@@ -0,0 +1,81 @@
1
+ require 'open3'
2
+ require_relative 'fr/version'
3
+
4
+ module Opener
5
+ module POSTaggers
6
+ ##
7
+ # The POS tagger that supports French.
8
+ #
9
+ # @!attribute [r] args
10
+ # @return [Array]
11
+ # @!attribute [r] options
12
+ # @return [Hash]
13
+ #
14
+ class FR
15
+ attr_reader :args, :options
16
+
17
+ ##
18
+ # @param [Hash] options
19
+ #
20
+ # @option options [Array] :args The commandline arguments to pass to the
21
+ # underlying Python script.
22
+ #
23
+ def initialize(options = {})
24
+ @args = options.delete(:args) || []
25
+ @options = options
26
+ end
27
+
28
+ ##
29
+ # Builds the command used to execute the kernel.
30
+ #
31
+ # @return [String]
32
+ #
33
+ def command
34
+ "java -jar #{kernel} -l #{lang} #{args.join(' ')}"
35
+ end
36
+
37
+ ##
38
+ # Runs the command and returns the output of STDOUT, STDERR and the
39
+ # process information.
40
+ #
41
+ # @param [String] input The input to tag.
42
+ # @return [Array]
43
+ #
44
+ def run(input)
45
+ return Open3.capture3(command, :stdin_data => input)
46
+ end
47
+
48
+ protected
49
+
50
+ ##
51
+ # @return [String]
52
+ #
53
+ def core_dir
54
+ File.expand_path("../../../core", File.dirname(__FILE__))
55
+ end
56
+
57
+ ##
58
+ # @return [String]
59
+ #
60
+ def kernel
61
+ core_dir+'/target/Vicom-postagger_FR-0.9.jar'
62
+ end
63
+
64
+ def lang
65
+ 'fr'
66
+ end
67
+
68
+ end # FR
69
+ end # POSTaggers
70
+ end # Opener
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
@@ -0,0 +1,7 @@
1
+ module Opener
2
+ module POSTaggers
3
+ class FR
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,27 @@
1
+ require File.expand_path('../lib/opener/pos_taggers/fr/version', __FILE__)
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "opener-pos-tagger-fr"
5
+ gem.version = Opener::POSTaggers::FR::VERSION
6
+ gem.authors = ["development@olery.com"]
7
+ gem.summary = "POS tagging for french"
8
+ gem.description = gem.summary
9
+ gem.homepage = "http://opener-project.github.com/"
10
+ gem.has_rdoc = "yard"
11
+ gem.required_ruby_version = ">= 1.9.2"
12
+
13
+ gem.files = Dir.glob([
14
+ 'core/target/Vicom-postagger_FR-*.jar',
15
+ 'lib/**/*',
16
+ '*.gemspec',
17
+ 'README.md'
18
+ ]).select { |file| File.file?(file) }
19
+
20
+ gem.executables = Dir.glob('bin/*').map { |file| File.basename(file) }
21
+
22
+ gem.add_dependency 'opener-build-tools'
23
+
24
+ gem.add_development_dependency 'rspec'
25
+ gem.add_development_dependency 'cucumber'
26
+ gem.add_development_dependency 'rake'
27
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opener-pos-tagger-fr
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-20 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
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: POS tagging for french
70
+ email:
71
+ executables:
72
+ - pos-tagger-fr
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - README.md
77
+ - bin/pos-tagger-fr
78
+ - core/target/Vicom-postagger_FR-0.9.jar
79
+ - lib/opener/pos_taggers/fr.rb
80
+ - lib/opener/pos_taggers/fr/version.rb
81
+ - opener-pos-tagger-fr.gemspec
82
+ homepage: http://opener-project.github.com/
83
+ licenses: []
84
+ metadata: {}
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: 1.9.2
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.2.2
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: POS tagging for french
105
+ test_files: []
106
+ has_rdoc: yard