2017-12-20 00:05:23 +03:00
|
|
|
--Copyright (c) 2016-present, Facebook, Inc.
|
|
|
|
-- All rights reserved.
|
|
|
|
--
|
|
|
|
-- This source code is licensed under the BSD-style license found in the
|
2019-05-22 20:36:43 +03:00
|
|
|
-- LICENSE file in the root directory of this source tree.
|
2017-12-20 00:05:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-# LANGUAGE GADTs #-}
|
|
|
|
|
|
|
|
module Duckling.Rules.HI
|
|
|
|
( defaultRules
|
|
|
|
, langRules
|
|
|
|
, localeRules
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Duckling.Dimensions.Types
|
|
|
|
import Duckling.Locale
|
|
|
|
import Duckling.Types
|
|
|
|
import qualified Duckling.Numeral.HI.Rules as Numeral
|
2018-02-10 00:15:03 +03:00
|
|
|
import qualified Duckling.Ordinal.HI.Rules as Ordinal
|
2018-05-18 00:34:54 +03:00
|
|
|
import qualified Duckling.Duration.HI.Rules as Duration
|
2018-05-22 22:13:04 +03:00
|
|
|
import qualified Duckling.TimeGrain.HI.Rules as TimeGrain
|
2018-06-14 02:51:23 +03:00
|
|
|
import qualified Duckling.Temperature.HI.Rules as Temperature
|
2017-12-20 00:05:23 +03:00
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
defaultRules :: Seal Dimension -> [Rule]
|
2017-12-20 00:05:23 +03:00
|
|
|
defaultRules = langRules
|
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
localeRules :: Region -> Seal Dimension -> [Rule]
|
|
|
|
localeRules region (Seal (CustomDimension dim)) = dimLocaleRules region dim
|
2017-12-20 00:05:23 +03:00
|
|
|
localeRules _ _ = []
|
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
langRules :: Seal Dimension -> [Rule]
|
|
|
|
langRules (Seal AmountOfMoney) = []
|
|
|
|
langRules (Seal CreditCardNumber) = []
|
|
|
|
langRules (Seal Distance) = []
|
|
|
|
langRules (Seal Duration) = Duration.rules
|
|
|
|
langRules (Seal Numeral) = Numeral.rules
|
|
|
|
langRules (Seal Email) = []
|
|
|
|
langRules (Seal Ordinal) = Ordinal.rules
|
|
|
|
langRules (Seal PhoneNumber) = []
|
|
|
|
langRules (Seal Quantity) = []
|
|
|
|
langRules (Seal RegexMatch) = []
|
|
|
|
langRules (Seal Temperature) = Temperature.rules
|
|
|
|
langRules (Seal Time) = []
|
|
|
|
langRules (Seal TimeGrain) = TimeGrain.rules
|
|
|
|
langRules (Seal Url) = []
|
|
|
|
langRules (Seal Volume) = []
|
|
|
|
langRules (Seal (CustomDimension dim)) = dimLangRules HI dim
|