private void setCanonicalForm(WordToken wordAnnotation, String word) throws AnalysisEngineProcessException { // apply LVG processing to get canonical form String canonicalForm = null; if (useCmdCache) { canonicalForm = normCacheMap.get(word); if (canonicalForm == null) { // logger.info("["+ word+ "] was not found in LVG norm cache."); } } // only apply LVG processing if not found in cache first if (canonicalForm == null) { try { String out = lvgCmd.MutateToString(word); String[] output = out.split("\\|"); if ((output != null) && (output.length >= 2) && (!output[1].matches("No Output"))) { canonicalForm = output[1]; } } catch (Exception e) { throw new AnalysisEngineProcessException(e); } } if (canonicalForm != null) { wordAnnotation.setCanonicalForm(canonicalForm); } }
private void setCanonicalForm(WordToken wordAnnotation, String word) throws AnalysisEngineProcessException { // apply LVG processing to get canonical form String canonicalForm = null; if (useCmdCache) { canonicalForm = normCacheMap.get(word); if (canonicalForm == null) { // logger.info("["+ word+ "] was not found in LVG norm cache."); } } // only apply LVG processing if not found in cache first if (canonicalForm == null) { try { String out = lvgCmd.MutateToString(word); String[] output = out.split("\\|"); if ((output != null) && (output.length >= 2) && (!output[1].matches("No Output"))) { canonicalForm = output[1]; } } catch (Exception e) { throw new AnalysisEngineProcessException(e); } } if (canonicalForm != null) { wordAnnotation.setCanonicalForm(canonicalForm); } }