stsc / DateTime-Format-Natural

Parse informal natural language date/time strings
5 stars 5 forks source link

support "suffix 's' without plural" #7

Open grr opened 4 years ago

grr commented 4 years ago

Please support the improper grammar "1 years ago", etc. It is commonly used in the wild. I see in t/12-parse_failure.t that it is an intentional failure. Can this be changed or made an option?

dertuxmalwieder commented 4 years ago

🤣

stsc commented 4 years ago

I don't think that's correct english thus I'm reluctant to add it as such. But you can, of course, preprocess your input to DateTime::Format::Natural with a regex: s/(?<=\b1\syear)s(?=\b)//g.

grr commented 4 years ago

It's definitely not correct english, but it's not being used by english speakers per se. It usually comes from generated data from programs that don't check that case.

Edit: it's really hard to google for examples since all search engines seem to autocorrect the query even when quoted. A couple of examples: https://explorer.iost.io/txs?p=20 (1 mins ago) https://webcache.googleusercontent.com/search?q=cache:https://www.unitedpets.net/ (1 hours ago)