ruby-pinyin 0.4.1 → 0.4.2

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: f4a8ba70c1bdc1dfd7a0c38b0c4323a81390b1a6
4
- data.tar.gz: 74e4bb55b339297ec8be7d69c775471e80e5640a
3
+ metadata.gz: 0433765c652e4fd6b3cf750f93c432d535e3034f
4
+ data.tar.gz: 49e73c852d4f7ab99ce2ce77f43281dfbf220b28
5
5
  SHA512:
6
- metadata.gz: 575bbb06b72b13d0b660a729bbc8ea2c84ccecda62bdfef7ab59b1e3a7c63fd0a03cb9ac57a1b8595aa26da25f8d5f5fcf12aa821336cb14f4a4006a77834fb0
7
- data.tar.gz: deb6f752765b1dcb3543c94ca7cc3a9b478356fbf08151157e82986c9bd89dd75165f29b9bcefc9f16d3f5dbdb0641c423eac469d68e8442d49d4c976d2dac14
6
+ metadata.gz: 0352956d02fb5e9ba74492d622de0bd203bfcdf6b82772c99ac0a83740628f080f6cdaa64b76a782ca91ee8b45f8457fcea3e3dcb00925876b79abc9ed7a7561
7
+ data.tar.gz: 147b224102bfcb95dbdca8f8879ea7ed940bb35e50734fa1b5ac6fc51f1fbdbed73bb81974c8f138004c4c8bb2bb3ee852dffd7b803ae37c3cd690b4da7922ce
@@ -21,7 +21,11 @@ module PinYin
21
21
  else
22
22
  val = [t].pack('U*')
23
23
  if val =~ /^[_0-9a-zA-Z\s]*$/ # 复原,去除特殊字符,如全角符号等。
24
- (res.last && res.last.english? ? res.last : res) << Value.new(val, true) # 如果上一个字符也是非中文则与之合并
24
+ if res.last && res.last.english?
25
+ res.last << Value.new(val, true)
26
+ elsif val != ' '
27
+ res << Value.new(val, true)
28
+ end
25
29
  elsif include_punctuations
26
30
  val = [Punctuation[code]].pack('H*') if Punctuation.include?(code)
27
31
  (res.last ? res.last : res) << Value.new(val, false)
@@ -1,3 +1,3 @@
1
1
  module PinYin
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
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.1
4
+ version: 0.4.2
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-04-11 00:00:00.000000000 Z
11
+ date: 2014-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmmseg-cpp
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.9
19
+ version: '0.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.9
26
+ version: '0.2'
27
27
  description: Pinyin is a romanization system (phonemic notation) of Chinese characters,
28
28
  this gem helps you to convert Chinese characters into pinyin form.
29
29
  email:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.2.0
69
+ rubygems_version: 2.2.2
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Convert Chinese characters into pinyin.