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

Issues Parsing "Second" as an Ordinal Number #151

Ajedi32 opened this Issue Nov 2, 2012 · 2 comments


None yet
2 participants

Ajedi32 commented Nov 2, 2012

I realize this is a bit of a tricky one since second could be mean either a unit of time or an ordinal number, but "second" doesn't seem to be handled correctly by Chronic in this context:

irb(main):007:0> Chronic.parse("October second")
=> 2013-10-01 00:00:00 -0500
irb(main):008:0> Chronic.parse("October first")
=> 2013-10-01 12:00:00 -0500
irb(main):009:0> Chronic.parse("October second")
=> 2013-10-01 00:00:00 -0500                           # It didn't work here
irb(main):010:0> Chronic.parse("October third")
=> 2013-10-03 12:00:00 -0500
irb(main):011:0> Chronic.parse("October the first")
=> 2013-10-01 12:00:00 -0500
irb(main):012:0> Chronic.parse("October the second")
=> 2013-10-01 00:00:00 -0500                           # Messed up here too
irb(main):013:0> Chronic.parse("October the third")
=> 2013-10-03 12:00:00 -0500
irb(main):016:0> Chronic::Numerizer.numerize("second")
=> "second"                                            # Possible root cause?
irb(main):017:0> Chronic::Numerizer.numerize("third")
=> "3rd"

This comment has been minimized.


leejarvis commented Dec 21, 2012

Yes it's the Numerizers fault. I'd like to eventually drop support for the internal Numerizer and use instead. Which was originally extracted from Chronic, but I would like to manage it separately.


This comment has been minimized.


leejarvis commented Jan 18, 2013

I should also note that 'second' isn't returned as '2nd' not because this is a bug but because 'second' in Chronic is obviously also a time unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment