Example usage for edu.stanford.nlp.util StringUtils argsToPropertiesWithResolve

List of usage examples for edu.stanford.nlp.util StringUtils argsToPropertiesWithResolve

Introduction

In this page you can find the example usage for edu.stanford.nlp.util StringUtils argsToPropertiesWithResolve.

Prototype

public static Properties argsToPropertiesWithResolve(String[] args) 

Source Link

Document

convert args to properties with variable names resolved.

Usage

From source file:semRewrite.substitutor.MUC.java

License:Open Source License

/****************************************************************
 * @return a Stanford pipeline// w w  w.  ja v  a2 s.co  m
 */
public StanfordCoreNLP initPipeline() {

    Properties props = new Properties();
    //props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
    props.setProperty("annotators",
            "tokenize, ssplit, pos, lemma, ner, entitymentions, parse, depparse, hcoref");
    props.setProperty("tokenize.options", "ptb3Escaping=false");
    //String[] configFileProp = {"-props","/home/apease/Programs/stanford-corenlp-full-2015-04-20/CoreNLP/build/resources/main/edu/stanford/nlp/hcoref/properties/coref-default-dep.properties"};
    String[] configFileProp = { "-props", System.getenv("COREF") };
    props.putAll(StringUtils.argsToPropertiesWithResolve(configFileProp));
    System.out.println("MUC.toCoref(): before initialized pipeline");
    StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
    System.out.println("MUC.toCoref(): initialized pipeline");
    return pipeline;
}