ViniciusSouzaRoque commented on code in PR #12716: URL: https://github.com/apache/arrow/pull/12716#discussion_r850327482
########## cpp/src/gandiva/precompiled/string_ops.cc: ########## @@ -2789,20 +2789,19 @@ static char mappings[] = {'0', '1', '2', '3', '0', '1', '2', '0', '0', // the input string followed by a phonetic code. Characters that are not alphabetic are // ignored. If expression evaluates to the null value, null is returned. // -// The soundex algorith works with the following steps: +// The soundex algorithm works with the following steps: // 1. Retain the first letter of the string and drop all other occurrences of a, e, i, -// o, u, y, h, w. +// o, u, y, h, w. (let's call them special letters) // 2. Replace consonants with digits as follows (after the first letter): // b, f, p, v → 1 // c, g, j, k, q, s, x, z → 2 // d, t → 3 // l → 4 // m, n → 5 // r → 6 -// 3. If two or more letters with the same number are adjacent in the original name -// (before step 1), only retain the first letter; also two letters with the same number -// separated by 'h' or 'w' are coded as a single number, whereas such letters separated -// by a vowel are coded twice. This rule also applies to the first letter. +// 3. If two or more letters with the same number were adjacent in the original name +// (before step 1), or adjacent for any intervening from any special letters, then omit Review Comment: simply adjacent: **BB** or **CC** or **DD** adjacent with special intervening: **B**A**B**, **C**H**C**, **D**AAAAA**D** For any of these cases, the result is always B, C, D -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org