Example usage for opennlp.tools.langdetect LanguageDetectorModel LanguageDetectorModel

List of usage examples for opennlp.tools.langdetect LanguageDetectorModel LanguageDetectorModel

Introduction

In this page you can find the example usage for opennlp.tools.langdetect LanguageDetectorModel LanguageDetectorModel.

Prototype

public LanguageDetectorModel(URL modelURL) throws IOException 

Source Link

Usage

From source file:org.apache.solr.update.processor.OpenNLPLangDetectUpdateProcessorFactory.java

private void loadModel() throws IOException {
    InputStream is = null;/*from   ww w.j a  va2 s  .  co  m*/
    try {
        if (modelFile != null) {
            is = solrResourceLoader.openResource(modelFile);
            model = new LanguageDetectorModel(is);
        }
    } finally {
        IOUtils.closeQuietly(is);
    }
}