Tabnine Logo
TemplateRecordDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
TemplateRecordDefinition
in
uk.gov.dstl.baleen.types.templates

Best Java code snippets using uk.gov.dstl.baleen.types.templates.TemplateRecordDefinition (Showing top 13 results out of 315)

origin: dstl/baleen

/**
 * @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 TemplateRecordDefinition(JCas jcas, int begin, int end) {
 super(jcas);
 setBegin(begin);
 setEnd(end);
 readObject();
}
origin: dstl/baleen

@Override
@Before
public void setup() throws IOException {
 super.setup();
 TemplateRecordDefinition record1 = new TemplateRecordDefinition(jCas);
 record1.setBegin(53);
 record1.setEnd(158);
 record1.setName("record1");
 record1.addToIndexes();
}
origin: dstl/baleen

 @Test
 public void annotateRepeatingRecord()
   throws AnalysisEngineProcessException, ResourceInitializationException {
  jCas.setDocumentText(REPEAT_RECORD_TEXT);
  processJCas();
  TemplateRecordDefinition record =
    JCasUtil.selectByIndex(jCas, TemplateRecordDefinition.class, 0);
  assertEquals(90, record.getBegin());
  assertEquals(176, record.getEnd());
  assertTrue(record.getRepeat());
  assertEquals(
    " \n"
      + "    Full Name:  \n"
      + "    <<field:PersonFullName>> \n"
      + " Description: \n"
      + " <<field:Description>>",
    record.getCoveredText());
 }
}
origin: dstl/baleen

 TemplateRecordDefinition recordDefinition)
 throws AnalysisEngineProcessException {
String name = recordDefinition.getName();
if (recordConfigurations.containsKey(name)) {
 throw new AnalysisEngineProcessException(
      jCas, Structure.class, recordDefinition.getBegin(), recordDefinition.getBegin())
    .stream()
    .max(Comparator.comparingInt(Structure::getDepth));
Optional<Structure> endStructure =
  JCasUtil.selectCovering(
      jCas, Structure.class, recordDefinition.getEnd(), recordDefinition.getEnd())
    .stream()
    .max(Comparator.comparingInt(Structure::getDepth));
if (recordDefinition.getRepeat()) {
 int depth =
   Math.max(
     followingPath,
     fields,
     recordDefinition.getBegin()));
} else {
 recordConfigurations.put(
   name,
   new TemplateRecordConfiguration(
     name, precedingPath, followingPath, fields, recordDefinition.getBegin()));
origin: dstl/baleen

@Test
public void annotate2Record()
  throws AnalysisEngineProcessException, ResourceInitializationException {
 jCas.setDocumentText(RECORD2_TEXT);
 processJCas();
 TemplateRecordDefinition record =
   JCasUtil.selectByIndex(jCas, TemplateRecordDefinition.class, 0);
 assertEquals(83, record.getBegin());
 assertEquals(169, record.getEnd());
 assertEquals(
   " \n"
     + "    Full Name:  \n"
     + "    <<field:PersonFullName>> \n"
     + " Description: \n"
     + " <<field:Description>>",
   record.getCoveredText());
 TemplateRecordDefinition record2 =
   JCasUtil.selectByIndex(jCas, TemplateRecordDefinition.class, 1);
 assertEquals(293, record2.getBegin());
 assertEquals(379, record2.getEnd());
 assertEquals(
   " \n"
     + "    Full Name:  \n"
     + "    <<field:PersonFullName>> \n"
     + " Description: \n"
     + " <<field:Description>>",
   record2.getCoveredText());
}
origin: dstl/baleen

/**
 * @generated
 * @param jcas JCas to which this Feature Structure belongs
 */
public TemplateRecordDefinition(JCas jcas) {
 super(jcas);
 readObject();
}
origin: dstl/baleen

@Override
@Before
public void setup() throws IOException {
 super.setup();
 TemplateRecordDefinition record1 = new TemplateRecordDefinition(jCas);
 record1.setBegin(53);
 record1.setEnd(158);
 record1.setName("record1");
 record1.setRepeat(true);
 record1.addToIndexes();
}
origin: dstl/baleen

@Test
public void annotateRecord()
  throws AnalysisEngineProcessException, ResourceInitializationException {
 jCas.setDocumentText(RECORD_TEXT);
 processJCas();
 TemplateRecordDefinition record =
   JCasUtil.selectByIndex(jCas, TemplateRecordDefinition.class, 0);
 assertEquals(83, record.getBegin());
 assertEquals(169, record.getEnd());
 assertFalse(record.getRepeat());
 assertEquals(
   " \n"
     + "    Full Name:  \n"
     + "    <<field:PersonFullName>> \n"
     + " Description: \n"
     + " <<field:Description>>",
   record.getCoveredText());
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * Internal - constructor used by generator
 *
 * @generated
 * @param addr low level Feature Structure reference
 * @param type the type of this Feature Structure
 */
public TemplateRecordDefinition(int addr, TOP_Type type) {
 super(addr, type);
 readObject();
}
origin: dstl/baleen

@Test(expected = AnalysisEngineProcessException.class)
public void testErrorWhenRecordNameNotUnique()
  throws AnalysisEngineProcessException, ResourceInitializationException, JsonParseException,
    JsonMappingException, IOException {
 TemplateRecordDefinition record1 = new TemplateRecordDefinition(jCas);
 record1.setBegin(123);
 record1.setEnd(140);
 record1.setName("record1");
 record1.addToIndexes();
 TemplateFieldDefinition field1 = new TemplateFieldDefinition(jCas);
 field1.setBegin(72);
 field1.setEnd(75);
 field1.setName("myField1");
 field1.addToIndexes();
 processJCas(
   TemplateRecordConfigurationCreatingConsumer.PARAM_OUTPUT_DIRECTORY,
   tempDirectory.toString());
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * @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 TemplateRecordDefinition(JCas jcas, int begin, int end) {
 super(jcas);
 setBegin(begin);
 setEnd(end);
 readObject();
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * @generated
 * @param jcas JCas to which this Feature Structure belongs
 */
public TemplateRecordDefinition(JCas jcas) {
 super(jcas);
 readObject();
}
origin: dstl/baleen

/**
 * Internal - constructor used by generator
 *
 * @generated
 * @param addr low level Feature Structure reference
 * @param type the type of this Feature Structure
 */
public TemplateRecordDefinition(int addr, TOP_Type type) {
 super(addr, type);
 readObject();
}
uk.gov.dstl.baleen.types.templatesTemplateRecordDefinition

Javadoc

Beginning / end marker of a record (multiple fields) in a template document, used to create record definitions for subsequent annotation of real documents. Updated by JCasGen Tue Apr 18 12:23:04 BST 2017 XML source: /Users/stuarthendren/git/tenode/baleen/baleen/baleen-uima/src/main/resources/types/template_type_system.xml

Most used methods

  • getBegin
  • getEnd
  • getRepeat
    getter for repeat - gets Declare that this record is repeatable in the document. For example, a repe
  • setBegin
  • setEnd
  • <init>
  • addToIndexes
  • getCoveredText
  • getName
    getter for name - gets The name of the record, eg Address
  • readObject
    Write your own initialization here
  • setName
    setter for name - sets The name of the record, eg Address
  • setRepeat
    setter for repeat - sets Declare that this record is repeatable in the document. For example, a repe
  • setName,
  • setRepeat

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JOptionPane (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now