Examples of ParagraphStream


Examples of opennlp.tools.util.ParagraphStream

* <b>Note:</b> Do not use this class, internal use only!
*/
public class ConllXPOSSampleStream extends FilterObjectStream<String, POSSample> {

  public ConllXPOSSampleStream(ObjectStream<String> lineStream) {
    super(new ParagraphStream(lineStream));
  }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

  public ConllXPOSSampleStream(ObjectStream<String> lineStream) {
    super(new ParagraphStream(lineStream));
  }
 
  ConllXPOSSampleStream(Reader in) throws IOException {
    super(new ParagraphStream(new PlainTextByLineStream(in)));
  }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

   
    DoccatModel model = new DoccatModelLoader().load(new File(args[0]));
   
    DocumentCategorizerME doccat = new DocumentCategorizerME(model);
   
    ObjectStream<String> documentStream = new ParagraphStream(
        new PlainTextByLineStream(new InputStreamReader(System.in)));
   
    PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "doc");
    perfMon.start();
   
    try {
      String document;
      while ((document = documentStream.read()) != null) {
        double prob[] = doccat.categorize(document);
        String category = doccat.getBestCategory(prob);
       
        DocumentSample sample = new DocumentSample(category, document);
        System.out.println(sample.toString());
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

    SentenceModel model = new SentenceModelLoader().load(new File(args[0]));
   
    SentenceDetectorME sdetector = new SentenceDetectorME(model);

    ObjectStream<String> paraStream =
      new ParagraphStream(new PlainTextByLineStream(new InputStreamReader(System.in)));
   
    PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
    perfMon.start();
   
    try {
      String para;
      while ((para = paraStream.read()) != null) {
       
        String[] sents = sdetector.sentDetect(para);
        for (String sentence : sents) {
          System.out.println(sentence);
        }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

      SentenceModel model = new SentenceModelLoader().load(new File(args[0]));

      SentenceDetectorME sdetector = new SentenceDetectorME(model);

      ObjectStream<String> paraStream =
        new ParagraphStream(new PlainTextByLineStream(new InputStreamReader(System.in)));

      PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
      perfMon.start();

      try {
        String para;
        while ((para = paraStream.read()) != null) {

          String[] sents = sdetector.sentDetect(para);
          for (String sentence : sents) {
            System.out.println(sentence);
          }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

      DoccatModel model = new DoccatModelLoader().load(new File(args[0]));

      DocumentCategorizerME doccat = new DocumentCategorizerME(model);

      ObjectStream<String> documentStream = new ParagraphStream(
          new PlainTextByLineStream(new InputStreamReader(System.in)));

      PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "doc");
      perfMon.start();

      try {
        String document;
        while ((document = documentStream.read()) != null) {
          double prob[] = doccat.categorize(WhitespaceTokenizer.INSTANCE.tokenize(document));
          String category = doccat.getBestCategory(prob);

          DocumentSample sample = new DocumentSample(category, document);
          System.out.println(sample.toString());
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

    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);
  }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

* <b>Note:</b> Do not use this class, internal use only!
*/
public class ConllXPOSSampleStream extends FilterObjectStream<String, POSSample> {

  public ConllXPOSSampleStream(ObjectStream<String> lineStream) {
    super(new ParagraphStream(lineStream));
  }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

    super(new ParagraphStream(lineStream));
  }
 
  ConllXPOSSampleStream(Reader in) throws IOException {
    // encoding is handled by the factory...
    super(new ParagraphStream(new PlainTextByLineStream(in)));
  }
View Full Code Here

Examples of opennlp.tools.util.ParagraphStream

      PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
      perfMon.start();

      try {
        ObjectStream<String> paraStream = new ParagraphStream(new PlainTextByLineStream(new SystemInputStreamFactory(),
            SystemInputStreamFactory.encoding()));

        String para;
        while ((para = paraStream.read()) != null) {

          String[] sents = sdetector.sentDetect(para);
          for (String sentence : sents) {
            System.out.println(sentence);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.