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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 445cf12b6f4c0a9ed5d7bfe9a67ef1e690f9af3c
4
- data.tar.gz: b5b7114e72603c057be0d9914c150715a6054670
2
+ SHA256:
3
+ metadata.gz: 9a6c09b6eb84b074ba116e7a986660665da7948ee55e655c0515137e2e717a6d
4
+ data.tar.gz: cd8276983e8a4af489da885caa2e57fc954476d475e4d3b5a0a52ad5c561369d
5
5
  SHA512:
6
- metadata.gz: 4d2bfc3518cfbffc5cf68b73f66bade243a1da8ea9f9b0d59b5258514d7fc869c493b2f5f5fdfdf95bd2cc243fdb7c1e67f20f190023c0870d9a3a1facee4993
7
- data.tar.gz: 82859b43a0c06fe0a535ac1fdaa07343d7e54dd9a54fb020f0f66930c779cc6f36d78708686fe3c97b62b68d4d317a074fe449cc938eff5f4866ff7406d102ba
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);
@@ -1,3 +1,16 @@
1
- require 'mkmf'
2
- $CFLAGS << ' -std=c99 '
3
- create_makefile('jaro_winkler/jaro_winkler_ext')
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
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JaroWinkler
4
- VERSION = '1.5.0'
4
+ VERSION = '1.5.1'
5
5
  end
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.0
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: 2017-10-03 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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.6.12
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