You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by GitBox <gi...@apache.org> on 2022/12/12 13:08:57 UTC

[GitHub] [opennlp] jzonthemtn commented on a diff in pull request #456: OPENNLP-1410 Enhance JavaDoc in opennlp.tools.namefind package

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


##########
opennlp-tools/src/main/java/opennlp/tools/namefind/TokenNameFinderFactory.java:
##########
@@ -87,24 +104,49 @@ private static byte[] loadDefaultFeatureGeneratorBytes() {
       }
     }
     catch (IOException e) {
-      throw new IllegalStateException("Failed reading from ner-default-features.xml file on classpath!");
+      throw new IllegalStateException("Failed reading from 'ner-default-features.xml' file on classpath!");
     }
 
     return bytes.toByteArray();
   }
 
+  /**
+   * @return Retrieves the {@link SequenceCodec} in use.
+   */
   protected SequenceCodec<String> getSequenceCodec() {
     return seqCodec;
   }
 
+  /**
+   * @return Retrieves the additional {@code resources} in use.
+   */
   protected Map<String, Object> getResources() {
     return resources;
   }
 
+  /**
+   * @return Retrieves {@code byte[]} in use representing the feature generator descriptor.
+   */
   protected byte[] getFeatureGenerator() {
     return featureGeneratorBytes;
   }
 
+
+  /**
+   * Initializes a {@link TokenNameFinderFactory} instance via given parameters.
+   *
+   * @param subclassName The class name used for instantiation. If {@code null}, an
+   *                     instance of {@link TokenNameFinderFactory} will be returned
+   *                     per default. Otherwise, the {@link ExtensionLoader} mechanism
+   *                     is applied to load the requested {@code subclassName}.
+   * @param featureGeneratorBytes The {@code byte[]} representing the feature generator descriptor.
+   * @param resources Additional resources in a mapping.
+   * @param seqCodec The {@link SequenceCodec} to use.
+   *
+   * @return A valid {@link TokenNameFinderFactory} instance.
+   * @throws InvalidFormatException Thrown if the {@link ExtensionLoader} mechanism failed to
+   *                                create the factory associated with {@code subclassName}.
+   */
   public static TokenNameFinderFactory create(String subclassName, byte[] featureGeneratorBytes,
       final Map<String, Object> resources, SequenceCodec<String> seqCodec)
       throws InvalidFormatException {

Review Comment:
   Can it still throw an `InvalidFormatException`?



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

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