cmp_text 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +29 -27
- data/cmp_text.gemspec +1 -1
- data/lib/cmp_text/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: 84dafe62622075eada13f8af7dcdabe8c0ad1954
|
4
|
+
data.tar.gz: 82dd55b1976d2b52696e1a81bb70aed960510b4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb69c5d0bc0fe77d22e14978d99955ce6093d19e8f88d368786513fe58b65938ca2a29f987b67e4cbf9ffe7f3fbfcb6586ba62cfef07d03fca98c0c65affdf7
|
7
|
+
data.tar.gz: c49f18537adf1197b9344015e5b2caee6a55f8af24b94e93d7f2a463c4697978c27da6b0041c27a8fbeef9ed107559d3de96278dfad8942b999fc81075e61ff1
|
data/README.md
CHANGED
@@ -1,35 +1,50 @@
|
|
1
1
|
# CmpText
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cmp_text`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
2
|
+
最新版本 0.1.2
|
7
3
|
## Installation
|
8
4
|
|
9
|
-
|
5
|
+
添加这行代码到你的 Gemfile:
|
10
6
|
|
11
7
|
```ruby
|
12
8
|
gem 'cmp_text'
|
13
9
|
```
|
14
10
|
|
15
|
-
|
11
|
+
然后执行:
|
16
12
|
|
17
13
|
$ bundle
|
18
14
|
|
19
|
-
|
15
|
+
或者直接安装:
|
20
16
|
|
21
17
|
$ gem install cmp_text
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
你可以填写两个参数,参数可以是文件,也可以是字符串:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
CmpText::Analysis.txt_cmp(file_1, file_2)
|
25
|
+
```
|
26
|
+
或者:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
CmpText::Analysis.txt_cmp(str_1, str_2)
|
30
|
+
```
|
28
31
|
|
29
32
|
## Example
|
30
|
-
$ CmpText::Analysis.txt_cmp('我来自武汉','我来自中国') # => 0.6
|
31
33
|
|
32
|
-
|
34
|
+
例如直接输入两个字符串:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
CmpText::Analysis.txt_cmp('我来自武汉','我来自中国') # => 0.6
|
38
|
+
```
|
39
|
+
|
40
|
+
或者用print方法打印出JSON结果, 'succ_char'比对成功的部分,'failed_char'比对失败的部分:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
CmpText::Analysis.print('我来自武汉','我来自中国')
|
44
|
+
```
|
45
|
+
|
46
|
+
结果:
|
47
|
+
```ruby
|
33
48
|
{
|
34
49
|
:result => "匹配度是 60.0%",
|
35
50
|
:data => {
|
@@ -44,17 +59,4 @@ or
|
|
44
59
|
]
|
45
60
|
}
|
46
61
|
}
|
47
|
-
|
48
|
-
## Development
|
49
|
-
|
50
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
51
|
-
|
52
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
53
|
-
|
54
|
-
## Contributing
|
55
|
-
|
56
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cmp_text. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
57
|
-
|
58
|
-
## Code of Conduct
|
59
|
-
|
60
|
-
Everyone interacting in the CmpText project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/cmp_text/blob/master/CODE_OF_CONDUCT.md).
|
62
|
+
```
|
data/cmp_text.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = '比较两个文件中文字相似度,也可以直接比较2段文字'
|
13
13
|
spec.description = '比较两个文件中文字相似度,也可以直接比较2段文字'
|
14
|
-
spec.homepage = ""
|
14
|
+
spec.homepage = "https://github.com/mico-xiaozhen/cmp_text"
|
15
15
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
data/lib/cmp_text/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmp_text
|
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
|
- zhouxiaozhen
|
@@ -71,7 +71,7 @@ files:
|
|
71
71
|
- cmp_text.gemspec
|
72
72
|
- lib/cmp_text.rb
|
73
73
|
- lib/cmp_text/version.rb
|
74
|
-
homepage:
|
74
|
+
homepage: https://github.com/mico-xiaozhen/cmp_text
|
75
75
|
licenses: []
|
76
76
|
metadata: {}
|
77
77
|
post_install_message:
|