Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"this week" is not parsed #105

Closed
philiptzou opened this issue Jul 5, 2015 · 3 comments
Closed

"this week" is not parsed #105

philiptzou opened this issue Jul 5, 2015 · 3 comments

Comments

@philiptzou
Copy link
Collaborator

Just for record, "this week" now is not parsed by pdt properly:

(pdt)philip@philip-debian:~/gitrepo/parsedatetime$ ./run.py
2015-07-05 08:05:44,419 DEBUG: parse()
2015-07-05 08:05:44,422 DEBUG: parse (top of loop): [this week][]
2015-07-05 08:05:44,424 DEBUG: parse (modifier) [][][]
2015-07-05 08:05:44,429 DEBUG: parse (units) [][][]
2015-07-05 08:05:44,432 DEBUG: parse (qunits) [][][]
2015-07-05 08:05:44,436 DEBUG: parse (date3) [][][]
2015-07-05 08:05:44,438 DEBUG: parse (date) [][][]
2015-07-05 08:05:44,440 DEBUG: parse (day) [][][]
2015-07-05 08:05:44,442 DEBUG: parse (weekday) [][][]
2015-07-05 08:05:44,445 DEBUG: parse (time) [][][]
2015-07-05 08:05:44,448 DEBUG: parse (meridian) [][][]
2015-07-05 08:05:44,451 DEBUG: parse (hms) [][][]
2015-07-05 08:05:44,453 DEBUG: dateFlag 0, timeFlag 0
2015-07-05 08:05:44,455 DEBUG: parse (bottom) [][][][]
2015-07-05 08:05:44,457 DEBUG: weekday False, dateStd False, dateStr False, time False, timeStr False, meridian False
2015-07-05 08:05:44,460 DEBUG: dayStr False, modifier False, units False, qunits False
2015-07-05 08:05:44,461 DEBUG: not parsed [None]
2015-07-05 08:05:44,462 DEBUG: parse() return dateFlag 0 timeFlag 0 totalTime time.struct_time(tm_year=2015, tm_mon=7, tm_mday=5, tm_hour=8, tm_min=5, tm_sec=44, tm_wday=6, tm_yday=186, tm_isdst=1)
(time.struct_time(tm_year=2015, tm_mon=7, tm_mday=5, tm_hour=8, tm_min=5, tm_sec=44, tm_wday=6, tm_yday=186, tm_isdst=1), 0)
@bear
Copy link
Owner

bear commented Jul 5, 2015

yea, we will need to flag "this" in a similar manner as we do "next" and "last" so that phrase words are parsed according to the current week

@philiptzou
Copy link
Collaborator Author

Fixed by 781a2a3.

(pdt)philip@philip-debian:~/gitrepo/parsedatetime$ ./run.py
2015-07-30 09:29:05,256 DEBUG: parse()
2015-07-30 09:29:05,258 DEBUG: remainedString (before parsing): [this week]
2015-07-30 09:29:05,260 DEBUG: found (modifier) [this][][week]
2015-07-30 09:29:05,262 DEBUG: modifier [this] chunk1 [] chunk2 [] unit [week]
2015-07-30 09:29:05,263 DEBUG: returning chunk = " " and sourceTime = time.struct_time(tm_year=2015, tm_mon=7, tm_mday=31, tm_hour=17, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=212, tm_isdst=-1)
2015-07-30 09:29:05,266 DEBUG: hasDate: [True], hasTime: [False]
2015-07-30 09:29:05,267 DEBUG: remainedString: []
(time.struct_time(tm_year=2015, tm_mon=7, tm_mday=31, tm_hour=17, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=212, tm_isdst=-1), 1)

@bear
Copy link
Owner

bear commented Jul 30, 2015

If @philiptzou was a football player I would say he just scored a hat trick today!

nicely done!

(and yes, football as in soccer for the US centric folks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants