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

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

Introduction

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

Prototype

public static LexicalizedParser getParserFromSerializedFile(String serializedFileOrUrl) 

Source Link

Usage

From source file:gate.stanford.Parser.java

License:Open Source License

private void instantiateStanfordParser() throws ResourceInstantiationException {
    if (stanfordParser != null)
        return;//  w ww .  j  a v  a2 s. c  om

    try {
        String filepath = Files.fileFromURL(parserFile).getAbsolutePath();
        stanfordParser = LexicalizedParser.getParserFromSerializedFile(filepath);
    } catch (Exception e) {
        throw new ResourceInstantiationException(e);
    }
}