rubyrubi 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubyrubi/parser/base.rb +4 -1
- data/lib/rubyrubi/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: ea1bbd4fb734d2d150a68403ab95c26041612118
|
4
|
+
data.tar.gz: 9dcbe1c6170587a18c51306477546530de1ad9e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 956ed124508a41c6b86f2ea62367ae39d36bb8cf58451ee647058141b006f938c26bd58ead934c21a4b98565163ee48f2aff82b10a401fdb049b98c265ab1c7d
|
7
|
+
data.tar.gz: 3e2a43fd1bc67707b8ae7e833d97102d151957947c0c0896ccc1be7396778a94864cb6e35d6163f316cb4b6b9a8bc574c4288bee47b0fac69b4fa25380cbfe1b
|
data/lib/rubyrubi/parser/base.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Rubyrubi
|
2
2
|
module Parser
|
3
3
|
KANJI = /^[一-龠]+/
|
4
|
-
OKURI = /[\p{hiragana}]+$/
|
4
|
+
OKURI = /[\p{hiragana}\p{katakana}ー〜]+$/
|
5
5
|
|
6
6
|
class Base
|
7
7
|
def initialize(result)
|
@@ -21,6 +21,9 @@ module Rubyrubi
|
|
21
21
|
def add_rubi_and_okuri(word)
|
22
22
|
#p word
|
23
23
|
kanji = word['surface'].scan(KANJI)[0]
|
24
|
+
if kanji == nil
|
25
|
+
return word.clone
|
26
|
+
end
|
24
27
|
okuri = word['surface'].scan(OKURI)[0]
|
25
28
|
rubi = kanji == nil && okuri == nil ? nil
|
26
29
|
: word['reading'].gsub(Regexp.new("#{okuri}$"), '')
|
data/lib/rubyrubi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyrubi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 110chang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|