String type = a.type;
//System.out.println(surface + " " + a.type);
if(type.contains("_")) {
type = type.split("_")[0];
}
NamedEntity ne = new NamedEntity(t.getTokens(a.startToken, endToken), surface, type);
assert(collector instanceof NECollector);
((NECollector)collector).collect(ne);
//System.out.println(surface + ": " + a.reps);
if(a.type.startsWith("ONT")) {
Set<String> ontIds = runAutToStateToOntIds.get(a.type).get(a.state);
String s = OntologyTerms.idsForTerm(StringTools.normaliseName(surface));
if(s != null && s.length() > 0) {
if(ontIds == null) ontIds = new HashSet<String>();
ontIds.addAll(StringTools.arrayToList(s.split("\\s+")));
}
ne.addOntIds(ontIds);
//System.out.println(surface + "\t" + ontIds);
}
if(a.type.startsWith("CUST")) {
//System.out.println(runAutToStateToOntIds.get(a.type));
Set<String> custTypes = runAutToStateToOntIds.get(a.type).get(a.state);
ne.addCustTypes(custTypes);
//System.out.println(surface + "\t" + ontIds);
}
//ne.setPattern(StringTools.collectionToString(a.getReps(), "_"));
}