@@ -1573,16 +1573,24 @@ public void testBatchUniq() {
15731573 }
15741574
15751575public void testVariableGroups () {
1576+ // first, a basic test that it is capturing the variable groups correctly
15761577SemgrexPattern pattern =SemgrexPattern .compile ("{word:/(.*ill.*)/#1%name}" );
15771578SemanticGraph graph =SemanticGraph .valueOf ("[ate-2 subj> Bill-1 obj>[muffins-5 compound> Blueberry-3 compound> filled-4]]" );
15781579Set <String >matches =new HashSet <>();
15791580SemgrexMatcher matcher =pattern .matcher (graph );
15801581while (matcher .find ()) {
1582+ // TODO: check the size of the variableStrings here
15811583assertNotNull (matcher .variableStrings .getString ("name" ));
15821584matches .add (matcher .variableStrings .getString ("name" ));
15831585 }
15841586Set <String >expectedMatches =Stream .of ("Bill" ,"filled" ).collect (Collectors .toCollection (HashSet ::new ));
15851587assertEquals (expectedMatches ,matches );
1588+
1589+ pattern =SemgrexPattern .compile ("{word:/(.*)ill/#1%name} .. {word:/(.*)lueberry/#1%name}" );
1590+ matcher =pattern .matcher (graph );
1591+ assertTrue (matcher .find ());
1592+ assertEquals ("B" ,matcher .variableStrings .getString ("name" ));
1593+ assertFalse (matcher .find ());
15861594 }
15871595
15881596public static void outputBatchResults (SemgrexPattern pattern ,List <CoreMap >sentences ) {