@Test public void testToday() throws Exception { jCas.setDocumentText("Today is Wednesday"); setDocumentDate(); processJCas(); assertEquals(1, JCasUtil.select(jCas, Temporal.class).size()); Temporal t1 = JCasUtil.selectByIndex(jCas, Temporal.class, 0); assertEquals("Today", t1.getCoveredText()); assertEquals(relativeTo.atStartOfDay().toEpochSecond(ZoneOffset.UTC), t1.getTimestampStart()); assertEquals( relativeTo.plusDays(1).atStartOfDay().toEpochSecond(ZoneOffset.UTC), t1.getTimestampStop()); }
private void today(TextBlock block) { Pattern p = Pattern.compile("\\btoday\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { createRelativeDay(block, m.start(), m.end(), 0); } }
RelativeDate extends BaleenTextAwareAnnotator { private void today(TextBlock block) { Pattern p = Pattern.compile("\\btoday\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { createRelativeDay(block, m.start(), m.end(), 0); } } }
RelativeDate extends BaleenTextAwareAnnotator { private void today(TextBlock block) { Pattern p = Pattern.compile("\\btoday\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { createRelativeDay(block, m.start(), m.end(), 0); } }  }
RelativeDate extends BaleenTextAwareAnnotator { private void today(TextBlock block) { Pattern p = Pattern.compile("\\btoday\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { createRelativeDay(block, m.start(), m.end(), 0); } }  @Override AnalysisEngineAction getAction(); }
RelativeDate extends BaleenTextAwareAnnotator { private void today(TextBlock block) { Pattern p = Pattern.compile("\\btoday\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { createRelativeDay(block, m.start(), m.end(), 0); } }  @Override AnalysisEngineAction getAction(); static final String PARAM_DATE_FORMAT; static final String PARAM_METADATA_FIELDS; }