Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - soundex() convert string to soundex form http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 soundex()           Convert string to soundex form
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char(4) soundex extern
   param value uint cString

 Arguments
   cString is the character string to convert.

 Return
   A four-digit soundex string in the form "X000".

 Description
   The soundex() function returns a phonetic derivative of the input
   string. Indexing and searching for soundex-converted strings is used
   in applications where the precise spelling of character keys is not
   known or where there is a high probability of misspelled names. The
   soundex() function works by bringing sound-alikes together under the
   same key value.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_soundex
   // Identical soundex values for similar names
   ? soundex( "Smith" )        // S530
   ? soundex( "Smythe" )       // S530
   ? soundex( "Schmidt" )      // S530
   ? soundex( "Schmitt" )      // S530
   
   // Different soundex value for an unrelated name
   ? soundex( "Shylock" )      // S420
   
   // Non-alphabetic strings return "0000"
   ? soundex( "" )             // 0000
   ? soundex( "-=" )           // 0000
   ? soundex( "120373" )       // 0000
   ? soundex( "@#$%73" )       // 0000
   endproc

   proc main
   Test_soundex()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson