comtravo / ctparse

Parse natural language time expressions in python
https://www.comtravo.com
MIT License
131 stars 24 forks source link

Time expression of the kind am 21.10.2015 früh 06:55 parse incorrectly #79

Closed gabrielelanaro closed 2 years ago

gabrielelanaro commented 5 years ago

top-2 parses are:

2015-10-21 X:X (X/morning), 2015-10-21 06:55 (X/X),

Somehow, the time of day and specific times are conflicting

sebastianmika commented 5 years ago

If I run this, I get

CTParse(2015-10-21 06:55 (X/X), (126, 107, 127, 'ruleHHMM', 'ruleDDMMYYYY', 'rulePOD', 'rulePODTOD', 'ruleDateTOD'), 18.212176626989645)

What did you expect?

gabrielelanaro commented 5 years ago

I would expect (maybe incorrectly? need to check annotations)

2015-10-21 06:55 (X/morning)
sebastianmika commented 5 years ago

There is the rulePODTOD which will merge the two into a time. I guess you would need to adjust the production of that rule to include the POD - currently it tries to guess whether the TOD can reasonably match the POD and then just keeps the TOD

sebastianmika commented 2 years ago

Parses correctly in 0.3.3