igo-ruby 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/igo/dictionary.rb +8 -3
  3. data/test/test.rb +7 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -104,7 +104,12 @@ module Igo
104
104
  #wdic::
105
105
  #result::
106
106
  def search(text, start, wdic, result)
107
- txt = text.unpack("U*")
107
+ if RUBY_VERSION >= '1.9.0'
108
+ txt = text.bytes.to_a
109
+ else
110
+ txt = text.unpack('C*')
111
+ end
112
+
108
113
  length = txt.size
109
114
  ch = txt[start]
110
115
  ct = @category.category(ch)
@@ -118,8 +123,8 @@ module Igo
118
123
 
119
124
  for i in start..(limit - 1)
120
125
  wdic.search_from_trie_id(ct.id, start, (i - start) + 1, is_space, result)
121
-
122
- if((i + 1) != limit and !(@category.compatible?(ch, text[i + 1])))
126
+
127
+ if((i + 1) != limit and !(@category.compatible?(ch, txt[i + 1])))
123
128
  return
124
129
  end
125
130
  end
@@ -13,4 +13,10 @@ t.each{|m|
13
13
  }
14
14
  puts "wakati ->"
15
15
  t = tagger.wakati('どこで生れたかとんと見当がつかぬ。')
16
- puts t.join(' ')
16
+ puts t.join(' ')
17
+
18
+ t = tagger.parse('取り敢えずビール')
19
+ puts "1.9 character code bug fix ->"
20
+ t.each{|m|
21
+ puts "#{m.surface} #{m.feature} #{m.start}"
22
+ }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: igo-ruby
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - K.Nishi
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-10 00:00:00 +09:00
13
+ date: 2011-05-05 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -98,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
- hash: 2664330083952194465
101
+ hash: -4300304446436456083
102
102
  segments:
103
103
  - 0
104
104
  version: "0"