Package opennlp.tools.tokenize

Examples of opennlp.tools.tokenize.WhitespaceTokenStream


  void process() {
   
    ObjectStream<String> untokenizedLineStream =
        new PlainTextByLineStream(new InputStreamReader(System.in));
   
    ObjectStream<String> tokenizedLineStream = new WhitespaceTokenStream(
        new TokenizerStream(tokenizer, untokenizedLineStream));
   
    PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
    perfMon.start();
   
    try {
      String tokenizedLine;
      while ((tokenizedLine = tokenizedLineStream.read()) != null) {
        System.out.println(tokenizedLine);
        perfMon.incrementCounter();
      }
    }
    catch (IOException e) {
View Full Code Here


    PerformanceMonitor perfMon = null;
    try {
      untokenizedLineStream =
              new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());

      tokenizedLineStream = new WhitespaceTokenStream(
              new TokenizerStream(tokenizer, untokenizedLineStream));

      perfMon = new PerformanceMonitor(System.err, "sent");
      perfMon.start();
View Full Code Here

TOP

Related Classes of opennlp.tools.tokenize.WhitespaceTokenStream

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.