@@ -1492,7 +1492,7 @@ public List<CoreMap> buildSmallBatch() {
1492
1492
public void testBatchSearch () {
1493
1493
List <CoreMap > sentences = buildSmallBatch ();
1494
1494
SemgrexPattern semgrex = SemgrexPattern .compile ("{word:foo}=x > {}=y" );
1495
- List <Pair <CoreMap , List <SemgrexMatch >>> matches = semgrex .matchSentences (sentences );
1495
+ List <Pair <CoreMap , List <SemgrexMatch >>> matches = semgrex .matchSentences (sentences , false );
1496
1496
String [] expectedMatches = {
1497
1497
BATCH_PARSES [0 ],
1498
1498
BATCH_PARSES [1 ],
@@ -1535,21 +1535,21 @@ public void testParsesUniq() {
1535
1535
public void testBatchUniq () {
1536
1536
List <CoreMap > sentences = buildSmallBatch ();
1537
1537
SemgrexPattern semgrex = SemgrexPattern .compile ("{word:foo}=x > {}=y :: uniq x" );
1538
- List <Pair <CoreMap , List <SemgrexMatch >>> matches = semgrex .matchSentences (sentences );
1538
+ List <Pair <CoreMap , List <SemgrexMatch >>> matches = semgrex .matchSentences (sentences , false );
1539
1539
// only the first foo sentence should match when using "uniq x"
1540
1540
assertEquals (1 , matches .size ());
1541
1541
assertEquals (BATCH_PARSES [0 ], matches .get (0 ).first ().get (CoreAnnotations .TextAnnotation .class ));
1542
1542
assertEquals (1 , matches .get (0 ).second ().size ());
1543
1543
1544
1544
semgrex = SemgrexPattern .compile ("{word:foo}=x > {}=y :: uniq" );
1545
- matches = semgrex .matchSentences (sentences );
1545
+ matches = semgrex .matchSentences (sentences , false );
1546
1546
// same thing happens when using "uniq" and no nodes - only one match will occur
1547
1547
assertEquals (1 , matches .size ());
1548
1548
assertEquals (BATCH_PARSES [0 ], matches .get (0 ).first ().get (CoreAnnotations .TextAnnotation .class ));
1549
1549
assertEquals (1 , matches .get (0 ).second ().size ());
1550
1550
1551
1551
semgrex = SemgrexPattern .compile ("{word:foo}=x > {}=y :: uniq y" );
1552
- matches = semgrex .matchSentences (sentences );
1552
+ matches = semgrex .matchSentences (sentences , false );
1553
1553
// now it should match both foo>bar and foo>baz
1554
1554
assertEquals (2 , matches .size ());
1555
1555
assertEquals (BATCH_PARSES [0 ], matches .get (0 ).first ().get (CoreAnnotations .TextAnnotation .class ));
@@ -1558,7 +1558,7 @@ public void testBatchUniq() {
1558
1558
assertEquals (1 , matches .get (1 ).second ().size ());
1559
1559
1560
1560
semgrex = SemgrexPattern .compile ("{}=x > {}=y :: uniq x y" );
1561
- matches = semgrex .matchSentences (sentences );
1561
+ matches = semgrex .matchSentences (sentences , false );
1562
1562
// now it should batch each of foo>bar, bar>baz, foo>baz
1563
1563
assertEquals (3 , matches .size ());
1564
1564
assertEquals (BATCH_PARSES [0 ], matches .get (0 ).first ().get (CoreAnnotations .TextAnnotation .class ));
@@ -1570,7 +1570,7 @@ public void testBatchUniq() {
1570
1570
}
1571
1571
1572
1572
public static void outputBatchResults (SemgrexPattern pattern , List <CoreMap > sentences ) {
1573
- List <Pair <CoreMap , List <SemgrexMatch >>> matches = pattern .matchSentences (sentences );
1573
+ List <Pair <CoreMap , List <SemgrexMatch >>> matches = pattern .matchSentences (sentences , false );
1574
1574
for (Pair <CoreMap , List <SemgrexMatch >> sentenceMatch : matches ) {
1575
1575
System .out .println ("Pattern matched at:" );
1576
1576
System .out .println (sentenceMatch .first ());
0 commit comments