duckling/tests/Duckling
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
..
AmountOfMoney fix missing latent corpus in tests 2019-09-10 10:31:51 -07:00
Api Relicense to BSD3 2019-05-22 10:46:39 -07:00
CreditCardNumber Relicense to BSD3 2019-05-22 10:46:39 -07:00
Dimensions Relicense to BSD3 2019-05-22 10:46:39 -07:00
Distance Relicense to BSD3 2019-05-22 10:46:39 -07:00
Duration Relicense to BSD3 2019-05-22 10:46:39 -07:00
Email Relicense to BSD3 2019-05-22 10:46:39 -07:00
Engine Relicense to BSD3 2019-05-22 10:46:39 -07:00
Numeral Adding Locales for ES Numeral 2020-02-25 16:01:45 -08:00
Ordinal Relicense to BSD3 2019-05-22 10:46:39 -07:00
PhoneNumber Relicense to BSD3 2019-05-22 10:46:39 -07:00
Quantity latent entities 2019-09-10 10:46:42 -07:00
Temperature Relicense to BSD3 2019-05-22 10:46:39 -07:00
Testing keep unicode output in tests sane 2019-11-07 10:48:17 -08:00
Time Time/es: Make "n horas" latent". (#478) 2020-05-29 11:09:46 -07:00
Url Relicense to BSD3 2019-05-22 10:46:39 -07:00
Volume Relicense to BSD3 2019-05-22 10:46:39 -07:00
Tests.hs Relicense to BSD3 2019-05-22 10:46:39 -07:00