This is an automated email from the ASF dual-hosted git repository. krickert pushed a commit to branch feat/GH-1347-unicode-emoji-18 in repository https://gitbox.apache.org/repos/asf/opennlp.git
commit be96f4a29455e0649dc9a87961e655e6d3f0a9af Author: Kristian Rickert <[email protected]> AuthorDate: Thu Oct 1 18:34:00 2026 -0400 GH-1347: Expect annotation records for the 19 emoji added in Emoji 18.0 The audit now pins 59 records and 236 rows and looks up each Emoji 18.0 addition by its emoji-test.txt short name. Against the current table this fails with 20 failures: expected 59 but was 40, and no record for any of the 19 sequences. --- .../util/normalizer/EmojiAnnotationsTest.java | 53 +++++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/util/normalizer/EmojiAnnotationsTest.java b/opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/util/normalizer/EmojiAnnotationsTest.java index 51beda7e6..918e2cb10 100644 --- a/opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/util/normalizer/EmojiAnnotationsTest.java +++ b/opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/util/normalizer/EmojiAnnotationsTest.java @@ -27,6 +27,7 @@ import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import static opennlp.tools.util.normalizer.NormalizerTestUtil.cp; @@ -111,12 +112,60 @@ public class EmojiAnnotationsTest { // Locks the bundled counts so a data edit trips this test for a conscious bump, the same // discipline as the emoji-emoticons.txt and CaseFolding.txt audits. final Map<String, EmojiAnnotation> annotations = bundled(); - assertEquals(40, annotations.size()); + assertEquals(59, annotations.size()); int rowCount = 0; for (final EmojiAnnotation annotation : annotations.values()) { rowCount += annotation.attributes().size(); } - assertEquals(160, rowCount); + assertEquals(236, rowCount); + } + + /** + * The nine pictographs and ten skin tone sequences that Emoji 18.0 added, with the short names + * printed in the 18.0 emoji-test.txt, each bundled as its own record. + */ + private static Stream<Arguments> emoji18Additions() { + return Stream.of( + Arguments.of(cp(0x1FAEB), "cracking face", EmojiCategory.SMILEYS_AND_EMOTION), + Arguments.of(cp(0x1FAF9), "leftwards thumb sign", EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAF9, 0x1F3FB), "leftwards thumb sign: light skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAF9, 0x1F3FC), "leftwards thumb sign: medium-light skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAF9, 0x1F3FD), "leftwards thumb sign: medium skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAF9, 0x1F3FE), "leftwards thumb sign: medium-dark skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAF9, 0x1F3FF), "leftwards thumb sign: dark skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA), "rightwards thumb sign", EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA, 0x1F3FB), "rightwards thumb sign: light skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA, 0x1F3FC), "rightwards thumb sign: medium-light skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA, 0x1F3FD), "rightwards thumb sign: medium skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA, 0x1F3FE), "rightwards thumb sign: medium-dark skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FAFA, 0x1F3FF), "rightwards thumb sign: dark skin tone", + EmojiCategory.PEOPLE_AND_BODY), + Arguments.of(cp(0x1FACC), "monarch butterfly", EmojiCategory.ANIMALS_AND_NATURE), + Arguments.of(cp(0x1FADD), "pickle", EmojiCategory.FOOD_AND_DRINK), + Arguments.of(cp(0x1F6D9), "lighthouse", EmojiCategory.TRAVEL_AND_PLACES), + Arguments.of(cp(0x1FA8B), "meteor", EmojiCategory.TRAVEL_AND_PLACES), + Arguments.of(cp(0x1FA8C), "eraser", EmojiCategory.OBJECTS), + Arguments.of(cp(0x1FA8D), "net with handle", EmojiCategory.OBJECTS)); + } + + @ParameterizedTest(name = "{1}") + @MethodSource("emoji18Additions") + void everyEmoji18AdditionIsAnnotated(String symbol, String name, EmojiCategory category) { + final EmojiAnnotation annotation = EmojiAnnotations.lookup(symbol).orElseThrow( + () -> new AssertionError("No annotation record for Emoji 18.0 addition: " + name)); + assertEquals(name, annotation.name().orElseThrow()); + assertEquals(category, annotation.category().orElseThrow()); + annotation.sentiment().orElseThrow(); + annotation.entityType().orElseThrow(); } @Test
