STD.Metaphone.Secondary( source )
STD.Metaphone3.Secondary( source )
source | The string to process. |
Return: | Secondary returns a STRING value. |
The Secondary function returns a textual representation of the source data, similar to a Soundex code. This function returns the second return value from the Double Metaphone algorithm.
The Metaphone3.SecondaryPrimary 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));