comtravo / ctparse

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

Combine durations #129

Closed sebastianmika closed 1 year ago

sebastianmika commented 1 year ago

A simple solution to #102: when seeing two Durations next to each other, "add" them using the smaller unit. This only works approximately for months, but should be good enough in "reasonable" cases.

A more complex solution aggregating different units in one object and re-normalizing the result (i.e. make 50 hours into 2 days and 2 hours on the representation level) would be better, but also much more work. Unless there is a good use case, this should be good enough to start with

Puneeth-n commented 1 year ago

LGTM