Example usage for edu.stanford.nlp.parser.lexparser LexicalizedParser loadModel

List of usage examples for edu.stanford.nlp.parser.lexparser LexicalizedParser loadModel

Introduction

In this page you can find the example usage for edu.stanford.nlp.parser.lexparser LexicalizedParser loadModel.

Prototype

public static LexicalizedParser loadModel(String parserFileOrUrl, List<String> extraFlags) 

Source Link

Usage

From source file:org.ets.research.nlp.stanford_thrift.parser.StanfordParserThrift.java

License:Open Source License

private void loadModel(String modelFile) {
    if (modelFile.equals("") || modelFile == null) {
        parser = LexicalizedParser.loadModel(DefaultPaths.DEFAULT_PARSER_MODEL, new String[] {});
    } else {//from ww  w  .  j  a  v a 2 s . co m
        parser = LexicalizedParser.loadModel(modelFile, new String[] {});
    }
}

From source file:wtute.parser.EssayParser.java

public EssayParser() {
    grammar = "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz";
    String[] options = { "-maxLength", "80", "-retainTmpSubcategories" };
    lp = LexicalizedParser.loadModel(grammar, options);
    tlp = lp.getOp().langpack();/*from  www  .  j av a2 s  . c  om*/
    gsf = tlp.grammaticalStructureFactory();
    xmlc = new XMLCreator();
}

From source file:wtute.parser.EssayParser.java

public EssayParser(String serGrammarURL) {

    grammar = serGrammarURL;/*from   www .j a  v a  2s.  c o  m*/
    String[] options = { "-maxLength", "80", "-retainTmpSubcategories" };
    lp = LexicalizedParser.loadModel(grammar, options);
    tlp = lp.getOp().langpack();
    gsf = tlp.grammaticalStructureFactory();
}