[ 
https://issues.apache.org/jira/browse/OPENNLP-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17646084#comment-17646084
 ] 

ASF GitHub Bot commented on OPENNLP-1410:
-----------------------------------------

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





> Enhance JavaDoc in opennlp.tools.namefind package
> -------------------------------------------------
>
>                 Key: OPENNLP-1410
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1410
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Name Finder
>    Affects Versions: 2.1.0
>            Reporter: Martin Wiesner
>            Assignee: Martin Wiesner
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> The JavaDoc the _opennlp.tools.namefind_ package suffers from several 
> inconsistencies and missing descriptions. Moreover, several typos are present 
> that need sanitizing.
> It needs enhancements and/or additions to provide more clarity for readers.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to