for(int i=0;i<nodes.size();i++) {
XOMTools.removeElementPreservingText((Element)nodes.get(i));
}
Document safDoc = InlineToSAF.extractSAFs(doc, sourceDoc, "foo");
ProcessingDocument procDoc = ProcessingDocumentFactory.getInstance().makeTokenisedDocument(sourceDoc, false, false, false);
//NameRecogniser nr = new NameRecogniser();
//nr.halfProcess(sourceDoc);
//nr.makeTokenisers(false);
Nodes n = safDoc.query("/saf/annot[slot[@name='type']['PRW']]");
Map<TokenSequence,Boolean> tokSeqs = new HashMap<TokenSequence,Boolean>();
Map<TokenSequence,Bag<String>> tokSeqPRWs = new HashMap<TokenSequence,Bag<String>>();
for(int i=0;i<n.size();i++) {
Element e = (Element)n.get(i);
Token token = procDoc.getTokenByStart(e.getAttributeValue("from"));
if(token == null) token = procDoc.getTokenByEnd(e.getAttributeValue("to"));
if(token == null) {
System.out.println("Eeep!");
} else {
TokenSequence tokSeq = token.getTokenSequence();
boolean isReact = "REACT".equals(SafTools.getSlotValue(e, "subtype"));