damerau-levenshtein 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +3 -3
- data/CHANGELOG.md +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +13 -7
- data/damerau-levenshtein.gemspec +6 -6
- data/ext/damerau_levenshtein/damerau_levenshtein.c +1 -1
- data/lib/damerau-levenshtein/damerau_levenshtein.so +0 -0
- data/lib/damerau-levenshtein/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f34914dc677c5f29b409bd2ecc418b5a3ae3064
|
4
|
+
data.tar.gz: 69cc61c9a53befd39ac9d08438129e136339edcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 462f2a70cd36ab4e7d0f237a5a00e5dd17a0f0f4e32681f9a2797ebee516ee0526c3e49785db92336e60f3b252638b7947be38f4095f11f8621d995413ba7b58
|
7
|
+
data.tar.gz: f2d4e33e628228c70dcc4771f935c158c21350c0365f3b1ec367f3e241c6d111565da125ba5b1b248524662c58abba0652121c19d07478ad2afa0f5911796928
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -16,24 +16,28 @@ of bigger than 1 character blocks is taken in account as well
|
|
16
16
|
(Boehmer & Rees 2008).
|
17
17
|
|
18
18
|
```ruby
|
19
|
-
require
|
20
|
-
DamerauLevenshtein.distance(
|
19
|
+
require "damerau-levenshtein"
|
20
|
+
DamerauLevenshtein.distance("Something", "Smoething") #returns 1
|
21
21
|
```
|
22
22
|
|
23
23
|
Gem damerau-levenshtein is compatible with ruby versions 1.8.7
|
24
24
|
and 1.9.2 and higher, as well as 2.0.0 and higher
|
25
25
|
|
26
|
+
DepeVndencies
|
27
|
+
-------------
|
28
|
+
|
29
|
+
sudo apt-get install build-essential libgmp3-dev
|
30
|
+
|
26
31
|
Installation
|
27
32
|
------------
|
28
33
|
|
29
|
-
|
34
|
+
gem install damerau-levenshtein
|
30
35
|
|
31
36
|
Examples
|
32
37
|
--------
|
33
38
|
|
34
39
|
```ruby
|
35
|
-
require
|
36
|
-
require 'damerau-levenshtein'
|
40
|
+
require "damerau-levenshtein"
|
37
41
|
dl = DamerauLevenshtein
|
38
42
|
```
|
39
43
|
|
@@ -109,7 +113,7 @@ Levenshtein algorithm is expensive, so it makes sense to give up when edit
|
|
109
113
|
distance is becoming too big. The argument max_distance does just that.
|
110
114
|
|
111
115
|
```ruby
|
112
|
-
DamerauLevenshtein.distance(
|
116
|
+
DamerauLevenshtein.distance("abcdefg", "1234567", 0, 3)
|
113
117
|
# output: 4 -- it gave up when edit distance exceeded 3
|
114
118
|
```
|
115
119
|
|
@@ -143,11 +147,12 @@ Contributors
|
|
143
147
|
------------
|
144
148
|
|
145
149
|
[lazylester][lazylester]
|
150
|
+
[Ran Xie][skarlit]
|
146
151
|
|
147
152
|
Copyright
|
148
153
|
---------
|
149
154
|
|
150
|
-
Copyright (c) 2011-
|
155
|
+
Copyright (c) 2011-2016 Dmitry Mozzherin. See LICENSE.txt for
|
151
156
|
further details.
|
152
157
|
|
153
158
|
[gem_svg]: https://badge.fury.io/rb/damerau-levenshtein.svg
|
@@ -162,3 +167,4 @@ further details.
|
|
162
167
|
[semver]: http://semver.org/
|
163
168
|
[dimus]: https://github.com/dimus
|
164
169
|
[lazylester]: https://github.com/lazylester
|
170
|
+
[skarlit]: https://github.com/Skarlit
|
data/damerau-levenshtein.gemspec
CHANGED
@@ -19,19 +19,19 @@ Gem::Specification.new do |s|
|
|
19
19
|
"1 character blocks is taken in account as well " \
|
20
20
|
"(Boehmer & Rees 2008)."
|
21
21
|
s.files = `git ls-files -z`.split("\x0").
|
22
|
-
|
22
|
+
reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
23
|
s.extensions = ["ext/damerau_levenshtein/extconf.rb"]
|
24
24
|
s.require_paths = ["lib", "lib/damerau-levenshtein"]
|
25
25
|
|
26
|
-
s.add_dependency "bundler", "~> 1.
|
27
|
-
s.add_dependency "rake", "~>
|
26
|
+
s.add_dependency "bundler", "~> 1.11"
|
27
|
+
s.add_dependency "rake", "~> 11.1"
|
28
28
|
s.add_dependency "rake-compiler", "~> 0.9"
|
29
29
|
s.add_dependency "json", "~> 1.8"
|
30
30
|
|
31
|
-
s.add_development_dependency "rspec", "~> 3.
|
32
|
-
s.add_development_dependency "cucumber", "~> 2.
|
31
|
+
s.add_development_dependency "rspec", "~> 3.4"
|
32
|
+
s.add_development_dependency "cucumber", "~> 2.3"
|
33
33
|
s.add_development_dependency "ruby-prof", "~> 0.15"
|
34
34
|
s.add_development_dependency "shoulda", "~> 3.5"
|
35
|
-
s.add_development_dependency "rubocop", "~> 0.
|
35
|
+
s.add_development_dependency "rubocop", "~> 0.38"
|
36
36
|
s.add_development_dependency "coveralls", "~> 0.8"
|
37
37
|
end
|
@@ -91,7 +91,7 @@ VALUE method_distance_utf(VALUE self, VALUE _s, VALUE _t, VALUE _block_size, VAL
|
|
91
91
|
min = del;
|
92
92
|
if (ins < min) min = ins;
|
93
93
|
//if (i == 2 && j==2) return INT2NUM(swap2+5);
|
94
|
-
if (pure_levenshtein == 0 && i >= block && j >= block && swap1 == 1 && swap2 == 1){
|
94
|
+
if (pure_levenshtein == 0 && i >= 2*block && j >= 2*block && swap1 == 1 && swap2 == 1){
|
95
95
|
transp = d[(j - block * 2) * sl + i - block * 2] + cost + block -1;
|
96
96
|
if (transp < min) min = transp;
|
97
97
|
block = 0;
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: damerau-levenshtein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Mozzherin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.11'
|
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: '1.
|
26
|
+
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '11.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '11.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
82
|
+
version: '3.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: cucumber
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '2.
|
89
|
+
version: '2.3'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
96
|
+
version: '2.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ruby-prof
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
131
|
+
version: '0.38'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0.
|
138
|
+
version: '0.38'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: coveralls
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.4.5.1
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Calculation of editing distance for 2 strings using Levenshtein or Damerau-Levenshtein
|