/** * @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Section(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@Test public void testGenerateNested() { Section section = new Section(jCas); section.setBegin(0); section.setDepth(1); section.setEnd(TEXT.length()); section.addToIndexes(); Paragraph paragraph = new Paragraph(jCas); paragraph.setBegin(0); paragraph.setDepth(2); paragraph.setEnd(TEXT.length()); paragraph.addToIndexes(); ItemHierarchy<Structure> structureHierarchy = StructureHierarchy.build(jCas, structuralClasses); SelectorPath path1 = structureHierarchy.getSelectorPath(paragraph); assertEquals("Section:nth-of-type(1) > Paragraph:nth-of-type(1)", path1.toString()); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Section(JCas jcas) { super(jcas); readObject(); }
@Test public void testGenerateInterupted() { Section section = new Section(jCas); section.setBegin(0); section.setDepth(1); section.setEnd(TEXT.length()); section.addToIndexes(); paragraph1.addToIndexes(); Section subSection = new Section(jCas); subSection.setBegin(21); subSection.setDepth(2); subSection.setEnd(22); subSection.addToIndexes();
/** * Internal - constructor used by generator * * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Section(int addr, TOP_Type type) { super(addr, type); readObject(); }
@Test public void testSelectNested() throws InvalidParameterException { Section section = new Section(jCas); section.setBegin(0); section.setDepth(1); section.setEnd(TEXT.length()); section.addToIndexes();
/** * @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Section(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Section(JCas jcas) { super(jcas); readObject(); }
@Test public void testGenerateNested2() { Section section = new Section(jCas); section.setBegin(0); section.setDepth(1); section.setEnd(TEXT.length()); section.addToIndexes(); Paragraph paragraph1 = new Paragraph(jCas); paragraph1.setBegin(0); paragraph1.setDepth(2); paragraph1.setEnd(20); paragraph1.addToIndexes(); Paragraph paragraph2 = new Paragraph(jCas); paragraph2.setBegin(20); paragraph2.setDepth(2); paragraph2.setEnd(TEXT.length()); paragraph2.addToIndexes(); ItemHierarchy<Structure> structureHierarchy = StructureHierarchy.build(jCas, structuralClasses); SelectorPath path1 = structureHierarchy.getSelectorPath(paragraph1); SelectorPath path2 = structureHierarchy.getSelectorPath(paragraph2); assertEquals("Section:nth-of-type(1) > Paragraph:nth-of-type(1)", path1.toString()); assertEquals("Section:nth-of-type(1) > Paragraph:nth-of-type(2)", path2.toString()); }
/** * Internal - constructor used by generator * * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Section(int addr, TOP_Type type) { super(addr, type); readObject(); }
@Test public void testGenerateNestedToDepth1() { Section section = new Section(jCas); section.setBegin(0); section.setDepth(1); section.setEnd(TEXT.length()); section.addToIndexes(); Paragraph paragraph1 = new Paragraph(jCas); paragraph1.setBegin(0); paragraph1.setDepth(2); paragraph1.setEnd(20); paragraph1.addToIndexes(); Paragraph paragraph2 = new Paragraph(jCas); paragraph2.setBegin(20); paragraph2.setDepth(2); paragraph2.setEnd(TEXT.length()); paragraph2.addToIndexes(); ItemHierarchy<Structure> structureHierarchy = StructureHierarchy.build(jCas, structuralClasses); SelectorPath path1 = structureHierarchy.getSelectorPath(paragraph1); SelectorPath path2 = structureHierarchy.getSelectorPath(paragraph1); assertEquals("Section:nth-of-type(1)", path1.toDepth(1).toString()); assertEquals("Section:nth-of-type(1)", path2.toDepth(1).toString()); }
Section section1 = new Section(jCas); section1.setBegin(++cursor); section1.setDepth(depth); section1.setEnd(cursor); section1.addToIndexes(); Section section2 = new Section(jCas); section2.setBegin(cursor); section2.setDepth(depth); section2.setEnd(cursor); section2.addToIndexes(); Section section3 = new Section(jCas); section3.setBegin(cursor); section3.setDepth(depth); section3.setEnd(cursor); section3.addToIndexes(); Section section4 = new Section(jCas); section4.setBegin(++cursor); section4.setDepth(depth); section4.setEnd(cursor); section4.addToIndexes();
doc.addToIndexes(); final Section section = new Section(jCas); section.setDepth(1); section.setBegin(0); section.setEnd(text.length()); section.addToIndexes();
--depth; section = new Section(jCas); section.setBegin(++cursor); section.setDepth(depth); paragraph3.addToIndexes(); section.setEnd(cursor); section.addToIndexes();