All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.io.TeeStream Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version
package edu.stanford.nlp.io;

import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.OutputStream;

/**
 * This class splits the calls to an OutputStream into two different
 * streams.
 *
 * @author John Bauer
 */
public class TeeStream extends OutputStream 
  implements Closeable, Flushable
{
  public TeeStream(OutputStream s1, OutputStream s2) {
    this.s1 = s1;
    this.s2 = s2;
  }
  
  OutputStream s1, s2;
  
  public void close() 
    throws IOException
  {
    s1.close();
    s2.close();
  }
  
  public void flush() 
    throws IOException
  {
    s1.flush();
    s2.flush();
  }
  
  public void write(byte[] b) 
    throws IOException
  {
    s1.write(b);
    s2.write(b);
  }
  
  public void write(byte[] b, int off, int len) 
    throws IOException
  {
    s1.write(b, off, len);
    s2.write(b, off, len);
  }
  
  public void write(int b) 
    throws IOException
  {
    s1.write(b);
    s2.write(b);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy