You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ben-Waters (via GitHub)" <gi...@apache.org> on 2023/06/26 23:29:09 UTC

[GitHub] [commons-codec] Ben-Waters commented on a diff in pull request #189: CODEC-308: change NYSIIS encoding to not remove the first character i…

Ben-Waters commented on code in PR #189:
URL: https://github.com/apache/commons-codec/pull/189#discussion_r1242928389


##########
src/test/java/org/apache/commons/codec/language/NysiisTest.java:
##########
@@ -140,7 +140,8 @@ public void testDropBy() throws EncoderException {
                 new String[] { "JILES", "JAL" },
                 // violates 6: if the last two characters are AY, remove A
                 new String[] { "CARRAWAY", "CARY" },       // Original: CARAY
-                new String[] { "YAMADA", "YANAD" });
+                new String[] { "YAMADA", "YANAD" },
+                new String[] { "ASH", "A"});

Review Comment:
   Based on this [other implementation](http://www.dropby.com/indexLF.html?content=/NYSIIS.html) it would be just A.
   
   According to the [algorithm](https://en.wikipedia.org/wiki/New_York_State_Identification_and_Intelligence_System), the final character should be removed if it is an 'S' so I would think it should be removed.
   
   The current commons-codec implementation is removing it as well as the final 'A' but is ignoring the part about "The first character of the NYSIIS code is the first character of the name."



-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org