Rdb: Ruby-Nachbau der MWC /rdb-Werkzeuge
This commit is contained in:
+108
@@ -0,0 +1,108 @@
|
||||
.TH soundex "" "" "/rdb Command"
|
||||
.PC "Convert a name into soundex code"
|
||||
\fBsoundex < \fIfile \fB> \fIfile\fB.x ; index -mb \fIfile.x\fB Soundex\fR
|
||||
.PP
|
||||
.II "file^convert to soundex"
|
||||
.II "string^convert to soundex"
|
||||
.II "Knuth, Donald"
|
||||
The command
|
||||
.B soundex
|
||||
creates a secondary index to
|
||||
.I file
|
||||
based on Knuth's soundex code.
|
||||
It is used by the
|
||||
.B /rdb
|
||||
command
|
||||
.B like
|
||||
to find a name that sounds like another name.
|
||||
.PP
|
||||
The output must be written into file
|
||||
\fIfile\fB.x\fR; then run the command
|
||||
.B index
|
||||
on column
|
||||
.B Soundex
|
||||
within
|
||||
.IB table .x
|
||||
to ensure a high-speed search.
|
||||
.SH Example
|
||||
Consider table
|
||||
.BR name ,
|
||||
which has many similar names in it:
|
||||
.DM
|
||||
Name
|
||||
----
|
||||
Abraham
|
||||
Abraham
|
||||
Ackerman
|
||||
Actor
|
||||
Adams
|
||||
Adams
|
||||
Adams
|
||||
Adams
|
||||
\&...
|
||||
.DE
|
||||
.PP
|
||||
Use
|
||||
.B soundex
|
||||
to create the secondary index file, as follows:
|
||||
.DM
|
||||
soundex < name > name.x ; index -mb name.x Soundex
|
||||
.DE
|
||||
.PP
|
||||
The soundex'd index file appears as follows:
|
||||
.DM
|
||||
.ta 1.0i
|
||||
Name Soundex
|
||||
---- -------
|
||||
Avila A140
|
||||
Avila A140
|
||||
Avila A140
|
||||
Abraham A160
|
||||
Abraham A160
|
||||
Aissen A220
|
||||
Ajeska A220
|
||||
Augustine A223
|
||||
\&...
|
||||
.DE
|
||||
.PP
|
||||
Now you can use the
|
||||
.B like
|
||||
command to find a name.
|
||||
For example, the command
|
||||
.DM
|
||||
like Manis name
|
||||
.DE
|
||||
.PP
|
||||
produces something like:
|
||||
.DM
|
||||
Name
|
||||
----
|
||||
Mann
|
||||
Mann
|
||||
Means
|
||||
Mink
|
||||
Monahan
|
||||
Moniz
|
||||
Mooney
|
||||
Mooney
|
||||
Munoz
|
||||
Munoz
|
||||
.DE
|
||||
.PP
|
||||
Or the command
|
||||
.DM
|
||||
like Schaffer name
|
||||
.DE
|
||||
.PP
|
||||
produces something like:
|
||||
.DM
|
||||
Name
|
||||
----
|
||||
Schaeffer
|
||||
Schaffer
|
||||
Schiffrin
|
||||
.DE
|
||||
.SH "See Also"
|
||||
.B
|
||||
like
|
||||
.R
|
||||
Reference in New Issue
Block a user