duckling/tests/Duckling/Time
byuan 1dac46a8ce Time/es: Make "n horas" latent". (#478)
Summary:
1. ~~Fixed broken build due to the problem with main test entry point;~~
2. Fixed the ambiguous results caused by mishandling the
ranking rules for parsing frames in ES. For example "una hora"
be interpreted either as "Duration" or "1pm" in "Time" dimension.
And the expected result should be in "Duration" dimension.
3. ~~ignore stack lock file~~
Pull Request resolved: https://github.com/facebook/duckling/pull/478

Test Plan:
```
:test Endpoint.Duckling.Tests --hide-successes
[1003 of 1003] Endpoint.Duckling.Tests (Duckling.Api changed)
Ok, two modules loaded.

All 357 tests passed (79.69s)
```

```
haxlsh> H.io $ debug (makeLocale ES Nothing) "de una horas" [This Time, This Duration]
<integer> <unit-of-duration> (una horas)
-- number (0..15) (una)
-- -- regex (una)
-- hora (grain) (horas)
-- -- regex (horas)
[Entity {dim = "duration", body = "una horas", value = RVal Duration (DurationData {value = 1, grain = Hour}), start = 3, end = 12, latent = False, enode = Node {nodeRange = Range 3 12, token = Token Duration (DurationData {value = 1, grain = Hour}), children = [Node {nodeRange = Range 3 6, token = Token Numeral (NumeralData {value = 1.0, grain = Nothing, multipliable = False, okForAnyTime = True}), children = [Node {nodeRange = Range 3 6, token = Token RegexMatch (GroupMatch ["una","","a","","",""]), children = [], rule = Nothing}], rule = Just "number (0..15)"},Node {nodeRange = Range 7 12, token = Token TimeGrain Hour, children = [Node {nodeRange = Range 7 12, token = Token RegexMatch (GroupMatch ["ora"]), children = [], rule = Nothing}], rule = Just "hora (grain)"}], rule = Just "<integer> <unit-of-duration>"}}]
it :: [Entity]
```

Reviewed By: fascpt

Differential Revision: D21770015

Pulled By: chinmay87

fbshipit-source-id: 3056fcf656140c9d65b70b5c604a286ea2c307b2
2020-05-29 11:09:46 -07:00
..
AR Relicense to BSD3 2019-05-22 10:46:39 -07:00
BG Add Time dimension for language BG 2020-01-10 14:34:22 -08:00
DA Relicense to BSD3 2019-05-22 10:46:39 -07:00
DE Relicense to BSD3 2019-05-22 10:46:39 -07:00
EL Relicense to BSD3 2019-05-22 10:46:39 -07:00
EN Add "<part-of-day> at "<time-of-day>" rule. 2019-10-25 17:04:55 -07:00
ES Time/es: Make "n horas" latent". (#478) 2020-05-29 11:09:46 -07:00
FR Relicense to BSD3 2019-05-22 10:46:39 -07:00
GA Relicense to BSD3 2019-05-22 10:46:39 -07:00
HE Relicense to BSD3 2019-05-22 10:46:39 -07:00
HR Relicense to BSD3 2019-05-22 10:46:39 -07:00
HU Relicense to BSD3 2019-05-22 10:46:39 -07:00
IT Relicense to BSD3 2019-05-22 10:46:39 -07:00
KA Relicense to BSD3 2019-05-22 10:46:39 -07:00
KO Relicense to BSD3 2019-05-22 10:46:39 -07:00
NB Relicense to BSD3 2019-05-22 10:46:39 -07:00
NL Relicense to BSD3 2019-05-22 10:46:39 -07:00
PL Relicense to BSD3 2019-05-22 10:46:39 -07:00
PT Relicense to BSD3 2019-05-22 10:46:39 -07:00
RO Relicense to BSD3 2019-05-22 10:46:39 -07:00
SV Relicense to BSD3 2019-05-22 10:46:39 -07:00
UK Relicense to BSD3 2019-05-22 10:46:39 -07:00
VI Relicense to BSD3 2019-05-22 10:46:39 -07:00
ZH Relicense to BSD3 2019-05-22 10:46:39 -07:00
Tests.hs Add Time dimension for language BG 2020-01-10 14:34:22 -08:00