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

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

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


##########
opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderEventStream.java:
##########
@@ -32,36 +32,38 @@
 import opennlp.tools.util.featuregen.WindowFeatureGenerator;
 
 /**
- * Class for creating an event stream out of data files for training an name
- * finder.
+ * Class for creating an event stream out of data files for training an {@link 
TokenNameFinder}.
  */
 public class NameFinderEventStream extends 
opennlp.tools.util.AbstractEventStream<NameSample> {
 
-  private NameContextGenerator contextGenerator;
+  private final NameContextGenerator contextGenerator;
 
-  private AdditionalContextFeatureGenerator additionalContextFeatureGenerator =
+  private final AdditionalContextFeatureGenerator 
additionalContextFeatureGenerator =
       new AdditionalContextFeatureGenerator();
 
-  private SequenceCodec<String> codec;
+  private final SequenceCodec<String> codec;
 
   private final String defaultType;
 
   /**
-   * Creates a new name finder event stream using the specified data stream 
and context generator.
-   * @param dataStream The data stream of events.
-   * @param type null or overrides the type parameter in the provided samples
-   * @param contextGenerator The context generator used to generate features 
for the event stream.
+   * Initializes a {@link NameFinderEventStream} using the specified {@code 
dataStream} and
+   * {@link NameContextGenerator}.
+   *
+   * @param dataStream The {@link ObjectStream data stream} of events.
+   * @param type {@code null} or overrides the type parameter in the provided 
samples.
+   * @param contextGenerator The {@link NameContextGenerator} used to generate 
features for the event stream.
+   * @param codec The {@link SequenceCodec} to use.
    */
   public NameFinderEventStream(ObjectStream<NameSample> dataStream, String 
type,
                                NameContextGenerator contextGenerator, 
SequenceCodec<String> codec) {
     super(dataStream);
 
-    this.codec = codec;
-
     if (codec == null) {
       this.codec = new BioCodec();
+    } else {
+      this.codec = codec;
     }
-
+    

Review Comment:
   Extra spaces



##########
opennlp-tools/src/main/java/opennlp/tools/namefind/RegexNameFinder.java:
##########
@@ -178,18 +197,34 @@ public void clearAdaptiveData() {
     // nothing to clear
   }
 
+  /**
+   * @return Retrieves the {@link Pattern patterns} used.
+   */
+  // TODO Unclear what 'm' stands for: Discuss refactoring, deprecation, or 
removal of unused method.
   public Pattern[] getmPatterns() {
     return mPatterns;
   }
 
+  /**
+   * @param mPatterns The {@link Pattern patterns} to be set.
+   */
+  // TODO Unclear what 'm' stands for: Discuss refactoring, deprecation, or 
removal of unused method.
   public void setmPatterns(Pattern[] mPatterns) {
     this.mPatterns = mPatterns;
   }
 
+  /**
+   * @return Retrieves the type used.
+   */
+  // TODO Unclear what 's' stands for: Discuss refactoring, deprecation, or 
removal of unused method.
   public String getsType() {

Review Comment:
   Now this one got me... strings/input? Probably better refactor or remove.



##########
opennlp-tools/src/main/java/opennlp/tools/namefind/RegexNameFinder.java:
##########
@@ -178,18 +197,34 @@ public void clearAdaptiveData() {
     // nothing to clear
   }
 
+  /**
+   * @return Retrieves the {@link Pattern patterns} used.
+   */
+  // TODO Unclear what 'm' stands for: Discuss refactoring, deprecation, or 
removal of unused method.
   public Pattern[] getmPatterns() {

Review Comment:
   Matches? Or a typo...





> 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