Example usage for edu.stanford.nlp.pipeline DeterministicCorefAnnotator DeterministicCorefAnnotator

List of usage examples for edu.stanford.nlp.pipeline DeterministicCorefAnnotator DeterministicCorefAnnotator

Introduction

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

Prototype

public DeterministicCorefAnnotator(Properties props) 

Source Link

Usage

From source file:org.aksw.simba.cetus.preprocessing.PronounReplacingSupplierDecorator.java

License:Open Source License

public static PronounReplacingSupplierDecorator create(DocumentSupplier documentSource) {
    Properties props = new Properties();
    InputStream is;//from w w  w  .j  a  v a 2 s .  co  m
    is = PronounReplacingSupplierDecorator.class.getClassLoader()
            .getResourceAsStream(STANFORD_NLP_PROPERTIES_FILE);
    if (is == null) {
        LOGGER.error("Couldn't load stanford properties file (\"" + STANFORD_NLP_PROPERTIES_FILE
                + "\") from class path. Returning null.");
        return null;
    }
    try {
        props.load(is);
    } catch (IOException e) {
        LOGGER.error("Couldn't load stanford properties file. Returning null.", e);
        return null;
    } finally {
        IOUtils.closeQuietly(is);
    }
    DeterministicCorefAnnotator annotator = new DeterministicCorefAnnotator(props);
    return new PronounReplacingSupplierDecorator(documentSource, annotator);
}