Today
Interpreter["ComputedDate"] /@ {"next Monday", "next Tuesday", "next Wednesday"}
What explains this behavior? Can it be controlled?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityToday
Interpreter["ComputedDate"] /@ {"next Monday", "next Tuesday", "next Wednesday"}
What explains this behavior? Can it be controlled?
As @Hans pointed out in a comment, this isn't as straightforward to interpret as it may seem. Take a look at this question from english.stackexchange: "Which day does “next Tuesday” refer to?". The English language is a complex beast!
To me, “next Tuesday” means the Tuesday that comes next week. For example, on Monday, October 11 and Wednesday, October 13, “next Tuesday” means October 19. Whereas on Monday, October 18, “next Tuesday” means October 26. “This Tuesday” refers to the Tuesday that comes this week, which on Wednesday would refer to yesterday, and on Monday refers to tomorrow. Similarly, “Last Tuesday” is the Tuesday that came last week.
Without any descriptors, day names by themselves mean the next such day in the future unless used in the past tense. “He will do it on Tuesday” means the next time there is a Tuesday, which on Monday would mean “tomorrow” but on Wednesday would mean the following Tuesday. In the past tense, day names mean the last such day which occurred. “He did it on Tuesday” means the most recent day that was a Tuesday.
This alternative is perhaps a bit easier to interpret, and the results it returns make sense to me. You could also use "current Monday"
etc.
Today
(* Mon 13 Apr 2015 *)
Interpreter["ComputedDate"] /@ {"this Monday", "this Tuesday",
"this Wednesday", "this Thursday", "this Friday", "this Saturday",
"this Sunday"}
However, returning to your example using the word "next", quite why the change occurs between Thursday 23rd and Friday 17th April I don't know.
Interpreter["ComputedDate"] /@ {"next Monday", "next Tuesday",
"next Wednesday", "next Thursday", "next Friday", "next Saturday",
"next Sunday"}
Another thing to try is the following. It seems that the new week is interpreted to start on a Sunday.
Interpreter["ComputedDate"] /@ {"Monday next week",
"Tuesday next week", "Wednesday next week", "Thursday next week",
"Friday next week", "Saturday next week", "Sunday next week"}
Interpreter
documentation says "applied to a string to try to interpret..." What makes you believe its output should always be correct? $\endgroup$ – alancalvitti Nov 2 '14 at 1:23