diff --git a/cmd/mavend/actions_reminder.go b/cmd/mavend/actions_reminder.go index 4f58862..a05050a 100644 --- a/cmd/mavend/actions_reminder.go +++ b/cmd/mavend/actions_reminder.go @@ -19,9 +19,10 @@ func (h *reactiveHandler) actionReminder(ctx context.Context, dec router.Decisio // time wasn't parsed. Run the parser as a fallback. if dec.Stage == 0 && h.timeParser != nil { t, ok, err := h.timeParser.Parse(ctx, dec.Utterance, h.now()) - // Same gate as the extractor (V-577, V-579): a request that named - // no hour gets asked about, never completed from the clock. - if err == nil && ok && router.NamesAnHour(dec.Utterance) { + // Same gate as the extractor (V-577, V-579, V-610): a request whose + // hour was not spoken, or was spoken and not read, gets asked about + // and is never completed from the clock. + if err == nil && ok && router.ResolvedTheHour(dec.Utterance, t) { dec.Slots.Time = t dec.Slots.HasTime = true } diff --git a/internal/router/dateparser.go b/internal/router/dateparser.go index f15d44a..0aa1e3d 100644 --- a/internal/router/dateparser.go +++ b/internal/router/dateparser.go @@ -58,8 +58,15 @@ try: # read at all until V-579: "в 9" set the reminder and "на 9" did not. # "к двум часам" is a third preposition and the dative that goes with it, # and it was read as no time at all until V-609. + # The preposition is normalised as well as the hour (V-610). dateparser + # joins a day word to a clock through "в" and through no other Russian + # preposition, so "завтра к 03:00 pm" loses the clock and resolves to + # tomorrow at the CURRENT minute. "на" was silently losing it the same way. + def _at(m): + prep = 'at' if m.group(1).lower() in ('at', 'by') else 'в' + return '%s %02d:00' % (prep, int(m.group(2))) text = re.sub(r'(?