LexPredict / lexpredict-lexnlp

LexNLP by LexPredict
GNU Affero General Public License v3.0
690 stars 175 forks source link

list(lexnlp.extract.en.dates.get_dates("11/8/2020")) is giving [datetime.date(2020, 11, 8)] ,that means 8 november,but actual date is 11 august #45

Open Paulamidas opened 4 years ago

Paulamidas commented 4 years ago

please solve. list(lexnlp.extract.en.dates.get_dates("11/8/2020")) is giving [datetime.date(2020, 11, 8)] ,that means 8 november,but actual date is 11 august

afparsons commented 4 years ago

Thank you for filing this issue.

Currently, LexNLP's English language date extraction module uses an en-US-style locale configuration. This means that dates delimited by forward-slashes are understood to be written in middle-endian format, i.e. MM/DD/YYYY.

The German and Spanish language parsers default to little-endian date formatting, i.e. DD/MM/YYYY. These are respectively available under lexnlp.extract.de.dates and lexnlp.extract.es.dates.