kinow commented on code in PR #554:
URL: https://github.com/apache/opennlp/pull/554#discussion_r1359845269


##########
opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorFactory.java:
##########
@@ -112,20 +112,36 @@ public Map<String, String> createManifestEntries() {
     return manifestEntries;
   }
 
-  public static SentenceDetectorFactory create(String subclassName,
-      String languageCode, boolean useTokenEnd,
-      Dictionary abbreviationDictionary, char[] eosCharacters)
-      throws InvalidFormatException {
+  /**
+   * Instantiates a {@link SentenceDetectorFactory} via a given {@code 
subclassName}.
+   *
+   * @param subclassName The class name used for instantiation. If {@code 
null}, an
+   *                     instance of {@link SentenceDetectorFactory} will be 
returned
+   *                     per default. Otherwise, the {@link ExtensionLoader} 
mechanism
+   *                     is applied to load the requested {@code subclassName}.
+   * @param languageCode The ISO language code to be used. Must not be {@code 
null}.
+   * @param useTokenEnd {@code true} if {@link #TOKEN_END_PROPERTY} shall be 
set,
+   *                    {@code false} otherwise.
+   * @param abbrDictionary The {@link Dictionary} of abbriviations if 
available;

Review Comment:
   s/abbriviations/abbreviations



##########
opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorFactory.java:
##########
@@ -184,6 +206,9 @@ public EndOfSentenceScanner getEndOfSentenceScanner() {
     }
   }
 
+  /**
+   * @return A {@link SDContextGenerator} instance, guaranteed to be not 
{@code null}.
+   */
   public SDContextGenerator getSDContextGenerator() {

Review Comment:
   I wonder if at some point it'd be useful to annotate methods like this with 
`@NotNull` and use some validator/static checker. Thanks for the docs though! 
:+1: 



-- 
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