allTimeExpressions = new ArrayList<CoreMap>();
List<CoreMap> allNumerics = new ArrayList<CoreMap>();
for (CoreMap sentence: sentences) {
// make sure that token character offsets align with the actual sentence text
// They may not align due to token normalizations, such as "(" to "-LRB-".
CoreMap alignedSentence = NumberSequenceClassifier.alignSentence(sentence);
// uncomment the next line for verbose dumping of tokens....
// System.err.println("SENTENCE: " + ((ArrayCoreMap) sentence).toShorterString());
List<CoreMap> timeExpressions =
timexExtractor.extractTimeExpressionCoreMaps(alignedSentence, docDate, timeIndex);
if (timeExpressions != null) {
allTimeExpressions.addAll(timeExpressions);
sentence.set(TimeAnnotations.TimexAnnotations.class, timeExpressions);
for (CoreMap timeExpression:timeExpressions) {
timeExpression.set(CoreAnnotations.SentenceIndexAnnotation.class, sentence.get(CoreAnnotations.SentenceIndexAnnotation.class));
}
}
List<CoreMap> numbers = alignedSentence.get(CoreAnnotations.NumerizedTokensAnnotation.class);
if(numbers != null){
sentence.set(CoreAnnotations.NumerizedTokensAnnotation.class, numbers);
allNumerics.addAll(numbers);
}
}