Skip to content

Commit 7c97988

Browse files
committed
Scaffolding for the VariableStrings which doesn't do anything yet - would need to parse the strings and match against them in the matchers
1 parent 042e3be commit 7c97988

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/edu/stanford/nlp/semgraph/semgrex/NodePattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class NodePattern extends SemgrexPattern {
4949
SemgrexPattern child;
5050
// specifies the groups in a regex that are captured as
5151
// matcher-global string variables
52-
private List<Pair<Integer, String>> variableGroups;
52+
private final List<Pair<Integer, String>> variableGroups;
5353

5454
public NodePattern(GraphRelation r, boolean negDesc,
5555
NodeAttributes attrs, boolean isLink, String name) {

src/edu/stanford/nlp/semgraph/semgrex/SemgrexMatch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public SemanticGraphEdge getEdge(String name) {
8181
return namesToEdges.get(name);
8282
}
8383

84+
public String getVariableString(String var) {
85+
return variableStrings.getString(var);
86+
}
87+
8488
public String toString() {
8589
StringBuilder builder = new StringBuilder();
8690
builder.append(matchedPattern);

src/edu/stanford/nlp/semgraph/semgrex/SemgrexMatcher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void reset() {
7777
namesToNodes.clear();
7878
namesToRelations.clear();
7979
namesToEdges.clear();
80+
variableStrings.reset();
8081
}
8182

8283
/**

0 commit comments

Comments
 (0)