Example usage for edu.stanford.nlp.pipeline Annotation compact

List of usage examples for edu.stanford.nlp.pipeline Annotation compact

Introduction

In this page you can find the example usage for edu.stanford.nlp.pipeline Annotation compact.

Prototype

public void compact() 

Source Link

Document

Reduces memory consumption to the minimum for representing the values currently stored stored in this object.

Usage

From source file:edu.sabanciuniv.sentilab.utils.text.nlp.stanford.english.StanfordCoreNLPWrapper.java

License:Open Source License

/**
 * Annotates a text using the current annotators.
 * @param text the text to annotate./* ww  w . j ava  2  s  .c o m*/
 * @return the annotated document.
 */
public Annotation annotate(String text) {
    Annotation document = new Annotation(text);
    this.getPipeline().annotate(document);
    document.compact();
    return document;
}