-
Notifications
You must be signed in to change notification settings - Fork 342
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
Add single-character en time units #366
base: master
Are you sure you want to change the base?
Conversation
Hi there and Merry Christmas! This change looks great, but it could cause false positives. Would you be willing to refactor this into a configuration option so that it's opt-in? |
Hi, Merry Christmas also! I will take a look at that later. And since French already parses 'h', want to do the same there? |
Sounds great! I'd prefer we keep existing library behavior as-is, as to not break dependent applications (so let's not change the french locale). |
The way it works now has not altered the existing behaviour as far as I can find. Test results are also the same as before (1 failed). Before I start adding tests, I would like to know whether this is how you intended it to work? Besides this, I also noticed it doesn't consistently* parse conjunctions, would that require a new Parser? |
Hello sorry for my slow reply. Overall, really good works! I know this is opposite to @benaubin suggestion, but I'm actually thinking we could detect those single character behavior by default. If we used those patterns in relative parsing, e.g. "in 25m" example, I think it almost always mean the time. (@benaubin do you have any significant false positive examples that you have in mind?)
Yes. If we really want to introduce another options, I'm thinking the
Yes. Let fix that separately. |
I don't have a preference for any of the cases (with/without option & on/off by default), as for our use case anything would work. Whether it would be a problem to enable abbreviations by default, I'm not sure. In an edge case, 'In 25m' could mean in 25 meters, like when talking about route planning (which isn't particularly a use case for Chrono). It'll depend on how missing out on 'in 25m' as time versus a misinterpretation of 'in 25m' as distance weighs up to each other. And yeah, I didn't have a good name for it. If the option makes it, then |
The title says it all.