Skip to content

GH-1458: Parse name-finder tags and parse-tree strings without regular expressions - #1459

Merged
rzo1 merged 5 commits into
mainfrom
gh-regex-namesample-parse
Oct 9, 2026
Merged

rzo1 merged 5 commits into
mainfrom
gh-regex-namesample-parse

Conversation

@rzo1

@rzo1 rzo1 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

NameSample start tags and Parse labels, function tags and tokens are now recognised by character scans that reproduce the former expressions exactly, pinned by parameterized tests that use the old patterns as oracles. The forbiddenapis guard in #1348 depends on this change. Because training-data parsing for the name finder and parser goes through this code, an eval build is advisable before merging.

Fixes #1458

@rzo1 rzo1 added this to the 3.0.0 milestone Oct 9, 2026
@rzo1 rzo1 self-assigned this Oct 9, 2026
Replaces the character literals in the new scans with named constants and reuses
UnicodeWhitespace.SPACE and CARRIAGE_RETURN in StringUtil.isAsciiWhitespace.
Comment thread opennlp-api/src/main/java/opennlp/tools/namefind/NameSample.java Outdated
rzo1 added 3 commits October 9, 2026 11:02
Valid inputs, the rejected empty type and invalid inputs are now separate tests with
explicit expected values; the former regular expressions remain as cross-checks.

@mawiesne mawiesne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR in good shape now. +1

@rzo1
rzo1 merged commit e286928 into main Oct 9, 2026
10 checks passed
@rzo1
rzo1 deleted the gh-regex-namesample-parse branch October 9, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse name-finder tags and parse-tree strings without regular expressions

2 participants