You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by kr...@apache.org on 2026/09/07 11:14:07 UTC

(opennlp) branch OPENNLP-1833-grpc-helper updated (79cdd23a0 -> 4d2579294)

This is an automated email from the ASF dual-hosted git repository.

krickert pushed a change to branch OPENNLP-1833-grpc-helper
in repository https://gitbox.apache.org/repos/asf/opennlp.git


    from 79cdd23a0 Merge remote-tracking branch 'upstream/pr/1275' into OPENNLP-1833-grpc-helper
     add 3c64987e8 OPENNLP-1927: Reject unsupported Hunspell affix directives by default
     add 6765c04a5 OPENNLP-1927: Expand Hunspell stemming and analysis compatibility
     add 1ecdf72b5 OPENNLP-1927: Align Hunspell stemming details with the reference implementation
     add f4f542e67 OPENNLP-1927: Add the remaining reference recognition rules
     add ba16fa941 OPENNLP-1927: Document Hunspell deviations and correct the KEEPCASE sharp s rule
     add 1f9a7bfbe OPENNLP-1927: Keep a dotted capital I when capitalizing an all-uppercase word
     add b194f2162 OPENNLP-1927: Keep reference outcomes in the tests instead of forking a native driver
     new 4d2579294 Merge remote-tracking branch 'upstream/pr/1270' into OPENNLP-1833-grpc-helper

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dev/README-hunspell-dictionaries.md                |  176 ++-
 .../tools/stemmer/hunspell/HunspellAffixTable.java |   84 ++
 .../stemmer/hunspell/HunspellCompoundRule.java     |  157 ++
 .../tools/stemmer/hunspell/HunspellConversion.java |  189 +++
 .../tools/stemmer/hunspell/HunspellDictionary.java | 1547 ++++++++++++++++++--
 .../tools/stemmer/hunspell/HunspellStemmer.java    | 1392 +++++++++++++++---
 .../hunspell/HunspellCompatibilityTest.java        |  429 ++++++
 .../stemmer/hunspell/HunspellCompletionTest.java   |  408 ++++++
 .../hunspell/HunspellDictionaryLoadTest.java       |  442 ++++++
 .../hunspell/HunspellManualExampleTest.java        |   43 +
 .../hunspell/HunspellRealDictionaryTest.java       |  126 --
 .../stemmer/hunspell/HunspellStemmerTest.java      |   76 +-
 opennlp-docs/src/docbkx/stemmer.xml                |  174 ++-
 .../tools/eval/HunspellCompatibilityEval.java      |  530 +++++++
 14 files changed, 5305 insertions(+), 468 deletions(-)
 create mode 100644 opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/stemmer/hunspell/HunspellAffixTable.java
 create mode 100644 opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/stemmer/hunspell/HunspellCompoundRule.java
 create mode 100644 opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/stemmer/hunspell/HunspellConversion.java
 create mode 100644 opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/stemmer/hunspell/HunspellCompatibilityTest.java
 create mode 100644 opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/stemmer/hunspell/HunspellCompletionTest.java
 create mode 100644 opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/stemmer/hunspell/HunspellDictionaryLoadTest.java
 delete mode 100644 opennlp-core/opennlp-runtime/src/test/java/opennlp/tools/stemmer/hunspell/HunspellRealDictionaryTest.java
 create mode 100644 opennlp-eval-tests/src/test/java/opennlp/tools/eval/HunspellCompatibilityEval.java


(opennlp) 01/01: Merge remote-tracking branch 'upstream/pr/1270' into OPENNLP-1833-grpc-helper

Posted by kr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

krickert pushed a commit to branch OPENNLP-1833-grpc-helper
in repository https://gitbox.apache.org/repos/asf/opennlp.git

commit 4d25792943a899d62119ac7429b28a7019fd482d
Merge: 79cdd23a0 b194f2162
Author: Kristian Rickert <kr...@apache.org>
AuthorDate: Mon Sep 7 07:12:59 2026 -0400

    Merge remote-tracking branch 'upstream/pr/1270' into OPENNLP-1833-grpc-helper

 dev/README-hunspell-dictionaries.md                |  176 ++-
 .../tools/stemmer/hunspell/HunspellAffixTable.java |   84 ++
 .../stemmer/hunspell/HunspellCompoundRule.java     |  157 ++
 .../tools/stemmer/hunspell/HunspellConversion.java |  189 +++
 .../tools/stemmer/hunspell/HunspellDictionary.java | 1547 ++++++++++++++++++--
 .../tools/stemmer/hunspell/HunspellStemmer.java    | 1392 +++++++++++++++---
 .../hunspell/HunspellCompatibilityTest.java        |  429 ++++++
 .../stemmer/hunspell/HunspellCompletionTest.java   |  408 ++++++
 .../hunspell/HunspellDictionaryLoadTest.java       |  442 ++++++
 .../hunspell/HunspellManualExampleTest.java        |   43 +
 .../hunspell/HunspellRealDictionaryTest.java       |  126 --
 .../stemmer/hunspell/HunspellStemmerTest.java      |   76 +-
 opennlp-docs/src/docbkx/stemmer.xml                |  174 ++-
 .../tools/eval/HunspellCompatibilityEval.java      |  530 +++++++
 14 files changed, 5305 insertions(+), 468 deletions(-)

diff --cc opennlp-docs/src/docbkx/stemmer.xml
index e599d91b8,0b8601dc1..cda3bc78c
--- a/opennlp-docs/src/docbkx/stemmer.xml
+++ b/opennlp-docs/src/docbkx/stemmer.xml
@@@ -120,49 -261,14 +262,57 @@@ analyzer.analyze("table");   // []]]
  			declares <code>FULLSTRIP</code>, as in Hunspell itself.
  			Each affix or dictionary stream is rejected when it exceeds
  			<code>HunspellDictionary.MAX_STREAM_BYTES</code> (64&#160;MiB).
+ 			Search permits at most 64 compound components, 2048 compound candidate
+ 			checks per case variant, and 2048 word-break attempts per input. Sharp-s
+ 			expansion permits at most 64 case variants. Output is limited to 2048
+ 			distinct results. Compound-rule patterns permit 4096 flag elements.
+ 			Simplified triple letters can be restored at multiple junctions;
+ 			<code>CHECKCOMPOUNDPATTERN</code> replacement applies at one junction.
+ 			These limits can exclude valid analyses; candidates must pass validation
+ 			before inclusion in the result.
  		</para>
  	</section>
 +
 +	<section xml:id="tools.stemmer.light">
 +		<title>Light and minimal stemmers</title>
 +		<para>
 +			The package <code>opennlp.tools.stemmer.light</code> provides light and minimal
 +			stemmers based on algorithms in Apache Lucene's analysis-common module.
 +			Light stemmers remove a modest set of endings; minimal stemmers remove fewer.
 +			Instances are immutable, safe for concurrent use, and implement
 +			<code>StemmerFactory</code>. Input must use lowercase NFC. The stemmers do not
 +			apply case folding or Unicode normalization.
 +		</para>
 +		<para>
 +			Languages with a light stemmer include German, Spanish, Finnish, French,
 +			Hungarian, Italian, Norwegian, Portuguese, Russian, and Swedish. Minimal
 +			stemmers are available for German, English, Spanish, French, Norwegian, and
 +			Swedish. Norwegian variants are selected through
 +			<code>NorwegianVariety</code>.
 +			<code>LightStemmerUsageExampleTest</code> checks these results.
 +			<programlisting language="java"><![CDATA[
 +GermanLightStemmer light = new GermanLightStemmer();
 +light.stem("häusern");                           // "haus"
 +
 +new SpanishMinimalStemmer().stem("jerseis");         // "jersey"
 +
 +NorwegianLightStemmer bokmaal =
 +    new NorwegianLightStemmer(NorwegianVariety.BOKMAAL);
 +bokmaal.stem("hemmeligheten");                       // "hemmelig"]]>
 +			</programlisting>
 +		</para>
 +		<para>
 +			For uppercase or decomposed input, normalize to NFC and lowercase before
 +			stemming. This example prepares a German word with a combining diaeresis:
 +		</para>
 +		<programlisting language="java"><![CDATA[import java.text.Normalizer;
 +import opennlp.tools.stemmer.light.GermanLightStemmer;
 +import opennlp.tools.util.StringUtil;
 +
 +String input = "HA\u0308USERN";
 +String prepared = StringUtil.toLowerCase(
 +    Normalizer.normalize(input, Normalizer.Form.NFC));
 +new GermanLightStemmer().stem(prepared);             // "haus"]]>
 +		</programlisting>
 +	</section>
  </chapter>