@@ -33,7 +33,7 @@ public class NodePattern extends SemgrexPattern {
3333 */
3434 private final Map <String , Pair <Object , Object >> attributes ;
3535 private final boolean isRoot ;
36- private boolean isLink ;
36+ private final boolean isLink ;
3737 private final boolean isEmpty ;
3838 private final String name ;
3939 private String descString ;
@@ -44,18 +44,19 @@ public class NodePattern extends SemgrexPattern {
4444
4545 public NodePattern (GraphRelation r , boolean negDesc ,
4646 Map <String , String > attrs ,
47- boolean root , boolean empty , String name ) {
48- this (r , negDesc , attrs , root , empty , name ,
47+ boolean root , boolean empty , boolean isLink , String name ) {
48+ this (r , negDesc , attrs , root , empty , isLink , name ,
4949 new ArrayList <>(0 ));
5050 }
5151
5252 // TODO: there is no capacity for named variable groups in the parser right now
5353 public NodePattern (GraphRelation r , boolean negDesc ,
5454 Map <String , String > attrs ,
55- boolean root , boolean empty , String name ,
55+ boolean root , boolean empty , boolean isLink , String name ,
5656 List <Pair <Integer , String >> variableGroups ) {
5757 this .reln = r ;
5858 this .negDesc = negDesc ;
59+ this .isLink = isLink ;
5960 // order the attributes so that the pattern stays the same when
6061 // printing a compiled pattern
6162 attributes = new LinkedHashMap <>();
@@ -193,10 +194,6 @@ public boolean nodeAttrMatch(IndexedWord node, final SemanticGraph sg, boolean i
193194 return !negDesc ;
194195 }
195196
196- public void makeLink () {
197- isLink = true ;
198- }
199-
200197 public boolean isRoot () {
201198 return isRoot ;
202199 }
0 commit comments