ruby-pinyin 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56e37caaa66e326809e5d7c1d7b3a968f172deb9
4
- data.tar.gz: 07396ebf42141b3af9931a5365cfe5c78ff6bfab
3
+ metadata.gz: 14a37d61d5dfbbb64837e79101fdcd80d3f89423
4
+ data.tar.gz: 9254f90015561aa88ca825c2d8fd4d33bac506bd
5
5
  SHA512:
6
- metadata.gz: f2858469ea1feff0c0f27e2444815b2d497a3fa1f7fef3deea04c5ca0d926af7e28f3198186c461959846e61cc423d32dcf63c75c09b1526bc5a1ae516ded45e
7
- data.tar.gz: ad3f14ed6a518c88cf728b313334dd3737fb639776619757d6f1017e9cb4ff9629d4f416a0cbf9e8d1aade86282e1ec73f354b002dd6badbc06bbb47577b3c71
6
+ metadata.gz: 95c893f3136cc5ebc8d128c4f4d910d2725c1212bf58ab74905e4bfb9824d23d6365352af5d58f2c66b62696e93c892f7ac17afb5a7d2c4d9074ea63c0139efd
7
+ data.tar.gz: 10588e178f4f7886663fcf0bfe347cd5dbbb092d927560937765ea11fb51c7c94c76bc45df4d1932c2379f2b63075538d4ae741691f9b7227d110ff8571267fb
@@ -30,7 +30,8 @@ module PinYin
30
30
 
31
31
  words = []
32
32
  while token = algor.next_token
33
- words.push token.text.force_encoding("UTF-8")
33
+ s = token.text.force_encoding("UTF-8")
34
+ words.push(s) unless s =~ Punctuation.chinese_regexp
34
35
  end
35
36
  words
36
37
  end
@@ -11,6 +11,10 @@ module PinYin
11
11
  @regexp
12
12
  end
13
13
 
14
+ def chinese_regexp
15
+ @chinese_regexp ||= /([\uFF00-\uFFEF]+)/
16
+ end
17
+
14
18
  def [](code)
15
19
  punctuations[code]
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module PinYin
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pinyin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Xie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-11 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmmseg-cpp