open-nlp 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,9 +6,9 @@ This library provides high-level Ruby bindings to the Open NLP package, a Java m
6
6
 
7
7
  ###Installing
8
8
 
9
- First, install the gem: `gem install open-nlp`. Then, individually download the appropriate models from the [open-nlp website](http://opennlp.sourceforge.net/models-1.5/) or just get [all English language models](louismullie.com/treat/open-nlp-english.zip) in one package (80 MB).
9
+ First, install the gem: `gem install open-nlp`. Then, download [the JARs and English language models](http://louismullie.com/treat/open-nlp-english.zip) in one package (80 MB).
10
10
 
11
- Place the contents of the extracted archive inside the /bin/ folder of the open-nlp gem (e.g. [...]/gems/open-nlp-0.x.x/bin/).
11
+ Place the contents of the extracted archive inside the /bin/ folder of the `open-nlp` gem (e.g. [...]/gems/open-nlp-0.x.x/bin/).
12
12
 
13
13
  Alternatively, from a terminal window, `cd` to the gem's folder and run:
14
14
 
@@ -17,6 +17,8 @@ wget http://www.louismullie.com/treat/open-nlp-english.zip
17
17
  unzip -o open-nlp-english.zip -d bin/
18
18
  ```
19
19
 
20
+ Afterwards, you may individually download the appropriate models for other languages from the [open-nlp website](http://opennlp.sourceforge.net/models-1.5/).
21
+
20
22
  ###Configuring
21
23
 
22
24
  After installing and requiring the gem (`require 'open-nlp'`), you may want to set some of the following configuration options.
Binary file
@@ -0,0 +1,107 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <!--
4
+ Licensed to the Apache Software Foundation (ASF) under one
5
+ or more contributor license agreements. See the NOTICE file
6
+ distributed with this work for additional information
7
+ regarding copyright ownership. The ASF licenses this file
8
+ to you under the Apache License, Version 2.0 (the
9
+ "License"); you may not use this file except in compliance
10
+ with the License. You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing,
15
+ software distributed under the License is distributed on an
16
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ KIND, either express or implied. See the License for the
18
+ specific language governing permissions and limitations
19
+ under the License.
20
+ -->
21
+
22
+ <dictionary>
23
+ <entry operation="RIGHT_LEFT_MATCHING">
24
+ <token>"</token>
25
+ </entry>
26
+ <entry operation="RIGHT_LEFT_MATCHING">
27
+ <token>'</token>
28
+ </entry>
29
+ <entry operation="MOVE_LEFT">
30
+ <token>.</token>
31
+ </entry>
32
+ <entry operation="MOVE_LEFT">
33
+ <token>?</token>
34
+ </entry>
35
+ <entry operation="MOVE_LEFT">
36
+ <token>!</token>
37
+ </entry>
38
+ <entry operation="MOVE_LEFT">
39
+ <token>,</token>
40
+ </entry>
41
+ <entry operation="MOVE_LEFT">
42
+ <token>;</token>
43
+ </entry>
44
+ <entry operation="MOVE_LEFT">
45
+ <token>:</token>
46
+ </entry>
47
+ <entry operation="MOVE_RIGHT">
48
+ <token>(</token>
49
+ </entry>
50
+ <entry operation="MOVE_LEFT">
51
+ <token>)</token>
52
+ </entry>
53
+ <entry operation="MOVE_LEFT">
54
+ <token>}</token>
55
+ </entry>
56
+ <entry operation="MOVE_RIGHT">
57
+ <token>{</token>
58
+ </entry>
59
+ <entry operation="MOVE_LEFT">
60
+ <token>]</token>
61
+ </entry>
62
+ <entry operation="MOVE_RIGHT">
63
+ <token>[</token>
64
+ </entry>
65
+ <entry operation="MOVE_RIGHT">
66
+ <token>``</token>
67
+ </entry>
68
+ <entry operation="MOVE_LEFT">
69
+ <token>''</token>
70
+ </entry>
71
+ <entry operation="MOVE_LEFT">
72
+ <token>%</token>
73
+ </entry>
74
+ <entry operation="MOVE_LEFT">
75
+ <token>n't</token>
76
+ </entry>
77
+ <entry operation="MOVE_LEFT">
78
+ <token>'ve</token>
79
+ </entry>
80
+ <entry operation="MOVE_LEFT">
81
+ <token>'d</token>
82
+ </entry>
83
+ <entry operation="MOVE_LEFT">
84
+ <token>'ll</token>
85
+ </entry>
86
+ <entry operation="MOVE_LEFT">
87
+ <token>'s</token>
88
+ </entry>
89
+ <entry operation="MOVE_LEFT">
90
+ <token>'re</token>
91
+ </entry>
92
+ <entry operation="MOVE_LEFT">
93
+ <token>'m</token>
94
+ </entry>
95
+ <entry operation="MOVE_LEFT">
96
+ <token>.org</token>
97
+ </entry>
98
+ <entry operation="MOVE_LEFT">
99
+ <token>.com</token>
100
+ </entry>
101
+ <entry operation="MOVE_LEFT">
102
+ <token>.net</token>
103
+ </entry>
104
+ <entry operation="MOVE_RIGHT">
105
+ <token>#</token>
106
+ </entry>
107
+ </dictionary>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,7 +1,7 @@
1
1
  module OpenNLP
2
2
 
3
3
  # Library version.
4
- VERSION = '0.1.4'
4
+ require 'open-nlp/version'
5
5
 
6
6
  # Require Java bindings.
7
7
  require 'open-nlp/bindings'
@@ -32,4 +32,4 @@ module OpenNLP
32
32
  OpenNLP::Bindings.send(sym, *args, &block)
33
33
  end
34
34
 
35
- end
35
+ end
@@ -7,13 +7,13 @@ class OpenNLP::SimpleTokenizer < OpenNLP::Base; end
7
7
  class OpenNLP::TokenizerME < OpenNLP::Base; end
8
8
 
9
9
  class OpenNLP::POSTaggerME < OpenNLP::Base
10
-
10
+
11
11
  unless RUBY_PLATFORM =~ /java/
12
12
  def tag(*args)
13
- OpenNLP::Bindings::Utils.tagWithArrayList(@proxy_inst, args[0])
13
+ @proxy_inst._invoke("tag", "[Ljava.lang.String;", args[0])
14
14
  end
15
15
  end
16
-
16
+
17
17
  end
18
18
 
19
19
  class OpenNLP::ChunkerME < OpenNLP::Base
@@ -33,7 +33,7 @@ class OpenNLP::ChunkerME < OpenNLP::Base
33
33
  else
34
34
 
35
35
  def chunk(tokens, tags)
36
- chunks = OpenNLP::Bindings::Utils.chunkWithArrays(@proxy_inst, tokens,tags)
36
+ chunks = @proxy_inst._invoke("chunk", "[Ljava.lang.String;[Ljava.lang.String;", tokens, tags)
37
37
  chunks.map { |c| c.to_s }
38
38
  end
39
39
 
@@ -70,8 +70,7 @@ end
70
70
  class OpenNLP::NameFinderME < OpenNLP::Base
71
71
  unless RUBY_PLATFORM =~ /java/
72
72
  def find(*args)
73
- OpenNLP::Bindings::Utils
74
- .findWithArrayList(@proxy_inst, args[0])
73
+ @proxy_inst._invoke("find", "[Ljava.lang.String;", args[0])
75
74
  end
76
75
  end
77
76
  end
@@ -0,0 +1,3 @@
1
+ module OpenNLP
2
+ VERSION = '0.1.5'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open-nlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-26 00:00:00.000000000 Z
12
+ date: 2014-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bind-it
@@ -51,12 +51,32 @@ executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
+ - bin/en-chunker.bin
55
+ - bin/en-detokenizer.xml
56
+ - bin/en-ner-date.bin
57
+ - bin/en-ner-location.bin
58
+ - bin/en-ner-money.bin
59
+ - bin/en-ner-organization.bin
60
+ - bin/en-ner-percentage.bin
61
+ - bin/en-ner-person.bin
62
+ - bin/en-ner-time.bin
63
+ - bin/en-parser-chunking.bin
64
+ - bin/en-pos-maxent.bin
65
+ - bin/en-pos-perceptron.bin
66
+ - bin/en-sent.bin
67
+ - bin/en-token.bin
68
+ - bin/jwnl-1.3.3.jar
69
+ - bin/open-nlp-english2.zip
70
+ - bin/opennlp-maxent-3.0.2-incubating.jar
71
+ - bin/opennlp-tools-1.5.2-incubating.jar
72
+ - bin/opennlp-uima-1.5.2-incubating.jar
54
73
  - bin/utils.jar
55
74
  - bin/Utils.java
56
75
  - lib/open-nlp/base.rb
57
76
  - lib/open-nlp/bindings.rb
58
77
  - lib/open-nlp/classes.rb
59
78
  - lib/open-nlp/config.rb
79
+ - lib/open-nlp/version.rb
60
80
  - lib/open-nlp.rb
61
81
  - spec/english_spec.rb
62
82
  - spec/sample.txt
@@ -83,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
103
  version: '0'
84
104
  requirements: []
85
105
  rubyforge_project:
86
- rubygems_version: 1.8.24
106
+ rubygems_version: 1.8.25
87
107
  signing_key:
88
108
  specification_version: 3
89
109
  summary: Ruby bindings to the OpenNLP Java toolkit.