Package opennlp.tools.util

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


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

   
    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

    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

      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

      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

    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

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

    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

      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

Related Classes of opennlp.tools.util.ParagraphStream

Copyright © 2018 www.massapicom. 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.