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"));
if(tokSeqs.containsKey(tokSeq)) {
if(isReact) tokSeqs.put(tokSeq, true);
} else {
tokSeqs.put(tokSeq, isReact);