File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/edu/stanford/nlp/semgraph/semgrex Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -64,4 +64,19 @@ public IndexedWord getNode(String name) {
6464 public Set <String > getNodeNames () {
6565 return namesToNodes .keySet ();
6666 }
67+
68+ public String toString () {
69+ StringBuilder builder = new StringBuilder ();
70+ builder .append (matchedPattern );
71+ builder .append ("\n " );
72+ builder .append (sg );
73+ builder .append ("\n " );
74+ for (Map .Entry <String , IndexedWord > entry : namesToNodes .entrySet ()) {
75+ builder .append (entry .getKey () + " matched at " + entry .getValue () + "\n " );
76+ }
77+ for (Map .Entry <String , SemanticGraphEdge > entry : namesToEdges .entrySet ()) {
78+ builder .append (entry .getKey () + " matched at " + entry .getValue () + "\n " );
79+ }
80+ return builder .toString ();
81+ }
6782}
You can’t perform that action at this time.
0 commit comments