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 +4 -4
- data/ext/soundx/soundx.c +19 -1
- data/lib/soundx/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 382ab85be43b21e554893e2cafc65a42c587d18420830567887959a0d719e5d5
|
4
|
+
data.tar.gz: 359b39ef99a1c023409a008f28e459fd6bcc1fea5cc35b706d6ba838c36a8dba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d80a54295992e284245e66e81bd9e4640a292112b3c76da45db979dd9e4e978b356f759fb0d1e62f12406664ec71306b482d7aa54b7828fd11149571b310d2a
|
7
|
+
data.tar.gz: a1e5d79cb2869d3609729bf4fe5420baec7f6a2a7306c1de103affbe119756b8d745002c0ea34add80451ddbef2fdc72b804148691f6205c5e03108e5383830b
|
data/ext/soundx/soundx.c
CHANGED
@@ -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
|
-
|
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) {
|
data/lib/soundx/version.rb
CHANGED
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.
|
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:
|
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.
|
84
|
+
rubygems_version: 3.1.2
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Soundex library written in C
|