content: -- 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.KM
    ( defaultRules
    , langRules
    , localeRules
    ) where
  
  import Duckling.Dimensions.Types
  import Duckling.Locale
  import Duckling.Types
  import qualified Duckling.Distance.KM.Rules as Distance
  import qualified Duckling.Numeral.KM.Rules as Numeral
  import qualified Duckling.Ordinal.KM.Rules as Ordinal
  import qualified Duckling.Quantity.KM.Rules as Quantity
  import qualified Duckling.Temperature.KM.Rules as Temperature
  import qualified Duckling.Volume.KM.Rules as Volume
  
  defaultRules :: Seal Dimension -> [Rule]
  defaultRules = langRules
  
  localeRules :: Region -> Seal Dimension -> [Rule]
  localeRules region (Seal (CustomDimension dim)) = dimLocaleRules region dim
  localeRules _ _ = []
  
  langRules :: Seal Dimension -> [Rule]
  langRules (Seal AmountOfMoney) = []
  langRules (Seal CreditCardNumber) = []
  langRules (Seal Distance) = Distance.rules
  langRules (Seal Duration) = []
  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) = []
  langRules (Seal Url) = []
  langRules (Seal Volume) = Volume.rules
  langRules (Seal (CustomDimension dim)) = dimLangRules KM dim
  