List of usage examples for edu.stanford.nlp.pipeline StanfordCoreNLP getProperties
public Properties getProperties()
From source file:dfh.grammar.stanfordnlp.CnlpTokenSequenceFactory.java
License:LGPL
/** * Generate a token sequence factory using a pre-existing pipeline. If this * pipeline does not sentence, tokenize, and tag, an error will be thrown. * /* w w w . j a va2s .c o m*/ * @param pipeline * Stanford annotation pipeline */ public CnlpTokenSequenceFactory(StanfordCoreNLP pipeline) { this.pipeline = pipeline; Properties p = pipeline.getProperties(); String annotators = p.getProperty("annotators"); if (annotators == null) throw new StanfordCFGException("no annotators"); if (annotators.indexOf("tokenize") == -1) throw new StanfordCFGException("no tokenization annotator"); if (annotators.indexOf("ssplit") == -1) throw new StanfordCFGException("no ssplit annotator"); if (annotators.indexOf("pos") == -1) throw new StanfordCFGException("no pos annotator"); }