Skip to content

Commit 50fdd77

Browse files
committed
Add some comments on MergeNodes
1 parent 0c41353 commit 50fdd77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/MergeNodes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public boolean evaluate(SemanticGraph sg, SemgrexMatcher sm) {
142142
newLabel.setBefore(right.before());
143143
}
144144

145+
// find the head, and replace all the existing annotations on the head
146+
// with the new annotations (including word and lemma)
147+
// from the newly built CoreLabel
145148
for (IndexedWord vertex : sg.vertexSet()) {
146149
if (vertex.index() == head.index()) {
147150
for (Class key : newLabel.keySet()) {
@@ -151,6 +154,7 @@ public boolean evaluate(SemanticGraph sg, SemgrexMatcher sm) {
151154
}
152155
}
153156

157+
// delete the dependency
154158
// copy the list so that deletion doesn't hurt the iterator
155159
// TODO: super fancy would be implementing iterator.remove()
156160
// on the Set returned by the SemanticGraph

0 commit comments

Comments
 (0)