I was trying to use the 'SUTime' functionaly from core-nlp. If I try to use this from the online demo for a 'sampleInput'
From next month, we will have meeting on every friday, from 3:00 pm to 4:00 pm.”
which results in (with reference date: 2017-1-1):
<TIMEX3 range="(2017-02-01,2017-02-28,P1M)" tid="t1" type="DATE" value="2017-02">next month</TIMEX3>
But, when I try to run the same input through SUTime API, it results in (esp: 'Temporal Value')
<Token text="next month" Temporal Value="THIS P1M OFFSET P1M" Timex="null" Timex type="DATE" Start offset="5" End Offset="15" />
Below is the code:
List<CoreMap> timexAnnsAll = document.get(TimeAnnotations.TimexAnnotations.class);
for (CoreMap cm : timexAnnsAll) {
try {
List<CoreLabel> tokens = cm.get(CoreAnnotations.TokensAnnotation.class);
Temporal temporal = cm.get(TimeExpression.Annotation.class).getTemporal();
System.out.println("Token text : " + cm.toString());
System.out.println("Temporal Value : " + temporal.toString());
System.out.println("Timex : " + temporal.getTimexValue());
System.out.println("Timex type : " + temporal.getTimexType().name());