auto-correct 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89d9754d3ecd0a18d8ef8ee8f245f2ff0b217873ae7b09bb0e4759759a297878
4
- data.tar.gz: f34f2c046802a275447e0f602442406aeafd7adee6e27fd6647405ac34e81499
3
+ metadata.gz: 0601f319b91d591f58b600938a273a7f2865b98c836271718addbd1113ba0ee0
4
+ data.tar.gz: 36acc277500cc855010af480979dae9c47b7fa941703d5459a2c302050bbc86a
5
5
  SHA512:
6
- metadata.gz: fba0aafa39062de04a459fadbdb23c3893b7e69dd09c343ec3e16ba41e5d776e3538475ecd6dd2335d9bd0de24bf15d58ad3c0490f87a97f2731fa169cc6dd01
7
- data.tar.gz: 72c1c012a63f9ebfb8289b7ce2e630d79aa47085720b8a98816b0763318d24460b22633fc0d8ffc1b012864bf660d69f4b9647fb10390d1643ddb8cd94e0b0a8
6
+ metadata.gz: e08ebc0e999f36ecd8b64fd82e6433044c99d53a47c80f1114557a483958647454888bfd577729805c140416e5160f0acc9ad302dbfec090807bfff919de051a
7
+ data.tar.gz: 358a903572c678ea9b233c69d71e714dd5265d97d7c644c8214e838f7928656b7a86029096a1fc9181489c684d884587002593d6b8bb4c58a96d433dd8cab7ec
data/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Automatically add spaces between Chinese and English words.
4
4
 
5
- 自动纠正中文英文混排是一些不够好的写法,纠正错误的名词大小写。
5
+ 中文英文混排自动纠正补充空格,此方式已在 Ruby China 使用多年,支持 HTML 处理。
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/auto-correct.svg)](https://rubygems.org/gems/auto-correct) [![Build
8
- Status](https://api.travis-ci.org/huacnlee/auto-correct.svg?branch=master&.svg)](http://travis-ci.org/huacnlee/auto-correct) [![Code Climate](https://codeclimate.com/github/huacnlee/auto-correct/badges/gpa.svg)](https://codeclimate.com/github/huacnlee/auto-correct)
8
+ Status](https://api.travis-ci.org/huacnlee/auto-correct.svg?branch=master&.svg)](http://travis-ci.org/huacnlee/auto-correct)
9
9
 
10
10
 
11
11
  ## Other implements
@@ -18,22 +18,24 @@ Status](https://api.travis-ci.org/huacnlee/auto-correct.svg?branch=master&.svg)]
18
18
  - Auto add spacings between Chinese and English words.
19
19
  - HTML content support.
20
20
 
21
+ [Examples](https://github.com/huacnlee/auto-correct/blob/master/test/format_test.rb)
22
+
21
23
  ## Usage
22
24
 
23
25
  `AutoCorrect.format` method for plain text.
24
26
 
25
27
  ```ruby
26
- AutoCorrect.format("关于ssh连接的Permission denied(publickey).")
27
- # => "关于 SSH 连接的 Permission denied (publickey)."
28
+ AutoCorrect.format("那里找到Ruby China App下载地址")
29
+ # => "那里找到 Ruby China App 下载地址"
28
30
 
29
- AutoCorrect.format("怎样追踪一个repo的新feature 和进展呢?")
30
- # => "怎样追踪一个 repo 的新 feature 和进展呢?"
31
+ AutoCorrect.format("Ruby 2.7版本第1次发布")
32
+ # => "Ruby 2.7 版本第 1 次发布"
31
33
 
32
- AutoCorrect.format("vps上sessions不生效,但在本地的环境是ok的,why?")
33
- # => "VPS sessions 不生效,但在本地的环境是 OK 的,why?"
34
+ AutoCorrect.format("于3月10日开始")
35
+ # => " 3 10 日开始"
34
36
 
35
- AutoCorrect.format("bootstrap control-group对齐问题")
36
- # => "Bootstrap control-group 对齐问"
37
+ AutoCorrect.format("包装日期为2013年3月10日")
38
+ # => "包装日期为2013年3月10日"
37
39
  ```
38
40
 
39
41
  `AutoCorrect.format_html` method for HTML content.
@@ -47,10 +49,9 @@ AutoCorrect.format_html("<div><p>长桥LongBridge App下载</p><p>最新版本1.
47
49
 
48
50
  TODO
49
51
 
50
-
51
52
  ## Use cases
52
53
 
53
- * [Ruby China](http://ruby-china.org) - 目前整站的标题都做了自动转换处理。
54
+ * [Ruby China](https://ruby-china.org) - 目前整站的标题都做了自动转换处理。
54
55
 
55
56
  ## Links
56
57
 
@@ -4,7 +4,7 @@ class AutoCorrect
4
4
  rule '\p{Han}', '[0-9a-zA-Z]', space: true, reverse: true
5
5
 
6
6
  # SpecialSymbol
7
- rule '\p{Han}', '[\|+$@#]', space: true, reverse: true
7
+ rule '\p{Han}', '[\|+$@#*]', space: true, reverse: true
8
8
  rule '\p{Han}', '[\[\(‘“]', space: true
9
9
  rule '[’”\]\)!%]', '\p{Han}', space: true
10
10
  rule '[”\]\)!]', '[a-zA-Z0-9]+', space: true
@@ -1,3 +1,3 @@
1
1
  class AutoCorrect
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto-correct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luikore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-09 00:00:00.000000000 Z
12
+ date: 2020-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri