Double

STD.Metaphone.Double( source )

STD.Metaphone3.Double( source )

sourceThe string to process.
Return: Double returns a STRING value.

The Double function returns a textual representation of the source data, similar to a Soundex code. This function returns both return values from the Double Metaphone algorithm, concatenating the two into a single result string.

The Metaphone3.Double function uses the newer Metaphone 3 libraries which improve phonetic encoding of English words, non-English words familiar to Americans, and first and last names commonly found in the United States (Enterprise Edition only).

Example:

r := RECORD 
  STRING source; 
  STRING M1; 
  STRING M2; 
  STRING Mboth;
END;

r XF(ProgGuide.Person.File L) := TRANSFORM 
  SELF.source := L.LastName;
  SELF.M1     := STD.Metaphone.Primary( L.LastName ); 
  SELF.M2     := STD.Metaphone.Secondary( L.LastName ); 
  SELF.Mboth  := STD.Metaphone.Double( L.LastName );
END;

// Example using Metaphone 3 (available in Enterprise Edition)
/* 
r XF(ProgGuide.Person.File L) := TRANSFORM 
     SELF.source := L.LastName;
     SELF.M1     := STD.Metaphone3.Primary( L.LastName ); 
     SELF.M2     := STD.Metaphone3.Secondary( L.LastName ); 
     SELF.Mboth  := STD.Metaphone3.Double( L.LastName );
   END;
*/

ds := PROJECT(ProgGuide.Person.File,XF(LEFT)); 

COUNT(ds);
COUNT(ds(M1 <> M2)); 
OUTPUT(ds); 
OUTPUT(ds(M1 <> M2));