use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderDateMonth.
@Test
public void builderDateMonth() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("pubDate:[20051000 TO 20051099]", kc.date("pubDate", "2005-10").toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderTill.
@Test
public void builderTill() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("pubDate:[0 TO 20059999]", kc.till("pubDate", "2005").toString());
assertEquals("pubDate:[0 TO 20051299]", kc.till("pubDate", "2005-12").toString());
assertEquals("pubDate:[0 TO 20051204]", kc.till("pubDate", "2005-12-04").toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderNegation.
@Test
public void builderNegation() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
CollectionBuilder.Interface kbi = kc.term("author", "tree").not();
assertEquals("author:tree", kbi.toString());
assertTrue(kbi.isNegative());
kbi = kc.andGroup().with(kc.term("author", "tree").not());
assertEquals("author:tree", kbi.toString());
assertTrue(kbi.isNegative());
kbi = kc.orGroup().with(kc.term("author", "tree").not());
assertEquals("author:tree", kbi.toString());
assertTrue(kbi.isNegative());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderRegex.
@Test
public void builderRegex() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("QueryWrapperFilter(author:/tre*?/)", kc.re("author", "tre*?").toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderOrSimple.
@Test
public void builderOrSimple() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("author:tree", kc.orGroup().with(kc.term("author", "tree")).toString());
}
Aggregations