grammar_police 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.DS_Store CHANGED
Binary file
data/README ADDED
@@ -0,0 +1 @@
1
+ grammar_police is a ruby wrapper for link-grammar-4.7.4
data/c/link-grammar.o CHANGED
Binary file
data/c/link-grammar.so CHANGED
Binary file
data/lib/.DS_Store CHANGED
Binary file
@@ -7,5 +7,6 @@ require 'grammar_police/parse_options'
7
7
 
8
8
  module GrammarPolice
9
9
  #set dictionary path based on the installed gem path
10
- GrammarPolice::Dictionary.dictionary_set_data_dir("#{Gem.loaded_specs['grammar_police'].full_gem_path}/data/")
10
+ GrammarPolice::Dictionary.dictionary_set_data_dir("#{Gem.loaded_specs['grammar_police'].full_gem_path}/data")
11
+ #GrammarPolice::Dictionary.dictionary_set_data_dir(File.expand_path('../c/link-grammar.so', File.dirname(__FILE__)))
11
12
  end
Binary file
@@ -3,7 +3,8 @@ module GrammarPolice
3
3
  #only reason it works is data is 2 levels up from this ruby file and also 2 levels up from its C code
4
4
  class Dictionary
5
5
  extend FFI::Library
6
- ffi_lib "#{File.dirname(__FILE__)}/../../c/link-grammar.so"
6
+ ffi_lib File.expand_path('../../c/link-grammar.so', File.dirname(__FILE__))
7
+
7
8
  #set locale ensure utf8 data in dictionary can be read
8
9
  #attach_function(:setlocale, [LC_ALL, "])
9
10
 
@@ -1,7 +1,7 @@
1
1
  module GrammarPolice
2
2
  class Linkage
3
3
  extend FFI::Library
4
- ffi_lib "#{File.dirname(__FILE__)}/../../c/link-grammar.so"
4
+ ffi_lib File.expand_path('../../c/link-grammar.so', File.dirname(__FILE__))
5
5
 
6
6
  attach_function(:linkage_create, [:int, :pointer, :pointer], :pointer) #(0, sentence, opts) return Linkage
7
7
  attach_function(:linkage_delete, [:pointer], :void) #(linkage)
@@ -1,8 +1,8 @@
1
1
  module GrammarPolice
2
2
  class ParseOptions
3
3
  extend FFI::Library
4
- ffi_lib "#{File.dirname(__FILE__)}/../../c/link-grammar.so"
5
-
4
+ ffi_lib File.expand_path('../../c/link-grammar.so', File.dirname(__FILE__))
5
+
6
6
  #return Parse_Options with default settings (linkage_limit=10000, short_length=6)
7
7
  attach_function(:parse_options_create, [], :pointer)
8
8
 
@@ -1,7 +1,7 @@
1
1
  module GrammarPolice
2
2
  class Sentence
3
3
  extend FFI::Library
4
- ffi_lib "#{File.dirname(__FILE__)}/../../c/link-grammar.so"
4
+ ffi_lib File.expand_path('../../c/link-grammar.so', File.dirname(__FILE__))
5
5
  #this requires initializing dictionary everytime and is very slow (probably has mem leakage too)
6
6
  attach_function(:number_of_linkages, [:string], :int)
7
7
 
@@ -1,3 +1,3 @@
1
1
  module GrammarPolice
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/tests/.DS_Store CHANGED
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: grammar_police
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Quan Nguyen
@@ -36,6 +36,7 @@ files:
36
36
  - .DS_Store
37
37
  - .gitignore
38
38
  - Gemfile
39
+ - README
39
40
  - Rakefile
40
41
  - c/.DS_Store
41
42
  - c/link-grammar.c