Natural Language date and time parser for java

后端 未结 8 1302
[愿得一人]
[愿得一人] 2020-12-01 20:57

I am working on a Natural Language parser which examines a sentence in english and extracts some information like name, date etc.

for example: \"Lets meet next t

8条回答
  •  独厮守ぢ
    2020-12-01 21:33

    For my use case, I had more luck with chrono-java - sadly it looks stale and is not available in any Maven repository (also not via https://jitpack.io/ since the build is broken), so you have to fix and build it for yourself.

    However, checking out the code and fixing a dependency (maven-javadoc-plugin was missing groupId and I updated the version), allowed me to build and run a simple example successfully:

    List results = Chrono.Parse("Datum  Freitag, 08.04. bis einschl. Sonntag 10.04.2016");
        results.forEach(result -> System.out.println(result));
    

    resulted in 2 Dates being extracted:

    ParsedResult: " 08.04" > 04/08/2018 12:00
    ParsedResult: "10.04.2016" > 04/10/2016 12:00
    

提交回复
热议问题