nimono 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nimono/nimono.rb +10 -6
- data/lib/nimono/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 300fae415db9805bb8c58a11936386e452ef6c15
|
4
|
+
data.tar.gz: 5e6495fc95595fb783a37edfa90cd2e5a21de767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f87b4a3dcecf39008f7e3da2bf5ec6955e45cd9a8b52f7d096e645fcbbff8f8e7e8484b1f89739e499fc63ef24de1e876ddeb4a26eae3271ad53de92264e32c
|
7
|
+
data.tar.gz: 40c96a110624688827425fd9d3fe5ad4d6105e139074d25c6dbd940f4b507cc7bcd2a723756eba66a7d0c4ef4f02cea4fa3d11981ac216b5c7047d1277b5e301
|
data/lib/nimono/nimono.rb
CHANGED
@@ -8,7 +8,7 @@ module Nimono
|
|
8
8
|
# `Cabocha` is a class providing an interface to the CaboCha library.
|
9
9
|
# In this class the arguments supported by CaboCha can be used in almost
|
10
10
|
# the same way.
|
11
|
-
class Cabocha
|
11
|
+
class Cabocha < FFI::AutoPointer
|
12
12
|
include Nimono::OptionParse
|
13
13
|
include Nimono::CabochaLib
|
14
14
|
|
@@ -22,6 +22,10 @@ module Nimono
|
|
22
22
|
# @return [Array] Array of Token
|
23
23
|
attr_reader :tokens
|
24
24
|
|
25
|
+
def self.release(ptr)
|
26
|
+
self.class.cabocha_destroy(ptr)
|
27
|
+
end
|
28
|
+
|
25
29
|
# Initializes the CaboCha with the given 'options'.
|
26
30
|
# options is given as a string (CaboCha command line arguments) or
|
27
31
|
# as a Ruby-style hash.
|
@@ -92,6 +96,8 @@ module Nimono
|
|
92
96
|
@libpath = self.class.cabocha_library
|
93
97
|
|
94
98
|
@parser = self.class.cabocha_new2(opt_str)
|
99
|
+
super @parser
|
100
|
+
|
95
101
|
if @parser.address == 0x0
|
96
102
|
raise CabochaError.new("Could not initialize CaboCha with options: '#{opt_str}'")
|
97
103
|
end
|
@@ -130,12 +136,10 @@ module Nimono
|
|
130
136
|
@tokens.freeze
|
131
137
|
|
132
138
|
@chunks = []
|
133
|
-
|
134
|
-
@chunks <<
|
135
|
-
# chunk = Nimono::Chunk.new(self.class.cabocha_tree_chunk(@tree, i))
|
136
|
-
# chunk.instance_variable_set(:@tokens, @tokens[chunk.token_pos..(chunk.token_pos + chunk.token_size - 1)])
|
137
|
-
# @chunks << chunk
|
139
|
+
@tokens.each do |token|
|
140
|
+
@chunks << token.chunk unless token.chunk.nil?
|
138
141
|
end
|
142
|
+
|
139
143
|
@chunks.freeze
|
140
144
|
|
141
145
|
self.to_s
|
data/lib/nimono/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nimono
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takayoshi Yamazaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|