jaro_winkler 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ext/jaro_winkler/adj_matrix.c +0 -1
- data/ext/jaro_winkler/extconf.rb +16 -3
- data/ext/jaro_winkler/jaro.c +2 -2
- data/ext/jaro_winkler/jaro_winkler.c +1 -1
- data/lib/jaro_winkler/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9a6c09b6eb84b074ba116e7a986660665da7948ee55e655c0515137e2e717a6d
|
4
|
+
data.tar.gz: cd8276983e8a4af489da885caa2e57fc954476d475e4d3b5a0a52ad5c561369d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd00297dd0d4ba66fa0210712c304c5f1f85df7a694148d9fdfaf0c9d0ec8f29544490f55340229b23b3f333b68bdb41b8e5d877af55502da65e85d160422c01
|
7
|
+
data.tar.gz: 6477366a7cdf3079537654b65253a26e116a303fce88501df94a7a827d1b66e0d39e1918e0498f1f13c0349e407ec2040c002c321844a416b50ae1dbf2f499bd
|
@@ -87,7 +87,6 @@ AdjMatrix *adj_matrix_default() {
|
|
87
87
|
size_t length = sizeof(DEFAULT_ADJ_TABLE) / sizeof(char *);
|
88
88
|
for (size_t i = 0; i < length; i += 2) {
|
89
89
|
uint64_t code_1, code_2;
|
90
|
-
size_t dummy_length;
|
91
90
|
code_1 = *DEFAULT_ADJ_TABLE[i] & 0xff;
|
92
91
|
code_2 = *DEFAULT_ADJ_TABLE[i + 1] & 0xff;
|
93
92
|
adj_matrix_add(ret_matrix, code_1, code_2);
|
data/ext/jaro_winkler/extconf.rb
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if RUBY_ENGINE == 'ruby'
|
4
|
+
require 'mkmf'
|
5
|
+
$CFLAGS << ' -std=c99 '
|
6
|
+
create_makefile('jaro_winkler/jaro_winkler_ext')
|
7
|
+
else
|
8
|
+
open('Makefile', 'wb') do |file|
|
9
|
+
file.write <<-MAKEFILE
|
10
|
+
.PHONY: install
|
11
|
+
install:
|
12
|
+
\techo "Cannot compile C Extension, fall back to pure Ruby version."
|
13
|
+
clean:
|
14
|
+
MAKEFILE
|
15
|
+
end
|
16
|
+
end
|
data/ext/jaro_winkler/jaro.c
CHANGED
@@ -38,7 +38,7 @@ double jaro_distance_from_codes(uint32_t *codepoints1, size_t len1,
|
|
38
38
|
codepoints2[i] = tolower(codepoints2[i]);
|
39
39
|
}
|
40
40
|
|
41
|
-
int32_t window_size = len2 / 2 - 1;
|
41
|
+
int32_t window_size = (int32_t)len2 / 2 - 1;
|
42
42
|
if (window_size < 0)
|
43
43
|
window_size = 0;
|
44
44
|
|
@@ -50,7 +50,7 @@ double jaro_distance_from_codes(uint32_t *codepoints1, size_t len1,
|
|
50
50
|
// count number of matching characters
|
51
51
|
size_t match_count = 0;
|
52
52
|
for (size_t i = 0; i < len1; i++) {
|
53
|
-
size_t left = (i >= window_size) ? i - window_size : 0;
|
53
|
+
size_t left = (i >= (size_t)window_size) ? i - window_size : 0;
|
54
54
|
size_t right =
|
55
55
|
(i + window_size <= len2 - 1) ? (i + window_size) : (len2 - 1);
|
56
56
|
if (right > len2 - 1)
|
@@ -29,7 +29,7 @@ VALUE distance(size_t argc, VALUE *argv, VALUE self,
|
|
29
29
|
VALUE s1, s2, opt;
|
30
30
|
CodePoints cp1, cp2;
|
31
31
|
|
32
|
-
rb_scan_args(argc, argv, "2:", &s1, &s2, &opt);
|
32
|
+
rb_scan_args((int32_t)argc, argv, "2:", &s1, &s2, &opt);
|
33
33
|
codepoints_init(&cp1, s1);
|
34
34
|
codepoints_init(&cp2, s2);
|
35
35
|
|
data/lib/jaro_winkler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jaro_winkler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.0'
|
34
34
|
type: :development
|
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: '12.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.7.3
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: An implementation of Jaro-Winkler distance algorithm written \ in C extension
|