soundx 1.0.5 → 1.0.7

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: 86f425b567e457397df034bf61c511f8a4b783f4c16d0ff71947fcd752f9ecee
4
- data.tar.gz: 4155a8c79c3992726445fe4c94401c4070328fd89aa6622a45c5bd575fff62c9
3
+ metadata.gz: 382ab85be43b21e554893e2cafc65a42c587d18420830567887959a0d719e5d5
4
+ data.tar.gz: 359b39ef99a1c023409a008f28e459fd6bcc1fea5cc35b706d6ba838c36a8dba
5
5
  SHA512:
6
- metadata.gz: '08d87b1bf5134634ab9738b8c5e03ca4faa2a45786c82416e8bcd3397b6eee2da3d8674a2f24a884da74a17b317e93bbcd13ea68917d56646d52dc1cf811f9ed'
7
- data.tar.gz: 745e1d8033be4534f915f7402bf0847e20d6a471b5a9361790e109d1340f5cd6d94abd7ddc70df2ae82ef93d6e2373f1fdc5913a4bcf5145ed38c1739908696b
6
+ metadata.gz: 0d80a54295992e284245e66e81bd9e4640a292112b3c76da45db979dd9e4e978b356f759fb0d1e62f12406664ec71306b482d7aa54b7828fd11149571b310d2a
7
+ data.tar.gz: a1e5d79cb2869d3609729bf4fe5420baec7f6a2a7306c1de103affbe119756b8d745002c0ea34add80451ddbef2fdc72b804148691f6205c5e03108e5383830b
@@ -100,10 +100,28 @@ rb_soundx(int argc, VALUE* argv, VALUE self)
100
100
  }
101
101
 
102
102
  // Skip if previous character is the same
103
- if (dest[written] == match) {
103
+ // e.g. Gutierrez (2nd 'r' ignored)
104
+ if (src[i] == src[i-1]) {
104
105
  continue;
105
106
  }
106
107
 
108
+ // If the surname has different letters side-by-side that have the same number
109
+ // in the soundex coding guide, they should be treated as one letter.
110
+ // e.g. Jackson
111
+ if (mapping[current] == mapping[tolower(src[i-1])] && src[i] != src[i-1]) {
112
+ continue;
113
+ }
114
+
115
+
116
+ // If "H" or "W" separate two consonants that have the same soundex code,
117
+ // the consonant to the right of the vowel is not coded.
118
+ if (i+1 < srclen && (current == 'h' || current == 'w')) {
119
+ if(dest[written] == mapping[tolower(src[i+1])]) {
120
+ i = i + 1; // Skip over the next consonant
121
+ continue;
122
+ }
123
+ }
124
+
107
125
  // We landed on a vowel-like character,
108
126
  // so skip to the next char
109
127
  if ('0' == match) {
@@ -1,3 +1,3 @@
1
1
  module SoundX
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soundx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Cook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-22 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 3.0.3
84
+ rubygems_version: 3.1.2
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Soundex library written in C