router: read the hour he said out loud (V-469)
"напомни мне позвонить маме в семь вечера" answered "не получилось разобрать время напоминания", while "в 19:00" set the reminder. Reminders arrive through speech, and speech says the hour in words, so this was the ordinary case failing and the typed one working. SpellOutDigits rewrites a spoken number as digits, but only when a time word stands beside it — "в три часа" becomes "в 3 часа" and "купить три яблока" is left alone. Both parsers see it: dateparser already rewrites "7 вечера" to "7 pm" and never saw a digit to rewrite, and the stub floor now reads the qualifier itself.
This commit is contained in:
@@ -81,6 +81,9 @@ func NewPythonDateParser() *PythonDateParser {
|
||||
// or dateparser is unavailable, falls back to the stub parser. Returns
|
||||
// (time, true, nil) on success; (zero, false, nil) when no date is found.
|
||||
func (p *PythonDateParser) Parse(ctx context.Context, text string, now time.Time) (time.Time, bool, error) {
|
||||
// Speech says the hour in words, and neither this parser nor the stub
|
||||
// reads "в семь вечера" (Vikunja #469). Both see the digits instead.
|
||||
text = SpellOutDigits(text)
|
||||
t, ok, err := p.parseWithPython(ctx, text, now)
|
||||
if err != nil {
|
||||
// python3 missing, dateparser not installed, or process failure —
|
||||
|
||||
Reference in New Issue
Block a user