Closed sebastianmika closed 6 years ago
Hi @GeniaSh, I add a small fix for parsing expressions like 26/Nov/2016
, and thanks again for reporting. It is included in ctparse >= 0.0.33
.
However, your example will still not parse correctly because of the extra space (i.e. after the 29/
here 29/ Nov/2016
). I do not see a simple fix for that but I will try spend some time on dealing with this kind of typos. Please also note that ctparse
can be used to find the time expression in a longer text like your example 'whatever dat: 29/ Nov/2016'
- but it is not really meant to do so. I would suggest to rather use e.g. a CRF to find only the relevant substring then ask ctparse
to interpret it.
Copied from wrong issue, originally created by @GeniaSh (thanks for reporting!)
Hi, some dates are not read, for example " 29/ Nov/2016" whereas they are common.
Furthermore, the method for calling the datetime object (def dt(self):) should check whether year, month, day are found, now we get an error when the date is not complete.
Please see the example below.
val = ctparse('whatever dat: 29/ Nov/2016',datetime.now()) print(val)
val.resolution.dt