jaro_winkler 1.5.6 → 1.6.0

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
  SHA256:
3
- metadata.gz: ce3a01db50ee096efbb0ba17e8d502d794f928d87543efc96b0baf221bf5ef72
4
- data.tar.gz: 4287e3c443cc9d8d9e4a039066b73451ba2ded1d5345a9b7bbff0aef2827defc
3
+ metadata.gz: 30727667e49f3cdcafdff62435bd00f3347a6d81c6f257c01fe3a11895a54d91
4
+ data.tar.gz: b6a8dd2fd12acf7375f23cc8c8cf3769adaa35bc94a3fba014b6fd5abd816d4a
5
5
  SHA512:
6
- metadata.gz: ed23759c3bbe6c43d731281e7d0996d4c401784d72882041ff422e75d58637eebebad790b76ec41d7070176e0d0183d950216454f8b565ef5f6092d08829baf7
7
- data.tar.gz: 17b690a9b9b990879bc2056942b2cb00aa5df6f29c65a6f199aa68edb0b2235a9b44c1981c18e2bdc011593a8ce5d65583103e14d4f3819a4dff24b4dce8a3e7
6
+ metadata.gz: 4377bd38d2c379a2584ce60723868b558ac05f5bc585cb5ee87d0e0b6036060d8a6f700cc922638b74eb8f596e8c7506e4df134d31862e2f6aec9a559b2600f9
7
+ data.tar.gz: 6e5ec4835471adf2f4bd567bd7bbf2a9e02f9e23bd470cd7077638d60880f39adea46d10ae278945ea2edc594f7aa727bc60f630c86c61a9dbe14e22e53bc8d9
@@ -5,7 +5,9 @@
5
5
  VALUE rb_mJaroWinkler, rb_eError, rb_eInvalidWeightError;
6
6
 
7
7
  VALUE rb_jaro_winkler_distance(int argc, VALUE *argv, VALUE self);
8
+ VALUE rb_jaro_winkler_similarity(int argc, VALUE *argv, VALUE self);
8
9
  VALUE rb_jaro_distance(int argc, VALUE *argv, VALUE self);
10
+ VALUE rb_jaro_similarity(int argc, VALUE *argv, VALUE self);
9
11
  VALUE distance(int argc, VALUE *argv, VALUE self,
10
12
  double (*distance_fn)(uint32_t *codepoints1, size_t len1,
11
13
  uint32_t *codepoints2, size_t len2,
@@ -25,6 +27,10 @@ void Init_jaro_winkler_ext(void) {
25
27
  rb_jaro_winkler_distance, -1);
26
28
  rb_define_singleton_method(rb_mJaroWinkler, "jaro_distance", rb_jaro_distance,
27
29
  -1);
30
+ rb_define_singleton_method(rb_mJaroWinkler, "similarity",
31
+ rb_jaro_winkler_similarity, -1);
32
+ rb_define_singleton_method(rb_mJaroWinkler, "jaro_similarity", rb_jaro_similarity,
33
+ -1);
28
34
  }
29
35
 
30
36
  VALUE distance(int argc, VALUE *argv, VALUE self,
@@ -69,9 +75,19 @@ VALUE distance(int argc, VALUE *argv, VALUE self,
69
75
  }
70
76
 
71
77
  VALUE rb_jaro_distance(int argc, VALUE *argv, VALUE self) {
78
+ rb_warn("JaroWinkler.jaro_distance is deprecated. Use JaroWinkler.jaro_similarity instead.");
79
+ return rb_jaro_similarity(argc, argv, self);
80
+ }
81
+
82
+ VALUE rb_jaro_similarity(int argc, VALUE *argv, VALUE self) {
72
83
  return distance(argc, argv, self, jaro_distance_from_codes);
73
84
  }
74
85
 
75
86
  VALUE rb_jaro_winkler_distance(int argc, VALUE *argv, VALUE self) {
87
+ rb_warn("JaroWinkler.distance is deprecated. Use JaroWinkler.similarity instead.");
88
+ return rb_jaro_winkler_similarity(argc, argv, self);
89
+ }
90
+
91
+ VALUE rb_jaro_winkler_similarity(int argc, VALUE *argv, VALUE self) {
76
92
  return distance(argc, argv, self, jaro_winkler_distance_from_codes);
77
93
  }
@@ -14,11 +14,21 @@ module JaroWinkler
14
14
 
15
15
  class << self
16
16
  def distance(str1, str2, options = {})
17
+ warn("JaroWinkler.distance is deprecated. Use JaroWinkler.similarity instead.")
18
+ similarity(str1, str2, options)
19
+ end
20
+
21
+ def similarity(str1, str2, options = {})
17
22
  validate!(str1, str2)
18
23
  _distance str1.codepoints.to_a, str2.codepoints.to_a, options
19
24
  end
20
25
 
21
26
  def jaro_distance(str1, str2, options = {})
27
+ warn("JaroWinkler.jaro_distance is deprecated. Use JaroWinkler.jaro_similarity instead.")
28
+ jaro_similarity(str1, str2, options)
29
+ end
30
+
31
+ def jaro_similarity(str1, str2, options = {})
22
32
  validate!(str1, str2)
23
33
  _jaro_distance str1.codepoints.to_a, str2.codepoints.to_a, options
24
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JaroWinkler
4
- VERSION = '1.5.6'
4
+ VERSION = '1.6.0'
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.6
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jian Weihang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-29 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -82,9 +82,9 @@ licenses:
82
82
  - MIT
83
83
  metadata:
84
84
  bug_tracker_uri: https://github.com/tonytonyjan/jaro_winkler/issues
85
- changelog_uri: https://github.com/tonytonyjan/jaro_winkler/blob/v1.5.6/CHANGELOG.md
86
- documentation_uri: https://www.rubydoc.info/gems/jaro_winkler/1.5.6
87
- source_code_uri: https://github.com/tonytonyjan/jaro_winkler/tree/v1.5.6
85
+ changelog_uri: https://github.com/tonytonyjan/jaro_winkler/blob/v1.6.0/CHANGELOG.md
86
+ documentation_uri: https://www.rubydoc.info/gems/jaro_winkler/1.6.0
87
+ source_code_uri: https://github.com/tonytonyjan/jaro_winkler/tree/v1.6.0
88
88
  post_install_message:
89
89
  rdoc_options: []
90
90
  require_paths:
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.4.13
103
+ rubygems_version: 3.5.9
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: An implementation of Jaro-Winkler distance algorithm written \ in C extension