2020-01-11 02:01:26 +03:00
|
|
|
-- Copyright (c) 2016-present, Facebook, Inc.
|
|
|
|
-- All rights reserved.
|
|
|
|
--
|
|
|
|
-- This source code is licensed under the BSD-style license found in the
|
|
|
|
-- LICENSE file in the root directory of this source tree.
|
|
|
|
|
|
|
|
|
|
|
|
{-# LANGUAGE GADTs #-}
|
|
|
|
|
|
|
|
|
|
|
|
module Duckling.Rules.AF
|
|
|
|
( defaultRules
|
|
|
|
, langRules
|
|
|
|
, localeRules
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Duckling.Dimensions.Types
|
|
|
|
import Duckling.Locale
|
|
|
|
import Duckling.Types
|
|
|
|
import qualified Duckling.Numeral.AF.Rules as Numeral
|
|
|
|
|
2020-09-28 11:31:58 +03:00
|
|
|
defaultRules :: Seal Dimension -> [Rule]
|
2020-01-11 02:01:26 +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
|
2020-01-11 02:01:26 +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) = []
|
|
|
|
langRules (Seal Email) = []
|
|
|
|
langRules (Seal Numeral) = Numeral.rules
|
|
|
|
langRules (Seal Ordinal) = []
|
|
|
|
langRules (Seal PhoneNumber) = []
|
|
|
|
langRules (Seal Quantity) = []
|
|
|
|
langRules (Seal RegexMatch) = []
|
|
|
|
langRules (Seal Temperature) = []
|
|
|
|
langRules (Seal Time) = []
|
|
|
|
langRules (Seal TimeGrain) = []
|
|
|
|
langRules (Seal Url) = []
|
|
|
|
langRules (Seal Volume) = []
|
|
|
|
langRules (Seal (CustomDimension dim)) = dimLangRules AF dim
|