-- 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 #-} {-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Time.GA.Rules ( rules ) where import Data.Text (Text) import Prelude import Duckling.Dimensions.Types import Duckling.Duration.Helpers (isGrain) import Duckling.Numeral.Helpers (parseInt) import Duckling.Regex.Types import Duckling.Time.Helpers import Duckling.Types import qualified Duckling.Ordinal.Types as TOrdinal import qualified Duckling.TimeGrain.Types as TG ruleArInn :: Rule ruleArInn = Rule { name = "arú inné" , pattern = [ regex "ar(ú|u) inn(é|e)" ] , prod = \_ -> tt . cycleNth TG.Day $ - 2 } ruleNollaigNaMban :: Rule ruleNollaigNaMban = Rule { name = "Nollaig na mBan" , pattern = [ regex "(l(á|a) |an )?nollaig (bheag|na mban)" ] , prod = \_ -> tt $ monthDay 1 6 } ruleInniu :: Rule ruleInniu = Rule { name = "inniu" , pattern = [ regex "inniu" ] , prod = \_ -> tt today } ruleAnOrdinalCycleINdiaidhTime :: Rule ruleAnOrdinalCycleINdiaidhTime = Rule { name = "an i ndiaidh