mirror of
https://github.com/facebook/duckling.git
synced 2024-12-01 08:19:36 +03:00
a3b35880e5
Summary: Modified `Entity` to use the new `ResolvedVal` data type. Other changes follow naturally. Related issues: https://github.com/facebook/duckling/issues/121 and https://github.com/facebook/duckling/issues/172 Now one can pattern match on the output value, for instance: ``` {-# LANGUAGE GADTs #-} import Data.Text import Duckling.Core import Duckling.Testing.Types import qualified Duckling.PhoneNumber.Types as PN parsePhoneNumber :: Text -> Text parsePhoneNumber input = case value entity of (RVal PhoneNumber (PN.PhoneNumberValue v)) -> v where (entity:_) = parse input testContext testOptions [This PhoneNumber] ``` Reviewed By: patapizza Differential Revision: D7502020 fbshipit-source-id: 76ba7b315cfd0d2c61ff95c855b7c95efc0a401c |
||
---|---|---|
.. | ||
Tests.hs |