/** * @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 Temporal(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 Temporal(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@Test public void testCurrencyInDateNoValue() throws Exception { AnalysisEngine ae = AnalysisEngineFactory.createEngine(CleanTemporal.class); jCas.setDocumentText("It cost $4.10"); Temporal dt = new Temporal(jCas); dt.setBegin(8); dt.setEnd(13); dt.addToIndexes(); assertEquals(1, JCasUtil.select(jCas, Temporal.class).size()); ae.process(jCas); assertEquals(0, JCasUtil.select(jCas, Temporal.class).size()); } }
public static Temporal createTemporal(JCas jCas, int begin, int end, String value) { Temporal d2 = new Temporal(jCas); d2.setValue(value); d2.setBegin(begin); d2.setEnd(end); d2.addToIndexes(); return d2; }
@Test public void testCurrencyInDate() throws Exception { AnalysisEngine ae = AnalysisEngineFactory.createEngine(CleanTemporal.class); jCas.setDocumentText("It cost $4.10"); Temporal dt = new Temporal(jCas); dt.setBegin(8); dt.setEnd(13); dt.setValue(dt.getCoveredText()); dt.addToIndexes(); assertEquals(1, JCasUtil.select(jCas, Temporal.class).size()); ae.process(jCas); assertEquals(0, JCasUtil.select(jCas, Temporal.class).size()); }
temporal.setScope(TemporalUtils.SCOPE_RANGE); temporal.setBegin(0); temporal.setEnd(text.length()); temporal.setTemporalType("Date"); temporal.setValue(text);
temporal.setScope(TemporalUtils.SCOPE_SINGLE); temporal.setBegin(0); temporal.setEnd(text.length()); temporal.setTemporalType("Date"); temporal.setValue(text);
monday.setEnd(41); monday.addToIndexes();
private void createDocument(JCas jCas) { jCas.reset(); jCas.setDocumentText("Simon was born in November 1980 in London, UK"); Person p = new Person(jCas); p.setValue("Simon"); p.setBegin(0); p.setEnd(5); p.addToIndexes(); Temporal d = new Temporal(jCas); d.setValue(NOVEMBER); d.setBegin(18); d.setEnd(26); d.addToIndexes(); Location l = new Location(jCas); l.setValue(LONDON); l.setBegin(35); l.setEnd(41); l.addToIndexes(); // entity value different to covering text "UK" Location l2 = new Location(jCas); l2.setValue(UNITED_KINGDOM); l2.setBegin(43); l2.setEnd(45); l2.addToIndexes(); assertEquals(1, JCasUtil.select(jCas, Person.class).size()); assertEquals(1, JCasUtil.select(jCas, Temporal.class).size()); assertEquals(2, JCasUtil.select(jCas, Location.class).size()); }
t.setEnd(55); t.setConfidence(1.0); t.setValue(DATE);
t.setEnd(42); t.setConfidence(1.0); t.setValue(DATE);
t.setEnd(42); t.setConfidence(1.0); t.setValue(DATE);
dt.setEnd(42); dt.setConfidence(1.0); dt.setValue(DATE);