/** * Removes a constituent from this view. Removes any relations whose source or target was this constituent. */ public void removeConstituent(Constituent constituent) { Set<Relation> relationsToRemove = new HashSet<>(); for (Relation inRel : constituent.incomingRelations) relationsToRemove.add(inRel); for (Relation outRel : constituent.outgoingRelations) relationsToRemove.add(outRel); constituents.remove(constituent); removeAllTokenFromConstituentMapping(constituent); for (Relation rel : relationsToRemove) removeRelation(rel); }
/** * Removes a constituent from this view. Removes any relations whose source or target was this constituent. */ public void removeConstituent(Constituent constituent) { Set<Relation> relationsToRemove = new HashSet<>(); for (Relation inRel : constituent.incomingRelations) relationsToRemove.add(inRel); for (Relation outRel : constituent.outgoingRelations) relationsToRemove.add(outRel); constituents.remove(constituent); removeAllTokenFromConstituentMapping(constituent); for (Relation rel : relationsToRemove) removeRelation(rel); }
public void removeAllRelations() { List<Constituent> allCorefCons = this.getConstituents(); for (Constituent c : allCorefCons) { for (Relation r : c.getIncomingRelations()) this.removeRelation(r); for (Relation r : c.getOutgoingRelations()) this.removeRelation(r); c.removeAllIncomingRelatons(); c.removeAllOutgoingRelaton(); } }
public void removeAllRelations() { List<Constituent> allCorefCons = this.getConstituents(); for (Constituent c : allCorefCons) { for (Relation r : c.getIncomingRelations()) this.removeRelation(r); for (Relation r : c.getOutgoingRelations()) this.removeRelation(r); c.removeAllIncomingRelatons(); c.removeAllOutgoingRelaton(); } }