OPENNLP-1850: UAX #29 word tokenizer — WordSegmenter, WordTokenizer, WordType (2a/7)#1110
Draft
krickert wants to merge 3 commits into
Draft
OPENNLP-1850: UAX #29 word tokenizer — WordSegmenter, WordTokenizer, WordType (2a/7)#1110krickert wants to merge 3 commits into
krickert wants to merge 3 commits into
Conversation
This was referenced Jun 23, 2026
08de0d3 to
9af6d92
Compare
a450069 to
dc02b9e
Compare
…rdType (2a) Splits the former tokenizer PR (#1104) into the UAX #29 tokenizer (this PR), the Term model (2b), and the NormalizationProfile registry (2c), on review request. Self-contained: the conformant WordSegmenter/WordTokenizer/WordType/WordToken over the bundled Word_Break and Extended_Pictographic data (loaded lazily and recoverably via a double-checked accessor, no static-init resource I/O), the official WordBreakTest conformance suite, and the Unicode data LICENSE/NOTICE/rat-excludes. Builds on the alignment layer in 1b.
WordBreakProperty.parse threw an opaque StringIndexOutOfBoundsException on a non-comment line with no ';' (substring(0, -1)), unlike the sibling ExtendedPictographic.parse which guards it. It now throws IllegalStateException naming the offending line. Exposed parse() package-visibly; WordBreakPropertyTest proves the red->green. Real Word_Break data still loads (conformance suite).
… shared Lazy holder Both loaders' hand-rolled double-checked lazy accessor is replaced by the shared opennlp.tools.util.Lazy (introduced with Confusables in the engine), so the recoverable lazy-load pattern lives in one place instead of three near-identical copies. Behavior-preserving; conformance + loader tests green.
9af6d92 to
9dc7d51
Compare
dc02b9e to
dd1906d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2a of the OPENNLP-1850 stack. Splits the former tokenizer PR (#1104) into the UAX #29 tokenizer (this PR), the Term model (2b), and the NormalizationProfile registry (2c), as requested in review.
Self-contained: the Unicode-conformant
WordSegmenter/WordTokenizer/WordType/WordTokenover the bundledWord_BreakandExtended_Pictographicdata, the officialWordBreakTest.txtconformance suite (1944/1944), and the Unicode dataLICENSE/NOTICE/rat-excludes.WordBreakPropertyandExtendedPictographicload their data lazily and recoverably (double-checked accessor, no classpath resource I/O in astatic {}block), per the same review point as on the foundation — so a resource the loader cannot see is a catchable exception at call time, not a class-poisoningExceptionInInitializerError.Base:
OPENNLP-1850-1b-alignment(#1109). Stack: 1a → 1b → 2a (this) → 2b → 2c → DL → docs.