// add all edges to the actual graph
for(IntermediateEdge ie: edges){
IndexedWord source = nodeMap.get(ie.source, ie.sourceCopy);
if (source == null) {
throw new RuntimeIOException("Failed to find node " + ie.source + "-" + ie.sourceCopy);
}
IndexedWord target = nodeMap.get(ie.target, ie.targetCopy);
if (target == null) {
throw new RuntimeIOException("Failed to find node " + ie.target + "-" + ie.targetCopy);
}
assert(target != null);
synchronized (LOCK) {
// this is not thread-safe: there are static fields in GrammaticalRelation
GrammaticalRelation rel = GrammaticalRelation.valueOf(ie.dep);