@@ -632,6 +632,14 @@ message Section {
632632}
633633
634634
635+ // Allows for multiple graphs on top of the same words
636+ // This is especially useful for Semgrex and Ssurgeon
637+ // on UD datasets with basic & enhanced dependencies
638+ message RepeatedDependencies {
639+ repeated Token token = 1 ;
640+ repeated DependencyGraph graph = 2 ;
641+ }
642+
635643
636644// A message for requesting a semgrex
637645// Each sentence stores information about the tokens making up the
@@ -657,6 +665,12 @@ message SemgrexRequest {
657665// You may want to send multiple semgrexes per query because
658666// translating large numbers of dependency graphs to protobufs
659667// will be expensive, so doing several queries at once will save time
668+ //
669+ // TODO: searching over multiple layers of dependencies of the same
670+ // sentence will not work unless we change the semantics of the
671+ // return values. In particular, the root of the match
672+ // and the matchIndex of a NamedNode both are indices of the words,
673+ // whereas the words could be "empty" words or copy words
660674message SemgrexResponse {
661675 message NamedNode {
662676 required string name = 1 ;
@@ -728,12 +742,14 @@ message SsurgeonRequest {
728742
729743 repeated Ssurgeon ssurgeon = 1 ;
730744 repeated DependencyGraph graph = 2 ;
745+ repeated RepeatedDependencies multigraph = 3 ;
731746}
732747
733748message SsurgeonResponse {
734749 message SsurgeonResult {
735750 optional DependencyGraph graph = 1 ;
736751 optional bool changed = 2 ;
752+ optional RepeatedDependencies multigraph = 3 ;
737753 }
738754
739755 repeated SsurgeonResult result = 1 ;
0 commit comments