Element e = (Element)n.get(i);
e.addAttribute(new Attribute("type", "CHEMICAL"));
//XOMTools.removeElementPreservingText((Element)n.get(i));
}
}
ProcessingDocument procDoc = ProcessingDocumentFactory.getInstance().makeTokenisedDocument(doc, true, false, false);
//NameRecogniser nr = new NameRecogniser();
//nr.halfProcess(doc);
//if(memm.patternFeatures) {
// nr.findForReps(cheatTokenisation);
//} else {
//nr.makeTokenisers(cheatTokenisation);
//}
int paperTestNEs = 0;
List<Double> paperGoodProbs = new ArrayList<Double>();
List<Double> paperBadProbs = new ArrayList<Double>();
Map<NamedEntity,Double> confidences = new HashMap<NamedEntity,Double>();
List<NamedEntity> entities;
Set<String> testNEs = new LinkedHashSet<String>();
for(TokenSequence tokSeq : procDoc.getTokenSequences()) {
Nodes neNodes = tokSeq.getElem().query(".//ne");
for(int k=0;k<neNodes.size();k++) {
Element neElem = (Element)neNodes.get(k);
if(filterType != null && !neElem.getAttributeValue("type").equals(filterType)) continue;
if(antiFilterType != null && neElem.getAttributeValue("type").equals(antiFilterType)) continue;