Example usage for edu.stanford.nlp.tagger.maxent MaxentTagger DEFAULT_DISTRIBUTION_PATH

List of usage examples for edu.stanford.nlp.tagger.maxent MaxentTagger DEFAULT_DISTRIBUTION_PATH

Introduction

In this page you can find the example usage for edu.stanford.nlp.tagger.maxent MaxentTagger DEFAULT_DISTRIBUTION_PATH.

Prototype

String DEFAULT_DISTRIBUTION_PATH

To view the source code for edu.stanford.nlp.tagger.maxent MaxentTagger DEFAULT_DISTRIBUTION_PATH.

Click Source Link

Usage

From source file:filters.PosTaggingFilter.java

License:Open Source License

public MaxentTagger initializeTagger() {
    MaxentTagger tagger = null;/* w ww  .  j a v a  2  s . c om*/

    try {
        tagger = new MaxentTagger(Paths.taggerPath + "/" + MaxentTagger.DEFAULT_DISTRIBUTION_PATH);
    } catch (IOException e) {
        AppLogger.error.log(Level.SEVERE, "Cannot read model " + MaxentTagger.DEFAULT_DISTRIBUTION_PATH
                + " from the following location:\n" + Paths.taggerPath);
    } catch (ClassNotFoundException e) {
        AppLogger.error.log(Level.SEVERE, "An error occured while loading a POS tagger based on model "
                + MaxentTagger.DEFAULT_DISTRIBUTION_PATH);
    }

    return tagger;
}