akoumjian / datefinder

Find dates inside text using Python and get back datetime objects
http://datefinder.readthedocs.org/en/latest/
MIT License
635 stars 167 forks source link

[Suggestion] Add probability of correct date when several dates found #111

Open fmaupas opened 5 years ago

fmaupas commented 5 years ago

Hi,

I recently tried this package, and I found it extremely convenient. The only thing I had to add myself was some post processing to add how likely the date is correct.

Indeed, the program returned several dates:

Parsed date: 0430-07-30 00:00:00 Parsed date: 2019-03-13 00:00:00 Parsed date: 2019-07-19 07:45:00 Parsed date: 6287-07-30 00:00:00 Parsed date: 1003-07-30 00:00:00 Parsed date: 2058-07-22 00:00:00

When looking at it, it is clear to me only 3 date are likely to be correct (the other ones having years way to off to be relevant).

Finally, since one has a time, it is more likely to be the correct one (not always true, but somewhat relevant for my use cases).

Is it something you could consider adding ?

Best regards,

Florian