use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderDateBorders.
@Test
public void builderDateBorders() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
// CollectionBuilderNew.Interface kbi = ;
assertNull(kc.date("pubDate", ""));
assertEquals("pubDate:[20051580 TO 20051580]", kc.date("pubDate", "2005-15-80").toString());
assertNull(kc.date("pubDate", "2005-15-8"));
assertNull(kc.date("pubDate", "2005-5-18"));
assertNull(kc.date("pubDate", "200-05-18"));
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderAndSimple.
@Test
public void builderAndSimple() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("author:tree", kc.andGroup().with(kc.term("author", "tree")).toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderSince.
@Test
public void builderSince() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("pubDate:[20050000 TO 99999999]", kc.since("pubDate", "2005").toString());
assertEquals("pubDate:[20051000 TO 99999999]", kc.since("pubDate", "2005-10").toString());
assertEquals("pubDate:[20051012 TO 99999999]", kc.since("pubDate", "2005-10-12").toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method LegacyFilterExample.
// The legacy tests were adopted from the legacy collection builder and reformuated
@Test
public void LegacyFilterExample() throws IOException {
CollectionBuilder kf = new CollectionBuilder();
/*
assertEquals("+textClass:tree", kf.and("textClass", "tree").toString());
*/
assertEquals("textClass:tree", kf.andGroup().with(kf.term("textClass", "tree")).toString());
/*
assertEquals("+textClass:tree +textClass:sport",
kf.and("textClass", "tree").and("textClass", "sport")
.toString());
*/
assertEquals("AndGroup(textClass:tree textClass:sport)", kf.andGroup().with(kf.term("textClass", "tree")).with(kf.term("textClass", "sport")).toString());
/*
assertEquals(
"+textClass:tree +textClass:sport textClass:news",
kf.and("textClass", "tree").and("textClass", "sport")
.or("textClass", "news").toString());
*/
assertEquals("OrGroup(AndGroup(textClass:tree textClass:sport) textClass:news)", kf.orGroup().with(kf.andGroup().with("textClass", "tree").with("textClass", "sport")).with("textClass", "news").toString());
/*
assertEquals("+textClass:tree +textClass:sport +textClass:news", kf
.and("textClass", "tree", "sport", "news").toString());
*/
assertEquals("AndGroup(textClass:tree textClass:sport textClass:news)", kf.andGroup().with("textClass", "tree").with("textClass", "sport").with("textClass", "news").toString());
/*
assertEquals("corpusID:c-1 corpusID:c-2 corpusID:c-3",
kf.or("corpusID", "c-1", "c-2", "c-3").toString());
*/
assertEquals("OrGroup(corpusID:c-1 corpusID:c-2 corpusID:c-3)", kf.orGroup().with("corpusID", "c-1").with("corpusID", "c-2").with("corpusID", "c-3").toString());
}
use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.
the class TestCollectionBuilder method builderAndCombined.
@Test
public void builderAndCombined() throws IOException {
CollectionBuilder kc = new CollectionBuilder();
assertEquals("AndGroup(author:tree title:name)", kc.andGroup().with(kc.term("author", "tree")).with(kc.term("title", "name")).toString());
}
Aggregations