use of de.ids_mannheim.korap.response.Match in project Krill by KorAP.
the class TestMatchIdentifier method indexDependencyAnnotations.
@Test
public void indexDependencyAnnotations() throws IOException, QueryException {
KrillIndex ki = new KrillIndex();
FieldDocument fd = ki.addDoc(2, getClass().getResourceAsStream("/goe/Corpus-Doc-0002.json"), false);
ki.commit();
Match km;
km = ki.getMatchInfo("match-Corpus/Doc/0002-p0-6", "tokens", "malt", null, true, false);
assertEquals("SnippetHTML (1)", "<span class=\"context-left\">" + "</span>" + "<span class=\"match\">" + "<span xml:id=\"token-Corpus/Doc/0002-p0-6\">" + "<mark>" + "<span xml:id=\"token-Corpus/Doc/0002-p0\">" + "<span xlink:title=\"malt/d:ROOT\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p0-6\">Maximen</span>" + "</span>" + " " + "<span xml:id=\"token-Corpus/Doc/0002-p1\">" + "<span xlink:title=\"malt/d:KON\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p0\">und</span>" + "</span>" + " " + "<span xlink:title=\"malt/d:CJ\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p1\">Reflexionen</span>" + " " + "<span xml:id=\"token-Corpus/Doc/0002-p3\">" + "<span xlink:title=\"malt/d:KON\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p0\">Religion</span>" + "</span>" + " " + "<span xml:id=\"token-Corpus/Doc/0002-p4\">" + "<span xlink:title=\"malt/d:KON\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p3\">und</span>" + "</span>" + " " + "<span xlink:title=\"malt/d:CJ\" xlink:show=\"none\" xlink:href=\"#token-Corpus/Doc/0002-p4\">Christentum</span>" + "</mark>" + "</span>" + "</span>" + "<span class=\"context-right\">" + "<span class=\"more\"></span>" + "</span>", km.getSnippetHTML());
}
use of de.ids_mannheim.korap.response.Match in project Krill by KorAP.
the class TestMatchIdentifier method indexExample6Spans.
@Test
public void indexExample6Spans() throws IOException, QueryException {
KrillIndex ki = new KrillIndex();
ki.addDoc(createSimpleFieldDoc());
ki.commit();
Match km = ki.getMatchInfo("match-c1!d1-p7-10(4)8-8(2)7-8", "tokens", null, null, true, false);
assertEquals("SnippetBrackets (1)", "... [[{x/tag:{f/m:acht:{f/y:eight:{it/is:8:{x/o:achtens:b}}}}{f/m:neun:{f/y:nine:{it/is:9:{x/o:neuntens:a}}}}{f/m:zehn:{f/y:ten:{it/is:10:{x/o:zehntens:c}}}}}]]", km.getSnippetBrackets());
}
use of de.ids_mannheim.korap.response.Match in project Krill by KorAP.
the class TestMatchIdentifier method indexExample6Relations.
@Test
public void indexExample6Relations() throws IOException, QueryException {
KrillIndex ki = new KrillIndex();
ki.addDoc(createSimpleFieldDoc());
ki.commit();
Match km = ki.getMatchInfo("match-c1!d1-p0-5(4)8-8(2)7-8", "tokens", "x", null, true, false);
assertEquals("SnippetBrackets (1)", "[[{x/o:erstens:{x/rel:a>3:a}}{x/o:zweitens:b}{x/o:drittens:c}{#3:{x/o:viertens:a}}{x/o:fünftens:b}]] ...", km.getSnippetBrackets());
assertEquals("SnippetHTML (1)", "<span class=\"context-left\">" + "</span>" + "<span class=\"match\">" + "<mark>" + "<span title=\"x/o:erstens\">" + "<span xlink:title=\"x/rel:a\" xlink:show=\"none\" " + "xlink:href=\"#token-c1!d1-p3\">" + "a" + "</span>" + "</span>" + "<span title=\"x/o:zweitens\">" + "b" + "</span>" + "<span title=\"x/o:drittens\">" + "c" + "</span>" + "<span xml:id=\"token-c1!d1-p3\">" + "<span title=\"x/o:viertens\">" + "a" + "</span>" + "</span>" + "<span title=\"x/o:fünftens\">" + "b" + "</span>" + "</mark>" + "</span>" + "<span class=\"context-right\">" + "<span class=\"more\">" + "</span>" + "</span>", km.getSnippetHTML());
km = ki.getMatchInfo("match-c1!d1-p0-5(7)2-3(4)8-8(2)7-8", "tokens", "x", null, true, true);
assertEquals("SnippetHTML (2)", "<span class=\"context-left\">" + "</span>" + "<span class=\"match\">" + "<mark>" + "<span title=\"x/o:erstens\">" + "<span xlink:title=\"x/rel:a\" " + "xlink:show=\"none\" " + "xlink:href=\"#token-c1!d1-p3\">a</span>" + "</span>" + "<span title=\"x/o:zweitens\">b</span>" + "<mark class=\"class-7 level-0\">" + "<span title=\"x/o:drittens\">c</span>" + "<span xml:id=\"token-c1!d1-p3\">" + "<span title=\"x/o:viertens\">a</span>" + "</span>" + "</mark>" + "<span title=\"x/o:fünftens\">b</span>" + "</mark>" + "</span>" + "<span class=\"context-right\">" + "<span class=\"more\"></span>" + "</span>", km.getSnippetHTML());
}
use of de.ids_mannheim.korap.response.Match in project Krill by KorAP.
the class TestMatchIdentifier method indexMultipleSpanStarts.
@Test
public void indexMultipleSpanStarts() throws IOException, QueryException {
KrillIndex ki = new KrillIndex();
ki.addDoc(createSimpleFieldDoc5());
FieldDocument fd = ki.addDoc(2, getClass().getResourceAsStream("/goe/AGA-03828-new.json.gz"), true);
ki.commit();
Match km;
km = ki.getMatchInfo("match-c1!d5-p0-4", "tokens", null, null, true, false);
assertEquals("SnippetBrackets (with Spans)", "[[{x/tag:a:{x/tag:b:{x/tag:c:{x/tag:v:x}}y}}z]]", km.getSnippetBrackets());
assertEquals(fd.getTextSigle(), "GOE/AGA/03828");
assertEquals(fd.getTitle(), "Autobiographische Einzelheiten");
Krill ks = new Krill(new QueryBuilder("tokens").seg("marmot/m:case:nom").with("marmot/m:degree:pos"));
Result kr = ks.apply(ki);
assertEquals(83, kr.getTotalResults());
assertEquals("match-GOE/AGA/03828-p0-1", kr.getMatch(0).getID());
km = ki.getMatchInfo("match-GOE/AGA/03828-p0-10", "tokens", "malt", null, true, false);
assertEquals("SnippetBrackets (with Spans)", "[[{malt/d:ATTR>2:Autobiographische} " + "{malt/d:ATTR>2:einzelheiten} " + "{#2:{malt/d:ROOT>0-21:Selbstschilderung}} " + "({malt/d:APP>2:1}) " + "{malt/d:ADV>5:immer} " + "{#5:{malt/d:ATTR>2:tätiger}}, " + "{#6:{malt/d:PP>13:nach}} " + "{#7:{malt/d:PN>6:innen}} " + "{malt/d:KON>7:und} " + "{malt/d:ADV>11:außen}]] " + "...", km.getSnippetBrackets());
}
use of de.ids_mannheim.korap.response.Match in project Krill by KorAP.
the class TestMatchIdentifier method snippetBugTest2.
@Test
public void snippetBugTest2() throws IOException, QueryException {
KrillIndex ki = new KrillIndex();
ki.addDoc(getClass().getResourceAsStream("/wiki/wdd17-982-72848.json.gz"), true);
ki.commit();
Match km = ki.getMatchInfo("match-WDD17/982/72848-p15844-15846", "tokens", "lwc", "d", true, true, true);
String snippet = km.getSnippetHTML();
assertEquals("SnippetBrackets (with Spans)", snippet, "<span class=\"context-left\"></span>" + "<span class=\"match\">" + "<span xml:id=\"token-WDD17/982/72848-p15836-15839\">" + "<span xlink:title=\"lwc/d:NK\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15838\">Ein</span>" + " " + "<span xlink:title=\"lwc/d:NK\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15838\">letztes</span>" + " " + "<span xml:id=\"token-WDD17/982/72848-p15838\">" + "<span xlink:title=\"lwc/d:--\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15836-15839\">mal</span>" + "</span>" + ": " + "<span xml:id=\"token-WDD17/982/72848-p15839-15840\">" + "<span xlink:title=\"lwc/d:--\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15839-15840\">AL</span>" + "</span>" + "</span>" + "<span xlink:show=\"other\" data-action=\"join\" xlink:href=\"#token-WDD17/982/72848-p15839-15840\">" + ":" + "<span xml:id=\"token-WDD17/982/72848-p15840-15846\">" + "<span xml:id=\"token-WDD17/982/72848-p15840\">" + "<span xlink:title=\"lwc/d:--\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15840-15846\">halt</span>" + "</span>" + "</span>" + "</span>" + // "<span xml:id=\"token-WDD17/982/72848-p15840-15846\">"+
"<span xlink:show=\"other\" data-action=\"join\" xlink:href=\"#token-WDD17/982/72848-p15840-15846\">" + " " + "<span xlink:title=\"lwc/d:NK\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15842\">den</span>" + " " + "<span xml:id=\"token-WDD17/982/72848-p15842\">" + "<span xlink:title=\"lwc/d:OA\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15843\">Ball</span>" + "</span>" + " " + "<span xml:id=\"token-WDD17/982/72848-p15843\">" + "<span xlink:title=\"lwc/d:PD\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15840\">flach</span>" + "</span>" + ", " + "<mark>" + "<span xlink:title=\"lwc/d:MO\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15845\">ganz</span>" + " " + "<span xml:id=\"token-WDD17/982/72848-p15845\">" + "<span xlink:title=\"lwc/d:CJ\" xlink:show=\"none\" xlink:href=\"#token-WDD17/982/72848-p15843\">flach</span>" + "</span>" + "</mark>" + "." + "</span>" + "</span>" + "<span class=\"context-right\"></span>");
}
Aggregations