You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/modules/soundex.reb
+68-65
Original file line number
Diff line number
Diff line change
@@ -1,78 +1,81 @@
1
1
REBOL [
2
-
Title:"Soundex"
3
-
Date: 16-Jul-2024
4
-
File:%soundex.r
5
-
Author:"Allen Kamp, Oldes"
6
-
Purpose:{Soundex Encoding returns similar codes for similar sounding words or names. eg Stephens, Stevens are both S315, Smith and Smythe are both S53. Useful for adding Sounds-like searching to databases}
7
-
Comment:{
8
-
This is the basic Soundex algorithm (There are a number of different
9
-
one floating around)
2
+
Title:"Soundex"
3
+
Date: 16-Jul-2024
4
+
File:%soundex.reb
5
+
Author:"Allen Kamp, Oldes"
6
+
Purpose:{Soundex Encoding returns similar codes for similar sounding words or names. eg Stephens, Stevens are both S315, Smith and Smythe are both S53. Useful for adding Sounds-like searching to databases}
7
+
Comment:{
8
+
This is the basic Soundex algorithm: https://en.wikipedia.org/wiki/Soundex
10
9
11
-
1. Remove vowels, H, W and Y
12
-
2. Encode each char with its code value
13
-
3. Remove adjacent duplicate numbers
10
+
1. Remove vowels, H, W and Y
11
+
2. Encode each char with its code value
12
+
3. Remove adjacent duplicate numbers
14
13
15
-
4. Return First letter, followed by the next 3 letter's code
16
-
numbers, if they exist.
14
+
4. Return First letter, followed by the next 3 letter's code
15
+
numbers, if they exist.
17
16
18
-
TODO: Other algorithms: Extended Soundex, Metaphone and the LC Cutter table
19
-
}
20
-
Language:"English"
21
-
Email:%allenk--powerup--com--au
22
-
library: [
23
-
level: 'intermediate
24
-
platform: 'all
25
-
type: 'tool
26
-
domain: [DB text text-processing]
27
-
tested-under: none
28
-
support: none
29
-
license: none
30
-
see-also: none
31
-
]
32
-
Version: 1.1.0
33
-
Type: module
34
-
Exports: [soundex]
35
-
Needs: 3.0.0
36
-
History: [
37
-
17-Jul-1999 @Allen "Initial version"
38
-
16-Jul-2024 @Oldes "Ported to Rebol3"
17
+
TODO: Other algorithms: Extended Soundex, Metaphone and the LC Cutter table
18
+
}
19
+
Version: 2.0.0
20
+
Type: module
21
+
Name: soundex
22
+
Exports: [soundex]
23
+
Needs: 3.0.0
24
+
History: [
25
+
17-Jul-1999 @Allen "Initial version"
26
+
16-Jul-2024 @Oldes "Ported to Rebol3"
39
27
40
-
]
28
+
]
41
29
]
42
30
43
31
soundex: function/with [
44
-
{Returns the Census Soundex Code for the given string}
45
-
string [any-string!] "String to Encode"
32
+
{Returns the Census Soundex Code for the given string}
0 commit comments