Metaphone3.ecl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*##############################################################################
  2. ## HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®. All rights reserved.
  3. ############################################################################## */
  4. EXPORT Metaphone3 := MODULE
  5. IMPORT lib_metaphone3;
  6. /**
  7. * Returns the primary metaphone value
  8. *
  9. * @param src The string whose metphone is to be calculated.
  10. * @see http://en.wikipedia.org/wiki/Metaphone#Metaphone_3
  11. */
  12. EXPORT String primary(STRING src, boolean encodeVowels=false, boolean encodeExact=false, unsigned4 maxLength=0) :=
  13. lib_metaphone3.Metaphone3Lib.Metaphone3(src, encodeVowels, encodeExact, maxLength);
  14. /**
  15. * Returns the secondary metaphone value
  16. *
  17. * @param src The string whose metphone is to be calculated.
  18. * @see http://en.wikipedia.org/wiki/Metaphone#Metaphone_3
  19. */
  20. EXPORT String secondary(STRING src, boolean encodeVowels=false, boolean encodeExact=false, unsigned4 maxLength=0) :=
  21. lib_metaphone3.Metaphone3Lib.Metaphone3Alt(src, encodeVowels, encodeExact, maxLength);
  22. /**
  23. * Returns the double metaphone value (primary and secondary concatenated)
  24. *
  25. * @param src The string whose metphone is to be calculated.
  26. * @see http://en.wikipedia.org/wiki/Metaphone#Metaphone_3
  27. */
  28. EXPORT String double(STRING src, boolean encodeVowels=false, boolean encodeExact=false, unsigned4 maxLength=0) :=
  29. lib_metaphone3.Metaphone3Lib.Metaphone3Both(src, encodeVowels, encodeExact, maxLength);
  30. END;