@Test public void testKeepSmallest() throws AnalysisEngineProcessException, ResourceInitializationException { addStructure(); final Quotation q = new Quotation(jCas, 28, 38); q.addToIndexes(); processJCas(TextBlocks.PARAM_KEEP_SMALLEST, true); final List<Text> list = new ArrayList<>(JCasUtil.select(jCas, Text.class)); assertEquals(1, list.size()); assertEquals("paragraph.", list.get(0).getCoveredText()); } }
@Test public void testKeepBiggest() throws AnalysisEngineProcessException, ResourceInitializationException { addStructure(); final Quotation q = new Quotation(jCas, 29, 38); q.addToIndexes(); processJCas(TextBlocks.PARAM_KEEP_SMALLEST, false); final List<Text> list = new ArrayList<>(JCasUtil.select(jCas, Text.class)); assertEquals(1, list.size()); assertEquals("This is a paragraph.", list.get(0).getCoveredText()); }
document.addToIndexes(); quotation1 = new Quotation(jCas); quotation1.setBegin(cursor); quotation1.setDepth(++depth); quotation1.addToIndexes(); quotation2 = new Quotation(jCas); quotation2.setBegin(++cursor); quotation2.setDepth(depth); link1.addToIndexes(); quotation3 = new Quotation(jCas); quotation3.setBegin(++cursor); quotation3.setDepth(++depth); quotation3.addToIndexes(); quotation4 = new Quotation(jCas); quotation4.setBegin(++cursor); quotation4.setDepth(depth); quotation5 = new Quotation(jCas); quotation5.setBegin(++cursor); quotation5.setDepth(++depth);
document.addToIndexes(); quotation1 = new Quotation(jCas); quotation1.setBegin(cursor); quotation1.setDepth(++depth); quotation1.addToIndexes(); quotation2 = new Quotation(jCas); quotation2.setBegin(++cursor); quotation2.setDepth(depth); link1.addToIndexes(); quotation3 = new Quotation(jCas); quotation3.setBegin(++cursor); quotation3.setDepth(++depth); quotation3.addToIndexes(); quotation4 = new Quotation(jCas); quotation4.setBegin(++cursor); quotation4.setDepth(depth); quotation5 = new Quotation(jCas); quotation5.setBegin(++cursor); quotation5.setDepth(++depth);
s = new Quotation(jCas); break;
s = new Quotation(jCas); break;