List of usage examples for opennlp.tools.util.featuregen FeatureGeneratorUtil tokenFeature
public static String tokenFeature(String token)
From source file:edu.stanford.muse.util.Util.java
public static Set<String> getAcronyms(String content) { if (content == null) return null; Pattern acronymPattern = Pattern.compile("[A-Z]{3,}"); content = cleanEmailStuff(content);/*from w w w. ja va 2 s . com*/ Set<String> acrs = new HashSet<String>(); Matcher m = acronymPattern.matcher(content); while (m.find()) { String acr = m.group(); String tt = FeatureGeneratorUtil.tokenFeature(acr); if (!tt.equals("ac")) { continue; } acrs.add(acr); } return acrs; }