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

edu.stanford.nlp.sequences.DocumentReaderAndWriter Maven / Gradle / Ivy

Go to download

Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.

There is a newer version: 3.9.2
Show newest version
package edu.stanford.nlp.sequences;

import edu.stanford.nlp.objectbank.IteratorFromReaderFactory;
import edu.stanford.nlp.util.CoreMap;

import java.util.List;
import java.io.PrintWriter;
import java.io.Serializable;

/**
 * This interface is used for reading data and writing
 * output into and out of sequence classifiers.
 * If you subclass this interface, all of the other
 * mechanisms necessary for getting your data into a
 * sequence classifier will be taken care of
 * for you.  Subclasses MUST have an empty constructor as
 * they can be instantiated by reflection, and
 * there is a promise that the init method will
 * be called immediately after construction.
 *
 * @author Jenny Finkel
 */

public interface DocumentReaderAndWriter
        extends IteratorFromReaderFactory>, Serializable {

  /**
   * This will be called immediately after construction.  It's easier having
   * an init() method because DocumentReaderAndWriter objects are usually
   * created using reflection.
   *
   * @param flags Flags specifying behavior
   */
  public void init(SeqClassifierFlags flags);

  /**
   * This method prints the output of the classifier to a
   * {@link PrintWriter}.
   *
   * @param doc The document which has answers (it has been classified)
   * @param out Where to send the output
   */
  public void printAnswers(List doc, PrintWriter out);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy