return null;
}
private POSTagger getPOSTagger(String language) {
String modelName = languageConfig.getParameter(language,MODEL_NAME_PARAM);
try {
POSModel model;
if(modelName == null){ //use the default
model = openNLP.getPartOfSpeachModel(language);
} else {
model = openNLP.getModel(POSModel.class, modelName, null);
}
if(model != null) {
log.debug("POS Tagger Model {} for lanugage '{}' version: {}",
new Object[]{model.getClass().getSimpleName(),
model.getLanguage(),
model.getVersion() != null ? model.getVersion() : "undefined"});
return new POSTaggerME(model);
}
} catch (Exception e) {
log.warn("Unable to load POS model for language '"+language+"'!",e);
}