如果这是你想要完成的所有工作,使用NLP工具从文本中提取日期似乎有些过分.您应该考虑其他选项,如简单的Java正则表达式(例如,此处).
如果您正在做一些需要Stanford NLP工具的更多功能的东西,请查看SUTime注释器.他们的演示页面将让您了解它的行为方式.确保选中该选项Read rules from file,您将看到日期被注释.
用法:
SUTime annotations are provided automatically with the StanfordCoreNLP pipeline by including the ner annotator.
Run Code Online (Sandbox Code Playgroud)