mitie 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea3ef115016c59ecb496ffbbe13c4ac3a2ffda6acf9392ac423103b9c3cfe634
4
- data.tar.gz: 6eb77dd514ba3c08c30e1216921cd83619f206a658018c1d4522c598e175e8b2
3
+ metadata.gz: 66bb5dce2b079310bd5da7da44a5836331f05bfbbb746163dc45d49094d24e58
4
+ data.tar.gz: a1e1ec8d23c639315f36f4e0e5e5ddfc0a08e1922fd0d774e302914f5974ab83
5
5
  SHA512:
6
- metadata.gz: 682fb3ea1c0be1889f2e1e177204309ea7b6d2989834a4d2bae49ddf567e309b9fef9ea872746626590ec06b9aabb455067d88e696ea3a4f59a9b785b43819c9
7
- data.tar.gz: 4260a6dff4eb613278468d9fff2ef19f99f49bed81571781b4d2ac886f39bed9356a4a20a9220fa2b31e8c12965bffac5e86b40318b28aa450ebd60a3c53c3cd
6
+ metadata.gz: c1914841e9c1fef8ac20c007595b8ed56def925710a75e4e74959496dfa9095a7e253212b560035df9c1c5138443b835a3fffe2cf7c5cf3a9a81135a62df6926
7
+ data.tar.gz: 397f5d45ca142b3d86fa44c65382fa57a64d9a6ea66ee51b6735d4ae5645cc5c01a4a99744b5fc565cea16d1616e251c9bfca2662b6aa1492d2dcf093a19f57e
@@ -1,3 +1,8 @@
1
+ ## 0.1.1 (2020-09-14)
2
+
3
+ - Added shared libraries
4
+ - Improved error message when model file does not exist
5
+
1
6
  ## 0.1.0 (2020-09-14)
2
7
 
3
8
  - First release
data/README.md CHANGED
@@ -2,13 +2,9 @@
2
2
 
3
3
  [MITIE](https://github.com/mit-nlp/MITIE) - named-entity recognition - for Ruby
4
4
 
5
- ## Installation
6
-
7
- First, install MITIE. For Homebrew, use:
5
+ [![Build Status](https://travis-ci.org/ankane/mitie.svg?branch=master)](https://travis-ci.org/ankane/mitie) [![Build status](https://ci.appveyor.com/api/projects/status/stc89tc57xfva451/branch/master?svg=true)](https://ci.appveyor.com/project/ankane/mitie/branch/master)
8
6
 
9
- ```sh
10
- brew install mitie
11
- ```
7
+ ## Installation
12
8
 
13
9
  Add this line to your application’s Gemfile:
14
10
 
@@ -89,5 +85,6 @@ To get started with development:
89
85
  git clone https://github.com/ankane/mitie.git
90
86
  cd mitie
91
87
  bundle install
88
+ bundle exec rake vendor:all
92
89
  MITIE_NER_PATH=path/to/ner_model.dat bundle exec rake test
93
90
  ```
@@ -11,14 +11,16 @@ module Mitie
11
11
  class << self
12
12
  attr_accessor :ffi_lib
13
13
  end
14
- self.ffi_lib =
14
+ lib_name =
15
15
  if Gem.win_platform?
16
- ["mitie.dll"]
16
+ "mitie.dll"
17
17
  elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
18
- ["libmitie.dylib"]
18
+ "libmitie.dylib"
19
19
  else
20
- ["libmitie.so"]
20
+ "libmitie.so"
21
21
  end
22
+ vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__)
23
+ self.ffi_lib = [vendor_lib]
22
24
 
23
25
  # friendlier error message
24
26
  autoload :FFI, "mitie/ffi"
@@ -1,6 +1,8 @@
1
1
  module Mitie
2
2
  class NER
3
3
  def initialize(path)
4
+ # better error message
5
+ raise ArgumentError, "Model file does not exist" unless File.exist?(path)
4
6
  @pointer = FFI.mitie_load_named_entity_extractor(path)
5
7
  ObjectSpace.define_finalizer(self, self.class.finalize(pointer))
6
8
  end
@@ -1,3 +1,3 @@
1
1
  module Mitie
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,23 @@
1
+ Boost Software License - Version 1.0 - August 17th, 2003
2
+
3
+ Permission is hereby granted, free of charge, to any person or organization
4
+ obtaining a copy of the software and accompanying documentation covered by
5
+ this license (the "Software") to use, reproduce, display, distribute,
6
+ execute, and transmit the Software, and to prepare derivative works of the
7
+ Software, and to permit third-parties to whom the Software is furnished to
8
+ do so, all subject to the following:
9
+
10
+ The copyright notices in the Software and this entire statement, including
11
+ the above license grant, this restriction and the following disclaimer,
12
+ must be included in all copies of the Software, in whole or in part, and
13
+ all derivative works of the Software, unless such copies or derivative
14
+ works are solely in the form of machine-executable object code generated by
15
+ a source language processor.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ DEALINGS IN THE SOFTWARE.
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -65,6 +65,10 @@ files:
65
65
  - lib/mitie/ffi.rb
66
66
  - lib/mitie/ner.rb
67
67
  - lib/mitie/version.rb
68
+ - vendor/LICENSE.txt
69
+ - vendor/libmitie.dylib
70
+ - vendor/libmitie.so
71
+ - vendor/mitie.dll
68
72
  homepage: https://github.com/ankane/mitie
69
73
  licenses:
70
74
  - BSL-1.0