comtravo / ctparse

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

Time expression hangs ctparse when timeout=0 and max_stack_depth=0 #81

Closed gabrielelanaro closed 4 years ago

gabrielelanaro commented 4 years ago
import ctparse
ctparse.ctparse("15/11 bis don 16/11", timeout=0, max_stack_depth=0) 

the culprit seems to be having a dd/mm followed by a number

gabrielelanaro commented 4 years ago

Nothing super obvious come to mind, but the culprit is the

"don" which matches "donnerstag" and this leads to an explosion of rules

gabrielelanaro commented 4 years ago

Training has been modified to not explore the whole range of possible parses