protected void checkIfStringGroup(ObjectInspector[] arguments, int i, String argOrder)
      throws UDFArgumentTypeException {
    inputTypes[i] = ((PrimitiveObjectInspector) arguments[i]).getPrimitiveCategory();
    if (PrimitiveObjectInspectorUtils.getPrimitiveGrouping(inputTypes[i]) != PrimitiveGrouping.STRING_GROUP &&
        PrimitiveObjectInspectorUtils.getPrimitiveGrouping(inputTypes[i]) != PrimitiveGrouping.VOID_GROUP) {
      throw new UDFArgumentTypeException(i, getFuncName() + " only takes STRING_GROUP types as "
          + argOrder + " argument, got " + inputTypes[i]);
    }
  }
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