mawiesne commented on code in PR #58:
URL: https://github.com/apache/opennlp-sandbox/pull/58#discussion_r1081489081


##########
opennlp-coref/src/main/java/opennlp/tools/formats/CorefSampleStreamFactory.java:
##########
@@ -42,16 +44,19 @@ public static void registerFactory() {
     StreamFactoryRegistry.registerFactory(CorefSample.class,
         StreamFactoryRegistry.DEFAULT_FORMAT, new CorefSampleStreamFactory());
   }
-  
+
+  @Override
   public ObjectStream<CorefSample> create(String[] args) {
     Parameters params = ArgumentParser.parse(args, Parameters.class);
 
     CmdLineUtil.checkInputFile("Data", params.getData());
-    FileInputStream sampleDataIn = CmdLineUtil.openInFile(params.getData());
-
-    ObjectStream<String> lineStream = new ParagraphStream(new 
PlainTextByLineStream(sampleDataIn
-        .getChannel(), params.getEncoding()));
-
-    return new CorefSampleDataStream(lineStream);
+    try {
+      MarkableFileInputStreamFactory factory = new 
MarkableFileInputStreamFactory(params.getData());
+      ObjectStream<String> lineStream = new ParagraphStream(new 
PlainTextByLineStream(
+              factory, params.getEncoding()));
+      return new CorefSampleDataStream(lineStream);

Review Comment:
   Fixed.



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