2018-11-27 02:16:43 +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.
|
2018-11-27 02:16:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-# LANGUAGE GADTs #-}
|
|
|
|
|
|
|
|
|
|
|
|
module Duckling.Rules.MN
|
|
|
|
( defaultRules
|
|
|
|
, langRules
|
|
|
|
, localeRules
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Duckling.Dimensions.Types
|
|
|
|
import Duckling.Locale
|
|
|
|
import Duckling.Types
|
|
|
|
import qualified Duckling.AmountOfMoney.MN.Rules as AmountOfMoney
|
|
|
|
import qualified Duckling.Distance.MN.Rules as Distance
|
|
|
|
import qualified Duckling.Duration.MN.Rules as Duration
|
|
|
|
import qualified Duckling.Numeral.MN.Rules as Numeral
|
|
|
|
import qualified Duckling.Ordinal.MN.Rules as Ordinal
|
|
|
|
import qualified Duckling.Quantity.MN.Rules as Quantity
|
|
|
|
import qualified Duckling.TimeGrain.MN.Rules as TimeGrain
|
|
|
|
import qualified Duckling.Volume.MN.Rules as Volume
|
|
|
|
import qualified Duckling.Temperature.MN.Rules as Temperature
|
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
defaultRules :: Seal Dimension -> [Rule]
|
2018-11-27 02:16:43 +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
|
2018-11-27 02:16:43 +03:00
|
|
|
localeRules _ _ = []
|
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
langRules :: Seal Dimension -> [Rule]
|
|
|
|
langRules (Seal AmountOfMoney) = AmountOfMoney.rules
|
|
|
|
langRules (Seal CreditCardNumber) = []
|
|
|
|
langRules (Seal Distance) = Distance.rules
|
|
|
|
langRules (Seal Duration) = Duration.rules
|
|
|
|
langRules (Seal Email) = []
|
|
|
|
langRules (Seal Numeral) = Numeral.rules
|
|
|
|
langRules (Seal Ordinal) = Ordinal.rules
|
|
|
|
langRules (Seal PhoneNumber) = []
|
|
|
|
langRules (Seal Quantity) = Quantity.rules
|
|
|
|
langRules (Seal RegexMatch) = []
|
|
|
|
langRules (Seal Temperature) = Temperature.rules
|
|
|
|
langRules (Seal Time) = []
|
|
|
|
langRules (Seal TimeGrain) = TimeGrain.rules
|
|
|
|
langRules (Seal Url) = []
|
|
|
|
langRules (Seal Volume) = Volume.rules
|
|
|
|
langRules (Seal (CustomDimension dim)) = dimLangRules MN dim
|