@Test public void testTomorrow() throws Exception { jCas.setDocumentText("Tomorrow was Thursday, and the day after tomorrow is Friday"); setDocumentDate(); processJCas(); assertEquals(2, JCasUtil.select(jCas, Temporal.class).size()); Temporal t1 = JCasUtil.selectByIndex(jCas, Temporal.class, 0); assertEquals("Tomorrow", t1.getCoveredText()); assertEquals( relativeTo.plusDays(1).atStartOfDay().toEpochSecond(ZoneOffset.UTC), t1.getTimestampStart()); assertEquals( relativeTo.plusDays(2).atStartOfDay().toEpochSecond(ZoneOffset.UTC), t1.getTimestampStop()); Temporal t2 = JCasUtil.selectByIndex(jCas, Temporal.class, 1); assertEquals("day after tomorrow", t2.getCoveredText()); assertEquals( relativeTo.plusDays(2).atStartOfDay().toEpochSecond(ZoneOffset.UTC), t2.getTimestampStart()); assertEquals( relativeTo.plusDays(3).atStartOfDay().toEpochSecond(ZoneOffset.UTC), t2.getTimestampStop()); }
private void tomorrow(TextBlock block) { Pattern p = Pattern.compile("\\b(day after )?tomorrow\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { if (m.group(1) != null) { createRelativeDay(block, m.start(), m.end(), 2); } else { createRelativeDay(block, m.start(), m.end(), 1); } } }
RelativeDate extends BaleenTextAwareAnnotator { private void tomorrow(TextBlock block) { Pattern p = Pattern.compile("\\b(day after )?tomorrow\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { if (m.group(1) != null) { createRelativeDay(block, m.start(), m.end(), 2); } else { createRelativeDay(block, m.start(), m.end(), 1); } } } }
RelativeDate extends BaleenTextAwareAnnotator { private void tomorrow(TextBlock block) { Pattern p = Pattern.compile("\\b(day after )?tomorrow\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { if (m.group(1) != null) { createRelativeDay(block, m.start(), m.end(), 2); } else { createRelativeDay(block, m.start(), m.end(), 1); } } }  }
RelativeDate extends BaleenTextAwareAnnotator { private void tomorrow(TextBlock block) { Pattern p = Pattern.compile("\\b(day after )?tomorrow\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { if (m.group(1) != null) { createRelativeDay(block, m.start(), m.end(), 2); } else { createRelativeDay(block, m.start(), m.end(), 1); } } }  @Override AnalysisEngineAction getAction(); }
RelativeDate extends BaleenTextAwareAnnotator { private void tomorrow(TextBlock block) { Pattern p = Pattern.compile("\\b(day after )?tomorrow\\b", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(block.getCoveredText()); while (m.find()) { if (m.group(1) != null) { createRelativeDay(block, m.start(), m.end(), 2); } else { createRelativeDay(block, m.start(), m.end(), 1); } } }  @Override AnalysisEngineAction getAction(); static final String PARAM_DATE_FORMAT; static final String PARAM_METADATA_FIELDS; }