@Test public void testAthleteIsMadePersonOtherSource() throws AnalysisEngineProcessException, ResourceInitializationException { processJCas( TemplateFieldToEntityAnnotator.PARAM_ENTITY_TYPE, "common.Person", TemplateFieldToEntityAnnotator.PARAM_FIELD_NAME, "athlete", TemplateFieldToEntityAnnotator.PARAM_RECORD_NAME, "report", TemplateFieldToEntityAnnotator.PARAM_SOURCE, "ketchup"); assertFalse(JCasUtil.iterator(jCas, Person.class).hasNext()); } }
@Test public void testAthleteIsMadePersonNoSource() throws AnalysisEngineProcessException, ResourceInitializationException { processJCas( TemplateFieldToEntityAnnotator.PARAM_ENTITY_TYPE, "common.Person", TemplateFieldToEntityAnnotator.PARAM_FIELD_NAME, "athlete", TemplateFieldToEntityAnnotator.PARAM_RECORD_NAME, "report"); Person person = JCasUtil.selectSingle(jCas, Person.class); assertEquals("fox", person.getValue()); assertEquals(16, person.getBegin()); assertEquals(19, person.getEnd()); }
@Test public void testAthleteIsMadePersonSource() throws AnalysisEngineProcessException, ResourceInitializationException { processJCas( TemplateFieldToEntityAnnotator.PARAM_ENTITY_TYPE, "common.Person", TemplateFieldToEntityAnnotator.PARAM_FIELD_NAME, "athlete", TemplateFieldToEntityAnnotator.PARAM_RECORD_NAME, "report", TemplateFieldToEntityAnnotator.PARAM_SOURCE, "brownSauce"); Person person = JCasUtil.selectSingle(jCas, Person.class); assertEquals("fox", person.getValue()); assertEquals(16, person.getBegin()); assertEquals(19, person.getEnd()); }