facebook / facebook/duckling

Utterance "winter 2020" not parsed correctly.

Abierto
#224 3 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Haskell
Estrellas
4.3k
Forks
740
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Utterance `winter 2020` is broken down into two entities - `winter` and `2020`. For all other seasons, the correct date range is returned (e.g. `summer 2020`, `fall 2021`, etc.).

Having a hard time finding the right rules to edit on this one. Assuming it has something to do with these lines:
```
ruleSeason :: Rule
ruleSeason = Rule
{ name = "last|this|next "
, pattern =
[ regex "(this|current|next|last|past|previous) seasons?"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) -> do
n <- case Text.toLower match of
"this" -> Just 0
"current" -> Just 0
"last" -> Just (-1)
"past" -> Just (-1)
"previous" -> Just (-1)
"next" -> Just 1
_ -> Nothing
tt $ predNth n False season
_ -> Nothing
}

ruleSeasons :: [Rule]
ruleSeasons = mkRuleSeasons
[ ( "summer", "summer" , monthDay 6 21, monthDay 9 23 )
, ( "fall" , "fall|autumn", monthDay 9 23, monthDay 12 21 )
, ( "winter", "winter" , monthDay 12 21, monthDay 3 20 )
, ( "spring", "spring" , monthDay 3 20, monthDay 6 21 )
]
```
`in lines 956-982 of Duckling/Time/En/Rules.hs`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.