/** * @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 TemplateField(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * @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 TemplateField(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
private void addRequiredField(String source) { TemplateField field = new TemplateField(jCas); field.setBegin(53); field.setEnd(105); field.setName("required"); field.setSource(source); field.setValue(PARA2); field.addToIndexes(); }
private void addOptionalField(String source) { TemplateField field = new TemplateField(jCas); field.setBegin(122); field.setEnd(125); field.setName("optional"); field.setSource(source); field.setValue("rat"); field.addToIndexes(); } }
@Before public void setup() throws IOException { jCas.setDocumentText(TEXT); tempDirectory = Files.createTempDirectory(TemplateFieldJsonReportConsumerTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); DocumentAnnotation documentAnnotation = (DocumentAnnotation) jCas.getDocumentAnnotationFs(); documentAnnotation.setSourceUri(SOURCEURI); Paragraph paragraph1 = new Paragraph(jCas); paragraph1.setBegin(0); paragraph1.setDepth(1); paragraph1.setEnd(52); paragraph1.addToIndexes(); Paragraph paragraph2 = new Paragraph(jCas); paragraph2.setBegin(53); paragraph2.setDepth(1); paragraph2.setEnd(105); paragraph2.addToIndexes(); TemplateField field = new TemplateField(jCas); field.setBegin(53); field.setEnd(105); field.addToIndexes(); }
@Before public void setup() throws IOException { jCas.setDocumentText(TEXT); TemplateRecord record = new TemplateRecord(jCas); record.setName("report"); record.setSource("brown"); record.setBegin(0); record.setEnd(52); record.addToIndexes(); TemplateField field1 = new TemplateField(jCas); field1.setBegin(16); field1.setEnd(19); field1.setName("athlete"); field1.addToIndexes(); TemplateField field2 = new TemplateField(jCas); field2.setBegin(41); field2.setEnd(44); field2.setName("spectator"); field2.addToIndexes(); }
@Before public void setup() throws IOException { jCas.setDocumentText(TEXT); TemplateRecord record = new TemplateRecord(jCas); record.setName("report"); record.setSource("brownSauce"); record.setBegin(0); record.setEnd(52); record.addToIndexes(); TemplateField field1 = new TemplateField(jCas); field1.setBegin(16); field1.setEnd(19); field1.setName("athlete"); field1.addToIndexes(); TemplateField field2 = new TemplateField(jCas); field2.setBegin(41); field2.setEnd(44); field2.setName("spectactor"); field2.addToIndexes(); }
@Override @Before public void setup() throws IOException { super.setup(); TemplateRecord otherRecord = new TemplateRecord(jCas); otherRecord.setBegin(53); otherRecord.setEnd(105); otherRecord.setName("otherRecord"); otherRecord.setSource("other"); otherRecord.addToIndexes(); TemplateField otherField = new TemplateField(jCas); otherField.setBegin(53); otherField.setEnd(68); otherField.setName("otherField"); otherField.setSource("other"); otherField.setValue("default"); otherField.addToIndexes(); }
record1Field1.setBegin(0); record1Field1.setEnd(15); record1Field1.setName("record1Field1"); record1Field2.setBegin(16); record1Field2.setEnd(31); record1Field2.setName("record1Field2"); record2Field1.setBegin(53); record2Field1.setEnd(68); record2Field1.setName("record2Field1"); record2Field2.setBegin(69); record2Field2.setEnd(84); record2Field2.setName("record2Field2"); noRecordField1.setBegin(106); noRecordField1.setEnd(121); noRecordField1.setName("noRecordField1"); noRecordField2.setBegin(122); noRecordField2.setEnd(137); noRecordField2.setName("noRecordField2");