@@ -404,7 +404,7 @@ private static void addPassiveAgentToReln(SemanticGraph sg,
404
404
IndexedWord gov , IndexedWord mod , IndexedWord caseMarker ) {
405
405
406
406
SemanticGraphEdge edge = sg .getEdge (gov , mod );
407
- edge . setRelation ( UniversalEnglishGrammaticalRelations .AGENT );
407
+ sg . updateEdge ( edge , UniversalEnglishGrammaticalRelations .AGENT );
408
408
}
409
409
410
410
@@ -446,7 +446,7 @@ private static void addCaseMarkersToReln(SemanticGraph sg, IndexedWord gov, Inde
446
446
lastCaseMarkerIndex = cm .index ();
447
447
}
448
448
GrammaticalRelation reln = getCaseMarkedRelation (edge .getRelation (), sb .toString ().toLowerCase ());
449
- edge . setRelation ( reln );
449
+ sg . updateEdge ( edge , reln );
450
450
}
451
451
452
452
private static final SemgrexPattern PREP_CONJP_PATTERN = SemgrexPattern .compile ("{} >/(case|mark)/ ({}=gov >conj ({} >cc {}=cc) >conj {}=conj)" +
@@ -752,7 +752,7 @@ private static void addConjToReln(SemanticGraph sg,
752
752
for (IndexedWord conjDep : conjDeps ) {
753
753
SemanticGraphEdge edge = sg .getEdge (gov , conjDep );
754
754
if (edge .getRelation () == CONJUNCT || conjDep .index () > ccDep .index ()) {
755
- edge . setRelation ( conjValue (ccDep , sg ));
755
+ sg . updateEdge ( edge , conjValue (ccDep , sg ));
756
756
}
757
757
}
758
758
}
@@ -876,23 +876,23 @@ private static void convertRel(SemanticGraph sg) {
876
876
if (nmod .getGovernor ().tag ().startsWith ("NN" )
877
877
|| nmod .getGovernor ().tag ().startsWith ("PRN" )
878
878
|| nmod .getGovernor ().tag ().startsWith ("DT" )) {
879
- nmod . setRelation ( NOMINAL_MODIFIER );
879
+ sg . updateEdge ( nmod , NOMINAL_MODIFIER );
880
880
} else {
881
- nmod . setRelation ( OBLIQUE_MODIFIER );
881
+ sg . updateEdge ( nmod , OBLIQUE_MODIFIER );
882
882
}
883
883
}
884
884
885
885
break ;
886
886
}
887
887
888
- if ( ! changedPrep ) {
889
- prep . setRelation ( OBLIQUE_MODIFIER );
888
+ if (! changedPrep ) {
889
+ sg . updateEdge ( prep , OBLIQUE_MODIFIER );
890
890
}
891
891
}
892
892
893
893
/* Rename remaining "rel" relations. */
894
894
for (SemanticGraphEdge edge : sg .findAllRelns (RELATIVE )) {
895
- edge . setRelation ( DIRECT_OBJECT );
895
+ sg . updateEdge ( edge , DIRECT_OBJECT );
896
896
}
897
897
}
898
898
0 commit comments