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



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