mirror of
https://github.com/facebook/duckling.git
synced 2024-11-28 08:34:46 +03:00
7889f396f3
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/533 In recent versions of Data.Some the name of the constructor, `This` has changed name to `Some`. This has become rather problematic for us to migrate so we're just going to remove the dependency. The meat of this diff is adding the type `Seal` to `Duckling.Types`. That type replaces `Some`. Reviewed By: pepeiborra Differential Revision: D23929459 fbshipit-source-id: 8ff4146ecba4f1119a17899961b2d877547f6e4f
55 lines
1.8 KiB
Haskell
55 lines
1.8 KiB
Haskell
-- 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.KO
|
|
( defaultRules
|
|
, langRules
|
|
, localeRules
|
|
) where
|
|
|
|
import Duckling.Dimensions.Types
|
|
import Duckling.Locale
|
|
import Duckling.Types
|
|
import qualified Duckling.AmountOfMoney.KO.Rules as AmountOfMoney
|
|
import qualified Duckling.Distance.KO.Rules as Distance
|
|
import qualified Duckling.Duration.KO.Rules as Duration
|
|
import qualified Duckling.Numeral.KO.Rules as Numeral
|
|
import qualified Duckling.Ordinal.KO.Rules as Ordinal
|
|
import qualified Duckling.Quantity.KO.Rules as Quantity
|
|
import qualified Duckling.Temperature.KO.Rules as Temperature
|
|
import qualified Duckling.Time.KO.Rules as Time
|
|
import qualified Duckling.TimeGrain.KO.Rules as TimeGrain
|
|
import qualified Duckling.Volume.KO.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) = 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) = Time.rules
|
|
langRules (Seal TimeGrain) = TimeGrain.rules
|
|
langRules (Seal Url) = []
|
|
langRules (Seal Volume) = Volume.rules
|
|
langRules (Seal (CustomDimension dim)) = dimLangRules KO dim
|