-- 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.NL
  ( defaultRules
  , langRules
  , localeRules
  ) where

import Prelude

import Duckling.Dimensions.Types
import Duckling.Locale
import Duckling.Types
import qualified Duckling.AmountOfMoney.NL.Rules as AmountOfMoney
import qualified Duckling.Distance.NL.Rules as Distance
import qualified Duckling.Duration.NL.Rules as Duration
import qualified Duckling.Numeral.NL.Rules as Numeral
import qualified Duckling.Ordinal.NL.Rules as Ordinal
import qualified Duckling.Quantity.NL.Rules as Quantity
import qualified Duckling.Time.NL.Rules as Time
import qualified Duckling.Time.NL.BE.Rules as TimeBE
import qualified Duckling.Time.NL.NL.Rules as TimeNL
import qualified Duckling.TimeGrain.NL.Rules as TimeGrain
import qualified Duckling.Volume.NL.Rules as Volume

defaultRules :: Seal Dimension -> [Rule]
defaultRules :: Seal Dimension -> [Rule]
defaultRules dim :: Seal Dimension
dim@(Seal Dimension a
Time) = [Rule]
TimeNL.rulesBackwardCompatible [Rule] -> [Rule] -> [Rule]
forall a. [a] -> [a] -> [a]
++ Seal Dimension -> [Rule]
langRules Seal Dimension
dim
defaultRules Seal Dimension
dim = Seal Dimension -> [Rule]
langRules Seal Dimension
dim

localeRules :: Region -> Seal Dimension -> [Rule]
localeRules :: Region -> Seal Dimension -> [Rule]
localeRules Region
region (Seal (CustomDimension a
dim)) = Region -> a -> [Rule]
forall a. CustomDimension a => Region -> a -> [Rule]
dimLocaleRules Region
region a
dim
localeRules Region
BE (Seal Dimension a
Time) = [Rule]
TimeBE.rules
localeRules Region
_ Seal Dimension
_ = []

langRules :: Seal Dimension -> [Rule]
langRules :: Seal Dimension -> [Rule]
langRules (Seal Dimension a
AmountOfMoney) = [Rule]
AmountOfMoney.rules
langRules (Seal Dimension a
CreditCardNumber) = []
langRules (Seal Dimension a
Distance) = [Rule]
Distance.rules
langRules (Seal Dimension a
Duration) = [Rule]
Duration.rules
langRules (Seal Dimension a
Email) = []
langRules (Seal Dimension a
Numeral) = [Rule]
Numeral.rules
langRules (Seal Dimension a
Ordinal) = [Rule]
Ordinal.rules
langRules (Seal Dimension a
PhoneNumber) = []
langRules (Seal Dimension a
Quantity) = [Rule]
Quantity.rules
langRules (Seal Dimension a
RegexMatch) = []
langRules (Seal Dimension a
Temperature) = []
langRules (Seal Dimension a
Time) = [Rule]
Time.rules
langRules (Seal Dimension a
TimeGrain) = [Rule]
TimeGrain.rules
langRules (Seal Dimension a
Url) = []
langRules (Seal Dimension a
Volume) = [Rule]
Volume.rules
langRules (Seal (CustomDimension a
dim)) = Lang -> a -> [Rule]
forall a. CustomDimension a => Lang -> a -> [Rule]
dimLangRules Lang
NL a
dim