jzonthemtn commented on code in PR #562:
URL: https://github.com/apache/opennlp/pull/562#discussion_r1422515206


##########
opennlp-tools/src/main/java/opennlp/tools/tokenize/TokenizerME.java:
##########
@@ -258,4 +274,24 @@ public boolean useAlphaNumericOptimization() {
     return useAlphaNumericOptimization;
   }
 
+  /**
+   * Allows checking a token abbreviation candidate for acceptability.
+   *
+   * <p>Note: The implementation always returns {@code false} if no
+   * abbreviation dictionary is available for the underlying model.</p>
+   *
+   * @param s the {@link CharSequence} in which the break occurred.
+   * @return {@code true} if the candidate is acceptable, {@code false} 
otherwise.
+   */
+  protected boolean isAcceptableAbbreviation(CharSequence s) {
+    if (abbDict == null)
+      return false;
+
+    for (String abb : abbDict.asStringSet()) {

Review Comment:
   I think `Dictionary` has a `contains()` but I don't know if it works how you 
need it to.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to