grammar_police 0.1.0 → 0.1.1
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.
- data/.DS_Store +0 -0
- data/README +1 -0
- data/c/link-grammar.o +0 -0
- data/c/link-grammar.so +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/grammar_police.rb +2 -1
- data/lib/grammar_police/.DS_Store +0 -0
- data/lib/grammar_police/dictionary.rb +2 -1
- data/lib/grammar_police/linkage.rb +1 -1
- data/lib/grammar_police/parse_options.rb +2 -2
- data/lib/grammar_police/sentence.rb +1 -1
- data/lib/grammar_police/version.rb +1 -1
- data/tests/.DS_Store +0 -0
- metadata +2 -1
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
|
data/lib/grammar_police.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
|
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.
|
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
|