fuzzy-string-match 0.9.7 → 0.9.8

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: e6c482cde7e2c3ed8adf5e868574d23505f6c11b
4
- data.tar.gz: dba293a5c00ba813c05c41e3029b00de4213b917
3
+ metadata.gz: cd17741cc61f330ee4a34c329261f5c2e2163cd8
4
+ data.tar.gz: 3e3f736428e991c9ac4db43147edabe704bf1a62
5
5
  SHA512:
6
- metadata.gz: 078f094e32f22a4a832cf424d93538613c570bb5bc7151f3689edebc0b7c8c8f4051c2897e2f244d7a0b0e5dbcf018c062dcd65f476d9e231a2311499ed77392
7
- data.tar.gz: c27ff9107753139c648832c5ec4f06d701d128b7117b0ea1da42e770021a2946d1245e65f96a79ab2e9b7cf672c20a66113e57012a2b80e68e45388402ec70c4
6
+ metadata.gz: c3563a71e3a6865e6a767ae499ea3fb073aae461b1a3adfdee09305f9f3d0fcd02c320728eb360e0ae89c5fe8c6c0d37fac4cacf71d66c5e77466a2f677cc0a5
7
+ data.tar.gz: cbe14e25c531f076497efaaefda1317cc59790ddbcc2d0ac0dc22f706666530106ca110dadae8e62172c5039f8a621f03f4a41938714eeb83c7923af557d0530
data/README.md CHANGED
@@ -76,7 +76,7 @@
76
76
 
77
77
  ### for CRuby
78
78
  - RubyInline
79
- - Ruby 1.9.2 or higher ( includes RubyInstaller.org's CRuby on Windows )
79
+ - Ruby 2.1.0 or higher ( includes RubyInstaller.org's CRuby on Windows )
80
80
 
81
81
  ### for JRuby
82
82
  - JRuby 1.6.6 or higher
@@ -96,6 +96,12 @@
96
96
 
97
97
  ## ChangeLog
98
98
 
99
+ ### 0.9.8 / Mar 2, 2017
100
+
101
+ * Changed README.md (Supported ruby version is 2.1.0 or higher)
102
+ * Merge pull request #16 from ferdinandrosario/ferdinandrosario-patch-1 (Travis rubies updated)
103
+ * Merge pull request #14 from timsatterfield/master (Reduce calls to strlen() in native jaro winkler)
104
+
99
105
  ### 0.9.7 / Oct 15, 2014
100
106
 
101
107
  * Use rspec 3.1 syntax.
@@ -47,13 +47,17 @@ double getDistanceInternal( char *s1, char *s2 )
47
47
  char *_min;
48
48
  int _max_length = 0;
49
49
  int _min_length = 0;
50
- if ( strlen(s1) > strlen(s2) ) {
51
- _max = s1; _max_length = (int)strlen(s1);
52
- _min = s2; _min_length = (int)strlen(s2);
50
+
51
+ int _s1_length = (int)strlen(s1);
52
+ int _s2_length = (int)strlen(s2);
53
+
54
+ if ( _s1_length > _s2_length ) {
55
+ _max = s1; _max_length = _s1_length;
56
+ _min = s2; _min_length = _s2_length;
53
57
  }
54
58
  else {
55
- _max = s2; _max_length = (int)strlen(s2);
56
- _min = s1; _min_length = (int)strlen(s1);
59
+ _max = s2; _max_length = _s2_length;
60
+ _min = s1; _min_length = _s1_length;
57
61
  }
58
62
  int range = max( _max_length / 2 - 1, 0 );
59
63
 
@@ -143,7 +147,7 @@ double getDistanceInternal( char *s1, char *s2 )
143
147
  return 0.0;
144
148
  }
145
149
  int t = transpositions / 2;
146
- double j = ((m / strlen(s1) + m / strlen(s2) + (m - t) / m)) / 3;
150
+ double j = ((m / _s1_length + m / _s2_length + (m - t) / m)) / 3;
147
151
  double jw = j < 0.7 ? j : j + double_min(0.1, 1.0 / _max_length) * prefix
148
152
  * (1 - j);
149
153
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuzzy-string-match
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiyoka Nishiyama
@@ -14,28 +14,28 @@ dependencies:
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.1.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: RubyInline
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.8.6
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
40
  version: 3.8.6
41
41
  description: calculate Jaro Winkler distance.
@@ -46,7 +46,7 @@ extra_rdoc_files:
46
46
  - LICENSE.txt
47
47
  - README.md
48
48
  files:
49
- - .gemtest
49
+ - ".gemtest"
50
50
  - LICENSE.txt
51
51
  - README.md
52
52
  - Rakefile
@@ -68,17 +68,17 @@ require_paths:
68
68
  - lib
69
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 1.9.1
73
+ version: 2.1.0
74
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '>='
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
80
  rubyforge_project:
81
- rubygems_version: 2.0.14
81
+ rubygems_version: 2.6.8
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: fuzzy string matching library