}
prevCell = cell;
}
//System.out.println("**************************");
// Parenthetical phrases
Token beforeBracket = null;
Token prevToken = null;
for(Token token : tokSeq.getTokens()) {
if(prevToken == null) {
prevToken = token;
continue;
}
if(beforeBracket == null) {
if(token.getValue().equals("(")) beforeBracket = prevToken;
} else if(token.getValue().equals(")")) {
LatticeCell beforeBracketCell = tokensToTokenCells.get(beforeBracket);
LatticeCell bracketCell = tokensToTokenCells.get(token);
if(beforeBracketCell != null || bracketCell != null) {
beforeBracketCell.addInheritance(bracketCell);
//System.out.println("Parenthetical: " + tokSeq.getSubstring(beforeBracket.getId(), token.getId()));
}
beforeBracket = null;
}
prevToken = token;
}
// Build in named entities
for(Token token : tokSeq.getTokens()) {
if(startsToNEs.containsKey(token.getStart())) {
for(Element neElem : startsToNEs.get(token.getStart())) {
Token endToken = procDoc.getTokenByEnd(neElem.getAttributeValue("to"));
if(endToken == null) continue;
prevCell = tokenToPrev.get(token);
LatticeCell endTokenCell = tokensToTokenCells.get(endToken);
if(endTokenCell == null) continue;
LatticeCell neCell = new LatticeCell(neElem, endTokenCell);