Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with punctuation marks, "!" #132

Closed
axos88 opened this issue Apr 25, 2016 · 3 comments
Closed

issue with punctuation marks, "!" #132

axos88 opened this issue Apr 25, 2016 · 3 comments

Comments

@axos88
Copy link

axos88 commented Apr 25, 2016

Sometimes ago is not interpreted correctly, and the date is calculated into the future instead of the past.

scala> new PrettyTimeParser().parse("4 hours ago!");
res2: java.util.List[java.util.Date] = [Mon Apr 25 17:44:29 CEST 2016]

scala> new PrettyTimeParser().parse("4 hours ago");
res3: java.util.List[java.util.Date] = [Mon Apr 25 09:44:31 CEST 2016]

scala> new PrettyTimeParser().parse("4 hours ago !");
res4: java.util.List[java.util.Date] = [Mon Apr 25 09:44:34 CEST 2016]

scala> new PrettyTimeParser().parse("4 hours ago.");
res5: java.util.List[java.util.Date] = [Mon Apr 25 09:44:37 CEST 2016]

scala> new PrettyTimeParser().parse("4 hours ago!");
res6: java.util.List[java.util.Date] = [Mon Apr 25 17:44:40 CEST 2016]
@ginccc
Copy link

ginccc commented Jan 1, 2018

i encountered the same problem when trying the example from the website:

List<Date> dates = new PrettyTimeParser().parse("I'm going to the beach in three days!");

it actually parses the date wrong (giving me current day at 3 o'clock instead) when there is another symbol attached to the "days". Without any punctuation it works fine.

@ginccc
Copy link

ginccc commented Jan 1, 2018

The underlying parser library com.joestelmach/natty seems to be outdated since the latest version of natty can parse words connected to punctuation whereas the natty code that comes with prettytime-nlp:4.1.0 doesn't parse this correctly.

@lincolnthree
Copy link
Member

Natty has been updated in Version 5.

Issue cleanup Thanks for filing this issue. We are cleaning old issues from the repository. If the issue is still reproducible, please re-open with a test case to reproduce the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants