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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 069786523f2031b397b0c45af0841793ba696751
4
- data.tar.gz: fae6b9bf74312f37b2bed2b032a46b7ae483da33
3
+ metadata.gz: 7f34914dc677c5f29b409bd2ecc418b5a3ae3064
4
+ data.tar.gz: 69cc61c9a53befd39ac9d08438129e136339edcb
5
5
  SHA512:
6
- metadata.gz: 13fb0c92038b6a3d21cf4ab4988996d841f3819d445129309a6db5a53a409151af45c2c2fed042c5f38a0a3921f9ae3346d7a32a5a038d22f5d58ceb0259b78c
7
- data.tar.gz: fe8cbd5abd96ee8b2980d8b754cd4817e9529586d612f9816dcc1cafeaa7d3d67dd131b4e6569040081986e16230cb7d445d9732591ed3ad02897872c4b8eb8c
6
+ metadata.gz: 462f2a70cd36ab4e7d0f237a5a00e5dd17a0f0f4e32681f9a2797ebee516ee0526c3e49785db92336e60f3b252638b7947be38f4095f11f8621d995413ba7b58
7
+ data.tar.gz: f2d4e33e628228c70dcc4771f935c158c21350c0365f3b1ec367f3e241c6d111565da125ba5b1b248524662c58abba0652121c19d07478ad2afa0f5911796928
@@ -1 +1 @@
1
- 2.1.6
1
+ 2.2.4
@@ -1,11 +1,11 @@
1
1
  rvm:
2
- - 1.9.3
3
2
  - 2.0
4
3
  - 2.1
5
4
  - 2.2
5
+ before_install: "gem update bundler"
6
6
  script:
7
- - 'bundle exec rake'
8
- - 'bundle exec rake features'
7
+ - "bundle exec rake"
8
+ - "bundle exec rake features"
9
9
  branches:
10
10
  only:
11
11
  - master
@@ -1,6 +1,6 @@
1
1
  damerau-levenshtein CHANGELOG
2
2
  =============================
3
-
3
+ 1.1.1 -- fix random negative distance bug (by @Skarlit)
4
4
  1.1.0 -- relax and update gem dependencies, update specs
5
5
 
6
6
  1.0.3 -- gems update
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2011-2015 Marine Biological Laboratory
3
+ Copyright (c) 2011-2016 Dmitry Mozzherin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
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 'damerau-levenshtein'
20
- DamerauLevenshtein.distance('Something', 'Smoething') #returns 1
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
- $ gem install damerau-levenshtein
34
+ gem install damerau-levenshtein
30
35
 
31
36
  Examples
32
37
  --------
33
38
 
34
39
  ```ruby
35
- require 'rubygems' #not needed for ruby >= 1.9.0
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('abcdefg', '1234567', 0, 3)
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-2015 Marine Biological Laboratory. See LICENSE.txt for
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
@@ -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
- reject { |f| f.match(%r{^(test|spec|features)/}) }
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.7"
27
- s.add_dependency "rake", "~> 10.4"
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.2"
32
- s.add_development_dependency "cucumber", "~> 2.0"
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.30"
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;
@@ -1,4 +1,4 @@
1
1
  # Damerau Levenshtein algorithm
2
2
  module DamerauLevenshtein
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1".freeze
4
4
  end
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.0
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: 2015-05-20 00:00:00.000000000 Z
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.7'
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.7'
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: '10.4'
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: '10.4'
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.2'
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.2'
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.0'
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.0'
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.30'
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.30'
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.2.3
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