mawiesne commented on code in PR #456:
URL: https://github.com/apache/opennlp/pull/456#discussion_r1052218809
##########
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:
will fix.
--
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]