private static byte[] getSoundex(String str) {
        byte[] chars = {'0', '0', '0', '0'};
        byte lastDigit = '0';
        for (int i = 0, j = 0, l = str.length(); i < l && j < 4; i++) {
            char c = str.charAt(i);
            if (c >= 'A' && c <= 'z') {
                byte newDigit = SOUNDEX_INDEX[c - 'A'];
                if (newDigit != 0) {
                    if (j == 0) {
                        chars[j++] = (byte) (c & 0xdf); // Converts a-z to A-Z
                        lastDigit = newDigit;
                    } else if (newDigit <= '6') {
                        if (newDigit != lastDigit) {
                            chars[j++] = lastDigit = newDigit;
                        }
                    } else if (newDigit == '7') {
                        lastDigit = newDigit;
                    }
                }
            }
        }
        return chars;
    }
SoundexFunction  ->  soundex(str)
description:
- Return NULL if 'str' is NULL
- Return a four character code representing the sound of 'str'
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/string/SoundexFunction.java