@Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    Object obj0;
    if ((obj0 = arguments[0].get()) == null) {
      return null;
    }

    String str0 = textConverters[0].convert(obj0).toString();
    String soundexCode;
    try {
      soundexCode = soundex.soundex(str0);
    } catch (IllegalArgumentException e) {
      return null;
    }
    output.set(soundexCode);
    return output;
  }
GenericUDFSoundex.

Soundex is an encoding used to relate similar names, but can also be used as
a general purpose scheme to find word with similar phonemes.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSoundex.java