You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2026/09/18 10:09:58 UTC

[PR] OPENNLP-1973: Regex removal (prep): Add a CompatibilityMode switch for the earlier output (opennlp)

rzo1 opened a new pull request, #1312:
URL: https://github.com/apache/opennlp/pull/1312

   Prerequisite for the regex removal (OPENNLP-1926). Split out of #1275.
   
   Adds `opennlp.tools.util.CompatibilityMode` to opennlp-api with `LEGACY` and `CURRENT`, resolved from `-Dopennlp.compat.mode` at startup and overridable with `setActive` and `reset`. `CURRENT` is the default; `LEGACY` logs one warning per process. Built like the whitespace mode switch and scheduled for removal in 4.0 with it.
   
   Classes whose output was corrected consult it so that models trained with an earlier release still get the input they were trained on. Users: the EmojiCharSequenceNormalizer fix (part 8, OPENNLP-1974, stacked on this PR) and the surrogate rule of #1281 (OPENNLP-1934).
   
   ## Open question for review
   
   The mode is process-wide static state. Two applications sharing one OpenNLP on a class path cannot choose different modes, and the mode is not recorded in the model. Alternatives: keep the old behavior in the deprecated class and put the fix in a new normalizer, or record the behavior in the model manifest.
   
   Commits by @krickert from #1275, regrouped.
   


-- 
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: commits-unsubscribe@opennlp.apache.org

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


Re: [PR] OPENNLP-1973: Regex removal (prep): Add a CompatibilityMode switch for the earlier output (opennlp)

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 merged PR #1312:
URL: https://github.com/apache/opennlp/pull/1312


-- 
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: commits-unsubscribe@opennlp.apache.org

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


Re: [PR] OPENNLP-1973: Regex removal (prep): Add a CompatibilityMode switch for the earlier output (opennlp)

Posted by "krickert (via GitHub)" <gi...@apache.org>.
krickert commented on PR #1312:
URL: https://github.com/apache/opennlp/pull/1312#issuecomment-5728601056

   Thank you for doing this!


-- 
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: commits-unsubscribe@opennlp.apache.org

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


Re: [PR] OPENNLP-1973: Regex removal (prep): Add a CompatibilityMode switch for the earlier output (opennlp)

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #1312:
URL: https://github.com/apache/opennlp/pull/1312#issuecomment-5729020457

   Thanks! Added the sentence on class initialization to the `MODE_PROPERTY` Javadoc. Merging `fromProperty`/`warnIfLegacy` with `WhitespaceMode` would touch a class already on main, so I'd leave that for a separate cleanup.


-- 
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: commits-unsubscribe@opennlp.apache.org

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