duckling 0.1.3.0 → 0.1.4.0
raw patch · 349 files changed
+35767/−14460 lines, 349 filesdep ~aesondep ~extradep ~haskell-src-extsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, extra, haskell-src-exts
API changes (from Hackage documentation)
- Duckling.Core: data Some k (tag :: k -> *) :: forall k. (k -> *) -> *
- Duckling.Dimensions.Types: data Some k (tag :: k -> *) :: forall k. (k -> *) -> *
- Duckling.Distance.Helpers: unitDistance :: Unit -> PatternItem
- Duckling.Distance.Types: DistanceValue :: Unit -> Double -> DistanceValue
- Duckling.Duration.Helpers: isNumeralWith :: (NumeralData -> t) -> (t -> Bool) -> PatternItem
- Duckling.Numeral.Types: isNatural :: Double -> Bool
- Duckling.Quantity.Types: [product] :: QuantityData -> Maybe Text
- Duckling.Quantity.Types: instance Data.Aeson.Types.ToJSON.ToJSON Duckling.Quantity.Types.QuantityData
- Duckling.Time.Helpers: isNumeralSafeToUse :: Predicate
+ Duckling.AmountOfMoney.AR.Corpus: corpus :: Corpus
+ Duckling.AmountOfMoney.AR.Rules: rules :: [Rule]
+ Duckling.AmountOfMoney.EN.Corpus: negativeCorpus :: NegativeCorpus
+ Duckling.AmountOfMoney.Helpers: isCents :: Predicate
+ Duckling.AmountOfMoney.Helpers: isMoneyWithValue :: Predicate
+ Duckling.AmountOfMoney.Helpers: isWithoutCents :: Predicate
+ Duckling.AmountOfMoney.RU.Corpus: corpus :: Corpus
+ Duckling.AmountOfMoney.RU.Rules: rules :: [Rule]
+ Duckling.AmountOfMoney.Types: BYN :: Currency
+ Duckling.AmountOfMoney.Types: Dinar :: Currency
+ Duckling.AmountOfMoney.Types: Dirham :: Currency
+ Duckling.AmountOfMoney.Types: ILS :: Currency
+ Duckling.AmountOfMoney.Types: IQD :: Currency
+ Duckling.AmountOfMoney.Types: JOD :: Currency
+ Duckling.AmountOfMoney.Types: MAD :: Currency
+ Duckling.AmountOfMoney.Types: RUB :: Currency
+ Duckling.AmountOfMoney.Types: Rial :: Currency
+ Duckling.AmountOfMoney.Types: Riyal :: Currency
+ Duckling.Core: AU :: Region
+ Duckling.Core: BZ :: Region
+ Duckling.Core: EL :: Lang
+ Duckling.Core: HI :: Lang
+ Duckling.Core: IE :: Region
+ Duckling.Core: IN :: Region
+ Duckling.Core: JM :: Region
+ Duckling.Core: NE :: Lang
+ Duckling.Core: NZ :: Region
+ Duckling.Core: Node :: Range -> Token -> [Node] -> Maybe Text -> Node
+ Duckling.Core: PH :: Region
+ Duckling.Core: Range :: Int -> Int -> Range
+ Duckling.Core: TT :: Region
+ Duckling.Core: ZA :: Region
+ Duckling.Core: [children] :: Node -> [Node]
+ Duckling.Core: [enode] :: Entity -> Node
+ Duckling.Core: [nodeRange] :: Node -> Range
+ Duckling.Core: [rule] :: Node -> Maybe Text
+ Duckling.Core: [token] :: Node -> Token
+ Duckling.Core: data Some k (tag :: k -> *) :: forall k. () => (k -> *) -> *
+ Duckling.Core: data Node
+ Duckling.Core: data Range
+ Duckling.Dimensions.EL: allDimensions :: [Some Dimension]
+ Duckling.Dimensions.HI: allDimensions :: [Some Dimension]
+ Duckling.Dimensions.NE: allDimensions :: [Some Dimension]
+ Duckling.Dimensions.Types: data Some k (tag :: k -> *) :: forall k. () => (k -> *) -> *
+ Duckling.Distance.Helpers: isDistanceOfUnit :: Unit -> Predicate
+ Duckling.Distance.Helpers: isSimpleDistance :: Predicate
+ Duckling.Distance.Helpers: unitOnly :: Unit -> DistanceData
+ Duckling.Distance.Helpers: withInterval :: (Double, Double) -> DistanceData -> DistanceData
+ Duckling.Distance.Helpers: withMax :: Double -> DistanceData -> DistanceData
+ Duckling.Distance.Helpers: withMin :: Double -> DistanceData -> DistanceData
+ Duckling.Distance.Helpers: withValue :: Double -> DistanceData -> DistanceData
+ Duckling.Distance.RU.Corpus: corpus :: Corpus
+ Duckling.Distance.RU.Rules: rules :: [Rule]
+ Duckling.Distance.Types: Above :: IntervalDirection
+ Duckling.Distance.Types: IntervalValue :: (SingleValue, SingleValue) -> DistanceValue
+ Duckling.Distance.Types: Millimetre :: Unit
+ Duckling.Distance.Types: OpenIntervalValue :: (SingleValue, IntervalDirection) -> DistanceValue
+ Duckling.Distance.Types: SimpleValue :: SingleValue -> DistanceValue
+ Duckling.Distance.Types: SingleValue :: Unit -> Double -> SingleValue
+ Duckling.Distance.Types: Under :: IntervalDirection
+ Duckling.Distance.Types: [maxValue] :: DistanceData -> Maybe Double
+ Duckling.Distance.Types: [minValue] :: DistanceData -> Maybe Double
+ Duckling.Distance.Types: above :: Unit -> Double -> DistanceValue
+ Duckling.Distance.Types: between :: Unit -> (Double, Double) -> DistanceValue
+ Duckling.Distance.Types: data IntervalDirection
+ Duckling.Distance.Types: data SingleValue
+ Duckling.Distance.Types: instance Control.DeepSeq.NFData Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance Data.Aeson.Types.ToJSON.ToJSON Duckling.Distance.Types.SingleValue
+ Duckling.Distance.Types: instance Data.Hashable.Class.Hashable Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance GHC.Classes.Eq Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance GHC.Classes.Eq Duckling.Distance.Types.SingleValue
+ Duckling.Distance.Types: instance GHC.Classes.Ord Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance GHC.Classes.Ord Duckling.Distance.Types.SingleValue
+ Duckling.Distance.Types: instance GHC.Generics.Generic Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance GHC.Show.Show Duckling.Distance.Types.IntervalDirection
+ Duckling.Distance.Types: instance GHC.Show.Show Duckling.Distance.Types.SingleValue
+ Duckling.Distance.Types: openInterval :: IntervalDirection -> Unit -> Double -> DistanceValue
+ Duckling.Distance.Types: simple :: Unit -> Double -> DistanceValue
+ Duckling.Distance.Types: single :: Unit -> Double -> SingleValue
+ Duckling.Distance.Types: under :: Unit -> Double -> DistanceValue
+ Duckling.Duration.AR.Corpus: corpus :: Corpus
+ Duckling.Duration.AR.Rules: rules :: [Rule]
+ Duckling.Duration.EL.Corpus: corpus :: Corpus
+ Duckling.Duration.EL.Corpus: negativeCorpus :: NegativeCorpus
+ Duckling.Duration.EL.Rules: rules :: [Rule]
+ Duckling.Duration.Helpers: timesOneAndAHalf :: Grain -> Int -> Maybe DurationData
+ Duckling.Duration.RU.Corpus: corpus :: Corpus
+ Duckling.Duration.RU.Rules: rules :: [Rule]
+ Duckling.Locale: AU :: Region
+ Duckling.Locale: BZ :: Region
+ Duckling.Locale: EL :: Lang
+ Duckling.Locale: HI :: Lang
+ Duckling.Locale: IE :: Region
+ Duckling.Locale: IN :: Region
+ Duckling.Locale: JM :: Region
+ Duckling.Locale: NE :: Lang
+ Duckling.Locale: NZ :: Region
+ Duckling.Locale: PH :: Region
+ Duckling.Locale: TT :: Region
+ Duckling.Locale: ZA :: Region
+ Duckling.Numeral.EL.Corpus: corpus :: Corpus
+ Duckling.Numeral.EL.Rules: rules :: [Rule]
+ Duckling.Numeral.HI.Corpus: corpus :: Corpus
+ Duckling.Numeral.HI.Rules: rules :: [Rule]
+ Duckling.Numeral.Helpers: isMultipliable :: Predicate
+ Duckling.Numeral.Helpers: isNatural :: Predicate
+ Duckling.Numeral.Helpers: isPositive :: Predicate
+ Duckling.Numeral.Helpers: numeralMapEL :: HashMap Text Int
+ Duckling.Numeral.NE.Corpus: corpus :: Corpus
+ Duckling.Numeral.NE.Rules: rules :: [Rule]
+ Duckling.Numeral.Rules: rules :: [Rule]
+ Duckling.Ordinal.EL.Corpus: corpus :: Corpus
+ Duckling.Ordinal.EL.Rules: rules :: [Rule]
+ Duckling.Ordinal.HI.Corpus: corpus :: Corpus
+ Duckling.Ordinal.HI.Rules: rules :: [Rule]
+ Duckling.Ordinal.Helpers: oneOf :: [Int] -> PatternItem
+ Duckling.Quantity.AR.Corpus: corpus :: Corpus
+ Duckling.Quantity.AR.Rules: rules :: [Rule]
+ Duckling.Quantity.Helpers: isSimpleQuantity :: Predicate
+ Duckling.Quantity.Helpers: unitOnly :: Unit -> QuantityData
+ Duckling.Quantity.Helpers: withInterval :: (Double, Double) -> QuantityData -> QuantityData
+ Duckling.Quantity.Helpers: withMax :: Double -> QuantityData -> QuantityData
+ Duckling.Quantity.Helpers: withMin :: Double -> QuantityData -> QuantityData
+ Duckling.Quantity.Helpers: withUnit :: Unit -> QuantityData -> QuantityData
+ Duckling.Quantity.Helpers: withValue :: Double -> QuantityData -> QuantityData
+ Duckling.Quantity.RU.Corpus: corpus :: Corpus
+ Duckling.Quantity.RU.Rules: rules :: [Rule]
+ Duckling.Quantity.Types: Above :: IntervalDirection
+ Duckling.Quantity.Types: IntervalValue :: (SingleValue, SingleValue) -> QuantityValue
+ Duckling.Quantity.Types: OpenIntervalValue :: (SingleValue, IntervalDirection) -> QuantityValue
+ Duckling.Quantity.Types: SimpleValue :: SingleValue -> QuantityValue
+ Duckling.Quantity.Types: SingleValue :: Unit -> Double -> Maybe Text -> SingleValue
+ Duckling.Quantity.Types: Under :: IntervalDirection
+ Duckling.Quantity.Types: [aproduct] :: QuantityData -> Maybe Text
+ Duckling.Quantity.Types: [maxValue] :: QuantityData -> Maybe Double
+ Duckling.Quantity.Types: [minValue] :: QuantityData -> Maybe Double
+ Duckling.Quantity.Types: [vProduct] :: SingleValue -> Maybe Text
+ Duckling.Quantity.Types: [vUnit] :: SingleValue -> Unit
+ Duckling.Quantity.Types: [vValue] :: SingleValue -> Double
+ Duckling.Quantity.Types: above :: Unit -> Double -> Maybe Text -> QuantityValue
+ Duckling.Quantity.Types: between :: Unit -> (Double, Double) -> Maybe Text -> QuantityValue
+ Duckling.Quantity.Types: data IntervalDirection
+ Duckling.Quantity.Types: data QuantityValue
+ Duckling.Quantity.Types: data SingleValue
+ Duckling.Quantity.Types: instance Control.DeepSeq.NFData Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance Control.DeepSeq.NFData Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance Data.Aeson.Types.ToJSON.ToJSON Duckling.Quantity.Types.QuantityValue
+ Duckling.Quantity.Types: instance Data.Aeson.Types.ToJSON.ToJSON Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance Data.Hashable.Class.Hashable Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance Data.Hashable.Class.Hashable Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance GHC.Classes.Eq Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance GHC.Classes.Eq Duckling.Quantity.Types.QuantityValue
+ Duckling.Quantity.Types: instance GHC.Classes.Eq Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance GHC.Classes.Ord Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance GHC.Classes.Ord Duckling.Quantity.Types.QuantityValue
+ Duckling.Quantity.Types: instance GHC.Classes.Ord Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance GHC.Generics.Generic Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance GHC.Generics.Generic Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: instance GHC.Show.Show Duckling.Quantity.Types.IntervalDirection
+ Duckling.Quantity.Types: instance GHC.Show.Show Duckling.Quantity.Types.QuantityValue
+ Duckling.Quantity.Types: instance GHC.Show.Show Duckling.Quantity.Types.SingleValue
+ Duckling.Quantity.Types: openInterval :: IntervalDirection -> Unit -> Double -> Maybe Text -> QuantityValue
+ Duckling.Quantity.Types: simple :: Unit -> Double -> Maybe Text -> QuantityValue
+ Duckling.Quantity.Types: single :: Unit -> Double -> Maybe Text -> SingleValue
+ Duckling.Quantity.Types: under :: Unit -> Double -> Maybe Text -> QuantityValue
+ Duckling.Ranking.Classifiers.EL_XX: classifiers :: Classifiers
+ Duckling.Ranking.Classifiers.HI_XX: classifiers :: Classifiers
+ Duckling.Ranking.Classifiers.NE_XX: classifiers :: Classifiers
+ Duckling.Rules.EL: defaultRules :: Some Dimension -> [Rule]
+ Duckling.Rules.EL: langRules :: Some Dimension -> [Rule]
+ Duckling.Rules.EL: localeRules :: Region -> Some Dimension -> [Rule]
+ Duckling.Rules.HI: defaultRules :: Some Dimension -> [Rule]
+ Duckling.Rules.HI: langRules :: Some Dimension -> [Rule]
+ Duckling.Rules.HI: localeRules :: Region -> Some Dimension -> [Rule]
+ Duckling.Rules.NE: defaultRules :: Some Dimension -> [Rule]
+ Duckling.Rules.NE: langRules :: Some Dimension -> [Rule]
+ Duckling.Rules.NE: localeRules :: Region -> Some Dimension -> [Rule]
+ Duckling.Temperature.AR.Corpus: corpus :: Corpus
+ Duckling.Temperature.AR.Rules: rules :: [Rule]
+ Duckling.Time.AR.Corpus: corpus :: Corpus
+ Duckling.Time.AR.Corpus: negativeCorpus :: NegativeCorpus
+ Duckling.Time.AR.Rules: rules :: [Rule]
+ Duckling.Time.EL.Corpus: corpus :: Corpus
+ Duckling.Time.EL.Corpus: negativeCorpus :: NegativeCorpus
+ Duckling.Time.EL.Rules: rules :: [Rule]
+ Duckling.Time.EN.AU.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.AU.Rules: rules :: [Rule]
+ Duckling.Time.EN.BZ.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.BZ.Rules: rules :: [Rule]
+ Duckling.Time.EN.IE.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.IE.Rules: rules :: [Rule]
+ Duckling.Time.EN.IN.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.IN.Rules: rules :: [Rule]
+ Duckling.Time.EN.JM.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.JM.Rules: rules :: [Rule]
+ Duckling.Time.EN.NZ.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.NZ.Rules: rules :: [Rule]
+ Duckling.Time.EN.PH.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.PH.Rules: rules :: [Rule]
+ Duckling.Time.EN.TT.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.TT.Rules: rules :: [Rule]
+ Duckling.Time.EN.US.Rules: ruleMMDDYYYYDot :: Rule
+ Duckling.Time.EN.ZA.Corpus: allExamples :: [Example]
+ Duckling.Time.EN.ZA.Rules: rules :: [Rule]
+ Duckling.Time.Helpers: isOkWithThisNext :: Predicate
+ Duckling.Time.Helpers: mkOkForThisNext :: TimeData -> TimeData
+ Duckling.Time.Helpers: mkRuleDaysOfWeek :: [(Text, String)] -> [Rule]
+ Duckling.Time.Helpers: mkRuleHolidays :: [(Text, String, TimeData)] -> [Rule]
+ Duckling.Time.Helpers: mkRuleInstants :: [(Text, Grain, Int, String)] -> [Rule]
+ Duckling.Time.Helpers: mkRuleMonths :: [(Text, String)] -> [Rule]
+ Duckling.Time.Helpers: mkRuleSeasons :: [(Text, String, TimeData, TimeData)] -> [Rule]
+ Duckling.Time.NL.Corpus: corpus :: Corpus
+ Duckling.Time.NL.Corpus: negativeCorpus :: NegativeCorpus
+ Duckling.Time.NL.Rules: rules :: [Rule]
+ Duckling.Time.Types: [okForThisNext] :: TimeData -> Bool
+ Duckling.TimeGrain.AR.Rules: rules :: [Rule]
+ Duckling.TimeGrain.EL.Rules: rules :: [Rule]
+ Duckling.TimeGrain.RU.Rules: rules :: [Rule]
+ Duckling.Types: [enode] :: Entity -> Node
+ Duckling.Volume.AR.Corpus: corpus :: Corpus
+ Duckling.Volume.AR.Rules: rules :: [Rule]
+ Duckling.Volume.RU.Corpus: corpus :: Corpus
+ Duckling.Volume.RU.Rules: rules :: [Rule]
- Duckling.Core: Entity :: Text -> Text -> Value -> Int -> Int -> Entity
+ Duckling.Core: Entity :: Text -> Text -> Value -> Int -> Int -> Node -> Entity
- Duckling.Debug: ptree :: Text -> ResolvedToken -> IO ()
+ Duckling.Debug: ptree :: Text -> Entity -> IO ()
- Duckling.Distance.Types: DistanceData :: Maybe Unit -> Double -> DistanceData
+ Duckling.Distance.Types: DistanceData :: Maybe Unit -> Maybe Double -> Maybe Double -> Maybe Double -> DistanceData
- Duckling.Distance.Types: [vUnit] :: DistanceValue -> Unit
+ Duckling.Distance.Types: [vUnit] :: SingleValue -> Unit
- Duckling.Distance.Types: [vValue] :: DistanceValue -> Double
+ Duckling.Distance.Types: [vValue] :: SingleValue -> Double
- Duckling.Distance.Types: [value] :: DistanceData -> Double
+ Duckling.Distance.Types: [value] :: DistanceData -> Maybe Double
- Duckling.Quantity.Types: QuantityData :: Unit -> Double -> Maybe Text -> QuantityData
+ Duckling.Quantity.Types: QuantityData :: Maybe Unit -> Maybe Double -> Maybe Text -> Maybe Double -> Maybe Double -> QuantityData
- Duckling.Quantity.Types: [unit] :: QuantityData -> Unit
+ Duckling.Quantity.Types: [unit] :: QuantityData -> Maybe Unit
- Duckling.Quantity.Types: [value] :: QuantityData -> Double
+ Duckling.Quantity.Types: [value] :: QuantityData -> Maybe Double
- Duckling.Resolve: class ToJSON (ResolvedValue a) => Resolve a where type ResolvedValue a where {
+ Duckling.Resolve: class ToJSON (ResolvedValue a) => Resolve a where {
- Duckling.Time.Helpers: timeOfDayAMPM :: TimeData -> Bool -> TimeData
+ Duckling.Time.Helpers: timeOfDayAMPM :: Bool -> TimeData -> TimeData
- Duckling.Time.Types: TimeData :: Predicate -> Bool -> Grain -> Bool -> Maybe Form -> Maybe IntervalDirection -> TimeData
+ Duckling.Time.Types: TimeData :: Predicate -> Bool -> Grain -> Bool -> Maybe Form -> Maybe IntervalDirection -> Bool -> TimeData
- Duckling.TimeGrain.Types: inSeconds :: Grain -> Int -> Int
+ Duckling.TimeGrain.Types: inSeconds :: Num a => Grain -> a -> a
- Duckling.Types: Entity :: Text -> Text -> Value -> Int -> Int -> Entity
+ Duckling.Types: Entity :: Text -> Text -> Value -> Int -> Int -> Node -> Entity
Files
- Duckling/AmountOfMoney/AR/Corpus.hs +126/−0
- Duckling/AmountOfMoney/AR/Rules.hs +402/−0
- Duckling/AmountOfMoney/BG/Rules.hs +38/−31
- Duckling/AmountOfMoney/EN/Corpus.hs +27/−0
- Duckling/AmountOfMoney/EN/Rules.hs +48/−38
- Duckling/AmountOfMoney/ES/Rules.hs +18/−16
- Duckling/AmountOfMoney/FR/Corpus.hs +27/−0
- Duckling/AmountOfMoney/FR/Rules.hs +140/−17
- Duckling/AmountOfMoney/GA/Rules.hs +20/−18
- Duckling/AmountOfMoney/HR/Rules.hs +15/−13
- Duckling/AmountOfMoney/Helpers.hs +22/−2
- Duckling/AmountOfMoney/ID/Rules.hs +9/−7
- Duckling/AmountOfMoney/KO/Rules.hs +10/−9
- Duckling/AmountOfMoney/NB/Rules.hs +22/−20
- Duckling/AmountOfMoney/PT/Rules.hs +18/−16
- Duckling/AmountOfMoney/RO/Rules.hs +20/−18
- Duckling/AmountOfMoney/RU/Corpus.hs +168/−0
- Duckling/AmountOfMoney/RU/Rules.hs +305/−0
- Duckling/AmountOfMoney/Rules.hs +23/−7
- Duckling/AmountOfMoney/SV/Rules.hs +20/−18
- Duckling/AmountOfMoney/Types.hs +28/−4
- Duckling/AmountOfMoney/VI/Rules.hs +18/−16
- Duckling/Api.hs +5/−3
- Duckling/Core.hs +2/−0
- Duckling/Debug.hs +7/−7
- Duckling/Dimensions.hs +6/−0
- Duckling/Dimensions/AR.hs +6/−1
- Duckling/Dimensions/Common.hs +3/−2
- Duckling/Dimensions/EL.hs +21/−0
- Duckling/Dimensions/HI.hs +19/−0
- Duckling/Dimensions/JA.hs +0/−1
- Duckling/Dimensions/NE.hs +18/−0
- Duckling/Dimensions/NL.hs +1/−0
- Duckling/Dimensions/RU.hs +5/−1
- Duckling/Dimensions/Types.hs +1/−1
- Duckling/Distance/CS/Corpus.hs +8/−8
- Duckling/Distance/EN/Corpus.hs +26/−5
- Duckling/Distance/EN/Rules.hs +143/−21
- Duckling/Distance/ES/Corpus.hs +5/−5
- Duckling/Distance/FR/Corpus.hs +5/−5
- Duckling/Distance/GA/Corpus.hs +5/−5
- Duckling/Distance/HR/Corpus.hs +5/−5
- Duckling/Distance/Helpers.hs +40/−10
- Duckling/Distance/KO/Corpus.hs +5/−5
- Duckling/Distance/NL/Corpus.hs +5/−5
- Duckling/Distance/PT/Corpus.hs +5/−5
- Duckling/Distance/RO/Corpus.hs +5/−5
- Duckling/Distance/RU/Corpus.hs +66/−0
- Duckling/Distance/RU/Rules.hs +50/−0
- Duckling/Distance/TR/Corpus.hs +5/−5
- Duckling/Distance/Types.hs +71/−11
- Duckling/Duration/AR/Corpus.hs +61/−0
- Duckling/Duration/AR/Rules.hs +176/−0
- Duckling/Duration/DA/Rules.hs +2/−2
- Duckling/Duration/DE/Rules.hs +2/−2
- Duckling/Duration/EL/Corpus.hs +143/−0
- Duckling/Duration/EL/Rules.hs +223/−0
- Duckling/Duration/EN/Rules.hs +24/−13
- Duckling/Duration/FR/Rules.hs +1/−1
- Duckling/Duration/GA/Corpus.hs +4/−1
- Duckling/Duration/GA/Rules.hs +7/−6
- Duckling/Duration/HE/Rules.hs +1/−1
- Duckling/Duration/HR/Rules.hs +2/−2
- Duckling/Duration/HU/Rules.hs +1/−1
- Duckling/Duration/Helpers.hs +12/−15
- Duckling/Duration/KO/Rules.hs +1/−1
- Duckling/Duration/NB/Rules.hs +2/−2
- Duckling/Duration/NL/Corpus.hs +17/−5
- Duckling/Duration/NL/Rules.hs +17/−3
- Duckling/Duration/PL/Rules.hs +2/−2
- Duckling/Duration/RU/Corpus.hs +96/−0
- Duckling/Duration/RU/Rules.hs +118/−0
- Duckling/Duration/Rules.hs +3/−3
- Duckling/Duration/SV/Corpus.hs +7/−0
- Duckling/Duration/SV/Rules.hs +9/−8
- Duckling/Duration/TR/Rules.hs +2/−2
- Duckling/Duration/Types.hs +2/−1
- Duckling/Email/EN/Corpus.hs +12/−0
- Duckling/Email/EN/Rules.hs +4/−2
- Duckling/Engine.hs +5/−5
- Duckling/Locale.hs +14/−2
- Duckling/Numeral/AR/Corpus.hs +49/−8
- Duckling/Numeral/AR/Rules.hs +66/−75
- Duckling/Numeral/BG/Rules.hs +8/−36
- Duckling/Numeral/CS/Rules.hs +3/−17
- Duckling/Numeral/DA/Rules.hs +22/−35
- Duckling/Numeral/DE/Corpus.hs +11/−2
- Duckling/Numeral/DE/Rules.hs +42/−93
- Duckling/Numeral/EL/Corpus.hs +151/−0
- Duckling/Numeral/EL/Rules.hs +269/−0
- Duckling/Numeral/EN/Corpus.hs +4/−0
- Duckling/Numeral/EN/Rules.hs +139/−124
- Duckling/Numeral/ES/Rules.hs +19/−34
- Duckling/Numeral/ET/Rules.hs +67/−83
- Duckling/Numeral/FR/Corpus.hs +4/−2
- Duckling/Numeral/FR/Rules.hs +29/−45
- Duckling/Numeral/GA/Corpus.hs +14/−2
- Duckling/Numeral/GA/Rules.hs +95/−98
- Duckling/Numeral/HE/Rules.hs +18/−31
- Duckling/Numeral/HI/Corpus.hs +87/−0
- Duckling/Numeral/HI/Rules.hs +170/−0
- Duckling/Numeral/HR/Rules.hs +20/−34
- Duckling/Numeral/HU/Rules.hs +7/−21
- Duckling/Numeral/Helpers.hs +76/−4
- Duckling/Numeral/ID/Rules.hs +19/−34
- Duckling/Numeral/IT/Rules.hs +164/−160
- Duckling/Numeral/JA/Rules.hs +26/−39
- Duckling/Numeral/KA/Rules.hs +3/−17
- Duckling/Numeral/KO/Rules.hs +97/−103
- Duckling/Numeral/MY/Corpus.hs +1/−0
- Duckling/Numeral/MY/Rules.hs +60/−44
- Duckling/Numeral/NB/Rules.hs +23/−38
- Duckling/Numeral/NE/Corpus.hs +86/−0
- Duckling/Numeral/NE/Rules.hs +125/−0
- Duckling/Numeral/NL/Corpus.hs +9/−2
- Duckling/Numeral/NL/Rules.hs +17/−31
- Duckling/Numeral/PL/Rules.hs +21/−34
- Duckling/Numeral/PT/Corpus.hs +24/−2
- Duckling/Numeral/PT/Rules.hs +266/−185
- Duckling/Numeral/RO/Rules.hs +24/−39
- Duckling/Numeral/RU/Corpus.hs +22/−0
- Duckling/Numeral/RU/Rules.hs +47/−37
- Duckling/Numeral/Rules.hs +54/−0
- Duckling/Numeral/SV/Rules.hs +22/−38
- Duckling/Numeral/TR/Rules.hs +24/−39
- Duckling/Numeral/Types.hs +0/−3
- Duckling/Numeral/UK/Rules.hs +21/−34
- Duckling/Numeral/VI/Rules.hs +68/−114
- Duckling/Numeral/ZH/Rules.hs +15/−28
- Duckling/Ordinal/AR/Corpus.hs +61/−6
- Duckling/Ordinal/AR/Rules.hs +92/−76
- Duckling/Ordinal/EL/Corpus.hs +72/−0
- Duckling/Ordinal/EL/Rules.hs +108/−0
- Duckling/Ordinal/EN/Corpus.hs +15/−3
- Duckling/Ordinal/EN/Rules.hs +9/−8
- Duckling/Ordinal/ET/Rules.hs +30/−23
- Duckling/Ordinal/HE/Rules.hs +2/−2
- Duckling/Ordinal/HI/Corpus.hs +106/−0
- Duckling/Ordinal/HI/Rules.hs +123/−0
- Duckling/Ordinal/Helpers.hs +9/−0
- Duckling/Ordinal/JA/Rules.hs +1/−1
- Duckling/Ordinal/KO/Rules.hs +1/−1
- Duckling/Ordinal/PL/Rules.hs +2/−2
- Duckling/Ordinal/RU/Corpus.hs +45/−0
- Duckling/Ordinal/RU/Rules.hs +4/−4
- Duckling/Ordinal/ZH/Rules.hs +1/−1
- Duckling/Quantity/AR/Corpus.hs +68/−0
- Duckling/Quantity/AR/Rules.hs +150/−0
- Duckling/Quantity/EN/Corpus.hs +40/−8
- Duckling/Quantity/EN/Rules.hs +160/−15
- Duckling/Quantity/FR/Corpus.hs +3/−3
- Duckling/Quantity/HR/Corpus.hs +2/−2
- Duckling/Quantity/Helpers.hs +46/−5
- Duckling/Quantity/KO/Corpus.hs +4/−4
- Duckling/Quantity/PT/Corpus.hs +3/−3
- Duckling/Quantity/RO/Corpus.hs +3/−3
- Duckling/Quantity/RU/Corpus.hs +60/−0
- Duckling/Quantity/RU/Rules.hs +65/−0
- Duckling/Quantity/Types.hs +102/−14
- Duckling/Ranking/Classifiers.hs +6/−0
- Duckling/Ranking/Classifiers/AR_XX.hs +1920/−1
- Duckling/Ranking/Classifiers/DA_XX.hs +141/−135
- Duckling/Ranking/Classifiers/DE_XX.hs +238/−245
- Duckling/Ranking/Classifiers/EL_XX.hs +2632/−0
- Duckling/Ranking/Classifiers/EN_CA.hs +2365/−2300
- Duckling/Ranking/Classifiers/EN_GB.hs +2363/−2293
- Duckling/Ranking/Classifiers/EN_US.hs +2365/−2300
- Duckling/Ranking/Classifiers/EN_XX.hs +2365/−2300
- Duckling/Ranking/Classifiers/ES_XX.hs +7/−0
- Duckling/Ranking/Classifiers/FR_XX.hs +400/−377
- Duckling/Ranking/Classifiers/GA_XX.hs +7/−0
- Duckling/Ranking/Classifiers/HE_XX.hs +7/−0
- Duckling/Ranking/Classifiers/HI_XX.hs +22/−0
- Duckling/Ranking/Classifiers/HR_XX.hs +109/−103
- Duckling/Ranking/Classifiers/IT_XX.hs +187/−179
- Duckling/Ranking/Classifiers/KO_XX.hs +145/−150
- Duckling/Ranking/Classifiers/NB_XX.hs +147/−135
- Duckling/Ranking/Classifiers/NE_XX.hs +22/−0
- Duckling/Ranking/Classifiers/NL_XX.hs +1831/−1
- Duckling/Ranking/Classifiers/PL_XX.hs +7/−0
- Duckling/Ranking/Classifiers/PT_XX.hs +432/−304
- Duckling/Ranking/Classifiers/SV_XX.hs +151/−143
- Duckling/Ranking/Classifiers/VI_XX.hs +7/−0
- Duckling/Ranking/Classifiers/ZH_CN.hs +7/−0
- Duckling/Ranking/Classifiers/ZH_HK.hs +7/−0
- Duckling/Ranking/Classifiers/ZH_MO.hs +7/−0
- Duckling/Ranking/Classifiers/ZH_TW.hs +7/−0
- Duckling/Ranking/Classifiers/ZH_XX.hs +7/−0
- Duckling/Ranking/Extraction.hs +2/−2
- Duckling/Ranking/Types.hs +1/−1
- Duckling/Rules.hs +12/−0
- Duckling/Rules/AR.hs +15/−8
- Duckling/Rules/BG.hs +1/−1
- Duckling/Rules/CS.hs +1/−1
- Duckling/Rules/Common.hs +3/−2
- Duckling/Rules/DA.hs +1/−1
- Duckling/Rules/DE.hs +1/−1
- Duckling/Rules/EL.hs +47/−0
- Duckling/Rules/EN.hs +20/−1
- Duckling/Rules/ES.hs +1/−1
- Duckling/Rules/ET.hs +1/−1
- Duckling/Rules/FR.hs +1/−1
- Duckling/Rules/GA.hs +1/−1
- Duckling/Rules/HE.hs +1/−1
- Duckling/Rules/HI.hs +43/−0
- Duckling/Rules/HR.hs +1/−1
- Duckling/Rules/HU.hs +1/−1
- Duckling/Rules/ID.hs +1/−1
- Duckling/Rules/IT.hs +1/−1
- Duckling/Rules/JA.hs +1/−1
- Duckling/Rules/KA.hs +1/−1
- Duckling/Rules/KO.hs +1/−1
- Duckling/Rules/MY.hs +1/−1
- Duckling/Rules/NB.hs +1/−1
- Duckling/Rules/NE.hs +42/−0
- Duckling/Rules/NL.hs +3/−2
- Duckling/Rules/PL.hs +1/−1
- Duckling/Rules/PT.hs +1/−1
- Duckling/Rules/RO.hs +1/−1
- Duckling/Rules/RU.hs +13/−7
- Duckling/Rules/SV.hs +1/−1
- Duckling/Rules/TR.hs +1/−1
- Duckling/Rules/UK.hs +1/−1
- Duckling/Rules/VI.hs +1/−1
- Duckling/Rules/ZH.hs +1/−1
- Duckling/Temperature/AR/Corpus.hs +50/−0
- Duckling/Temperature/AR/Rules.hs +100/−0
- Duckling/Temperature/EN/Corpus.hs +3/−2
- Duckling/Temperature/EN/Rules.hs +18/−17
- Duckling/Temperature/ES/Rules.hs +1/−1
- Duckling/Temperature/FR/Rules.hs +1/−1
- Duckling/Temperature/GA/Rules.hs +1/−1
- Duckling/Temperature/Helpers.hs +2/−2
- Duckling/Temperature/PT/Rules.hs +1/−1
- Duckling/Temperature/TR/Rules.hs +2/−2
- Duckling/Testing/Types.hs +2/−2
- Duckling/Time/AR/Corpus.hs +332/−0
- Duckling/Time/AR/Rules.hs +1836/−0
- Duckling/Time/Corpus.hs +1/−1
- Duckling/Time/DA/Corpus.hs +3/−0
- Duckling/Time/DA/Rules.hs +12/−29
- Duckling/Time/DE/Corpus.hs +1/−0
- Duckling/Time/DE/Rules.hs +61/−102
- Duckling/Time/EL/Corpus.hs +991/−0
- Duckling/Time/EL/Rules.hs +1783/−0
- Duckling/Time/EN/AU/Corpus.hs +65/−0
- Duckling/Time/EN/AU/Rules.hs +88/−0
- Duckling/Time/EN/BZ/Corpus.hs +65/−0
- Duckling/Time/EN/BZ/Rules.hs +88/−0
- Duckling/Time/EN/CA/Corpus.hs +1/−0
- Duckling/Time/EN/CA/Rules.hs +24/−3
- Duckling/Time/EN/Corpus.hs +20/−0
- Duckling/Time/EN/GB/Corpus.hs +5/−0
- Duckling/Time/EN/GB/Rules.hs +21/−3
- Duckling/Time/EN/IE/Corpus.hs +65/−0
- Duckling/Time/EN/IE/Rules.hs +88/−0
- Duckling/Time/EN/IN/Corpus.hs +65/−0
- Duckling/Time/EN/IN/Rules.hs +88/−0
- Duckling/Time/EN/JM/Corpus.hs +65/−0
- Duckling/Time/EN/JM/Rules.hs +88/−0
- Duckling/Time/EN/NZ/Corpus.hs +65/−0
- Duckling/Time/EN/NZ/Rules.hs +88/−0
- Duckling/Time/EN/PH/Corpus.hs +61/−0
- Duckling/Time/EN/PH/Rules.hs +88/−0
- Duckling/Time/EN/Rules.hs +148/−206
- Duckling/Time/EN/TT/Corpus.hs +65/−0
- Duckling/Time/EN/TT/Rules.hs +88/−0
- Duckling/Time/EN/US/Corpus.hs +1/−0
- Duckling/Time/EN/US/Rules.hs +25/−3
- Duckling/Time/EN/ZA/Corpus.hs +61/−0
- Duckling/Time/EN/ZA/Rules.hs +88/−0
- Duckling/Time/ES/Rules.hs +10/−28
- Duckling/Time/FR/Rules.hs +7/−24
- Duckling/Time/GA/Rules.hs +16/−34
- Duckling/Time/HE/Rules.hs +5/−15
- Duckling/Time/HR/Corpus.hs +1/−0
- Duckling/Time/HR/Rules.hs +20/−37
- Duckling/Time/HU/Rules.hs +17/−45
- Duckling/Time/Helpers.hs +59/−16
- Duckling/Time/IT/Corpus.hs +1/−0
- Duckling/Time/IT/Rules.hs +9/−27
- Duckling/Time/KO/Corpus.hs +1/−0
- Duckling/Time/KO/Rules.hs +8/−8
- Duckling/Time/NB/Corpus.hs +3/−0
- Duckling/Time/NB/Rules.hs +8/−25
- Duckling/Time/NL/Corpus.hs +673/−0
- Duckling/Time/NL/Rules.hs +1611/−0
- Duckling/Time/PL/Rules.hs +10/−29
- Duckling/Time/PT/Rules.hs +38/−192
- Duckling/Time/RO/Rules.hs +6/−23
- Duckling/Time/SV/Corpus.hs +6/−0
- Duckling/Time/SV/Rules.hs +13/−30
- Duckling/Time/Types.hs +23/−20
- Duckling/Time/VI/Rules.hs +25/−45
- Duckling/Time/ZH/Rules.hs +6/−25
- Duckling/TimeGrain/AR/Rules.hs +41/−0
- Duckling/TimeGrain/EL/Rules.hs +42/−0
- Duckling/TimeGrain/NL/Rules.hs +3/−3
- Duckling/TimeGrain/RU/Rules.hs +41/−0
- Duckling/TimeGrain/Types.hs +1/−1
- Duckling/Types.hs +12/−5
- Duckling/Types/Stash.hs +1/−1
- Duckling/Url/Corpus.hs +9/−0
- Duckling/Url/Helpers.hs +1/−1
- Duckling/Url/Rules.hs +1/−1
- Duckling/Volume/AR/Corpus.hs +65/−0
- Duckling/Volume/AR/Rules.hs +98/−0
- Duckling/Volume/RU/Corpus.hs +59/−0
- Duckling/Volume/RU/Rules.hs +54/−0
- Duckling/Volume/Rules.hs +1/−1
- README.md +11/−4
- duckling.cabal +92/−4
- exe/Duckling/Ranking/Generate.hs +8/−2
- exe/ExampleMain.hs +15/−3
- tests/Duckling/AmountOfMoney/AR/Tests.hs +24/−0
- tests/Duckling/AmountOfMoney/EN/Tests.hs +34/−3
- tests/Duckling/AmountOfMoney/FR/Tests.hs +2/−2
- tests/Duckling/AmountOfMoney/RU/Tests.hs +23/−0
- tests/Duckling/AmountOfMoney/Tests.hs +5/−1
- tests/Duckling/Api/Tests.hs +11/−7
- tests/Duckling/Distance/RU/Tests.hs +23/−0
- tests/Duckling/Distance/Tests.hs +2/−0
- tests/Duckling/Duration/AR/Tests.hs +24/−0
- tests/Duckling/Duration/EL/Tests.hs +25/−0
- tests/Duckling/Duration/RU/Tests.hs +24/−0
- tests/Duckling/Duration/Tests.hs +8/−2
- tests/Duckling/Numeral/EL/Tests.hs +22/−0
- tests/Duckling/Numeral/EN/Tests.hs +19/−0
- tests/Duckling/Numeral/HI/Tests.hs +23/−0
- tests/Duckling/Numeral/NE/Tests.hs +23/−0
- tests/Duckling/Numeral/Tests.hs +6/−0
- tests/Duckling/Ordinal/EL/Tests.hs +24/−0
- tests/Duckling/Ordinal/HI/Tests.hs +24/−0
- tests/Duckling/Ordinal/Tests.hs +4/−0
- tests/Duckling/Quantity/AR/Tests.hs +24/−0
- tests/Duckling/Quantity/EN/Tests.hs +1/−1
- tests/Duckling/Quantity/RU/Tests.hs +24/−0
- tests/Duckling/Quantity/Tests.hs +9/−3
- tests/Duckling/Temperature/AR/Tests.hs +24/−0
- tests/Duckling/Temperature/Tests.hs +3/−1
- tests/Duckling/Testing/Asserts.hs +11/−0
- tests/Duckling/Time/AR/Tests.hs +24/−0
- tests/Duckling/Time/EL/Tests.hs +23/−0
- tests/Duckling/Time/EN/Tests.hs +71/−1
- tests/Duckling/Time/NL/Tests.hs +24/−0
- tests/Duckling/Time/Tests.hs +7/−1
- tests/Duckling/Volume/AR/Tests.hs +24/−0
- tests/Duckling/Volume/RU/Tests.hs +23/−0
- tests/Duckling/Volume/Tests.hs +9/−3
+ Duckling/AmountOfMoney/AR/Corpus.hs view
@@ -0,0 +1,126 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.AmountOfMoney.AR.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.AmountOfMoney.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale AR Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (simple Dollar 1)+ [ "$1"+ , "1 دولار"+ ]+ , examples (simple Dollar 10)+ [ "$10"+ , "$ 10"+ , "10 $"+ , "10$"+ , "10$"+ , "10 دولار"+ , "عشرة دولارات"+ ]+ , examples (simple Cent 10)+ [ "10 سنتات"+ , "10 سنت"+ , "10 سينت"+ , "10 سينتات"+ , "10 c"+ , "10¢"+ ]+ , examples (simple Dollar 1e4)+ [ "10000 دولار"+ , "$10,000"+ , "10000$"+ ]+ , examples (simple EUR 20)+ [ "20 يورو"+ , "20 اورو"+ , "20 أورو"+ , "20€"+ , "20 €"+ ]+ , examples (simple Pound 10)+ [ "10 جنيه"+ , "10 جنيهات"+ ]+ , examples (simple Dollar 20.43)+ [ "20$ و 43c"+ , "$20 43"+ , "20$ 43c"+ , "20 دولار و43 سنت"+ , "20.43 $"+ ]+ , examples (simple GBP 3)+ [ "3 جنيهات استرلينية"+ , "3 جنيه استرليني"+ ]+ , examples (simple KWD 42)+ [ "42 KWD"+ , "42 دينار كويتي"+ ]+ , examples (simple LBP 42)+ [ "42 LBP"+ , "42 ليرة لبنانية"+ , "42 ليرات لبنانية"+ ]+ , examples (simple EGP 42)+ [ "42 EGP"+ , "42 جنيه مصري"+ , "42 جنيهات مصريه"+ ]+ , examples (simple QAR 42)+ [ "42 QAR"+ , "42 ريال قطري"+ , "42 ريالات قطرية"+ ]+ , examples (simple SAR 42)+ [ "42 SAR"+ , "42 ريال سعودي"+ ]+ , examples (between Dollar (10, 20))+ [ "من 10 الى 20 دولار"+ , "بحدود 10-20 دولار"+ , "ما بين عشرة وعشرون دولار"+ , "من عشرة لعشرين دولار"+ , "حوالي 10$-20$"+ , "10-20 $"+ , "10-20 دولار"+ ]+ , examples (under EUR 7)+ [ "تحت سبعة اورو"+ , "اقل من سبعة يورو"+ , "اقل من 7 يورو"+ ]+ , examples (above Dollar 3.42)+ [ "اكثر من ثلاثة دولار و42 سينت"+ , "3.42$ على الاقل"+ ]+ , examples (simple JOD 5)+ [ "5 دينار اردني"+ , "5 دنانير أردنية"+ ]+ , examples (simple ILS 5)+ [ "5 شيقل"+ , "5 شواقل"+ , "خمسة شيكل"+ ]+ ]
+ Duckling/AmountOfMoney/AR/Rules.hs view
@@ -0,0 +1,402 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.AmountOfMoney.AR.Rules+ ( rules+ ) where++import Data.Maybe+import Data.String+import Prelude+import qualified Data.Text as Text++import Duckling.AmountOfMoney.Helpers+import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))+import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural, isPositive)+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral++rulePounds :: Rule+rulePounds = Rule+ { name = "£"+ , pattern =+ [ regex "جنيه(ات)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Pound+ }++ruleDinars :: Rule+ruleDinars = Rule+ { name = "dinars"+ , pattern =+ [ regex "دينار|دنانير"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Dinar+ }++ruleDirhams :: Rule+ruleDirhams = Rule+ { name = "Dirhams"+ , pattern =+ [ regex "درا?هم"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Dirham+ }++ruleRiyals :: Rule+ruleRiyals = Rule+ { name = "Riyals"+ , pattern =+ [ regex "ريال(ات)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Riyal+ }++ruleDollars :: Rule+ruleDollars = Rule+ { name = "Dollars"+ , pattern =+ [ regex "دولار(ات)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Dollar+ }++ruleShekel :: Rule+ruleShekel = Rule+ { name = "Shekel"+ , pattern =+ [ regex "شي[كق]ل|شوا[كق]ل"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly ILS+ }++ruleEuro :: Rule+ruleEuro = Rule+ { name = "Euro"+ , pattern =+ [ regex "[أاي]ورو"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly EUR+ }++ruleOtherPounds :: Rule+ruleOtherPounds = Rule+ { name = "other pounds"+ , pattern =+ [ regex "جنيه(ات)? (مصر|استرلين)ي?[ةه]?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:match:_)):+ _) -> case Text.toLower match of+ "مصر" -> Just . Token AmountOfMoney $ currencyOnly EGP+ "استرلين" -> Just . Token AmountOfMoney $ currencyOnly GBP+ _ -> Nothing+ _ -> Nothing+ }++ruleOtherDinars :: Rule+ruleOtherDinars = Rule+ { name = "dinars"+ , pattern =+ [ regex "(دينار|دنانير) ([أا]ردن|كويت|عراق)ي?[ةه]?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:match:_)):+ _) -> case Text.toLower match of+ "كويت" -> Just . Token AmountOfMoney $ currencyOnly KWD+ "اردن" -> Just . Token AmountOfMoney $ currencyOnly JOD+ "أردن" -> Just . Token AmountOfMoney $ currencyOnly JOD+ "عراق" -> Just . Token AmountOfMoney $ currencyOnly IQD+ _ -> Nothing+ _ -> Nothing+ }++ruleOtherDirhams :: Rule+ruleOtherDirhams = Rule+ { name = "dirham"+ , pattern =+ [ regex "(درهم|دراهم) (اردن|أردن|مغرب)ي?[ةه]?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:match:_)):+ _) -> case Text.toLower match of+ "إمارات" -> Just . Token AmountOfMoney $ currencyOnly AED+ "امارات" -> Just . Token AmountOfMoney $ currencyOnly AED+ "مغرب" -> Just . Token AmountOfMoney $ currencyOnly MAD+ _ -> Nothing+ _ -> Nothing+ }++ruleOtherRiyals :: Rule+ruleOtherRiyals = Rule+ { name = "riyals"+ , pattern =+ [ regex "(ريال|ريالات) (سعود|قطر)ي?[ةه]?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:match:_)):+ _) -> case Text.toLower match of+ "قطر" -> Just . Token AmountOfMoney $ currencyOnly QAR+ "سعود" -> Just . Token AmountOfMoney $ currencyOnly SAR+ _ -> Nothing+ _ -> Nothing+ }++ruleCent :: Rule+ruleCent = Rule+ { name = "cent"+ , pattern =+ [ regex "سي?نت(ات)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Cent+ }++ruleLBP :: Rule+ruleLBP = Rule+ { name = "LBP"+ , pattern =+ [ regex "لير([ةه]|ات) لبناني[ةه]?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly LBP+ }++ruleIntersectAndXCents :: Rule+ruleIntersectAndXCents = Rule+ { name = "intersect (and X cents)"+ , pattern =+ [ Predicate isWithoutCents+ , regex "و"+ , Predicate isCents+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ _:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersect :: Rule+ruleIntersect = Rule+ { name = "intersect"+ , pattern =+ [ Predicate isWithoutCents+ , Predicate isNatural+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ Token Numeral NumeralData {TNumeral.value = c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersectAndNumeral :: Rule+ruleIntersectAndNumeral = Rule+ { name = "intersect (and number)"+ , pattern =+ [ Predicate isWithoutCents+ , regex "و"+ , Predicate isNatural+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ _:+ Token Numeral NumeralData {TNumeral.value = c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersectXCents :: Rule+ruleIntersectXCents = Rule+ { name = "intersect (X cents)"+ , pattern =+ [ Predicate isWithoutCents+ , Predicate isCents+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++rulePrecision :: Rule+rulePrecision = Rule+ { name = "about|exactly <amount-of-money>"+ , pattern =+ [ regex "حوال[ي|ى]|تقريبا|بحدود"+ , Predicate isMoneyWithValue+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleIntervalBetweenNumeral :: Rule+ruleIntervalBetweenNumeral = Rule+ { name = "between|from <numeral> to|and <amount-of-money>"+ , pattern =+ [ regex "(من|(ما )?بين)( ال)?"+ , Predicate isPositive+ , regex "(الى|حتى|و|ل)( ا?ل)?"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Numeral NumeralData {TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between|from <amount-of-money> to|and <amount-of-money>"+ , pattern =+ [ regex "(من|(ما )?بين)( ال)?"+ , financeWith TAmountOfMoney.value isJust+ , regex "(الى|حتى|و|ل)( ا?ل)?"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}:+ _:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }++ruleIntervalNumeralDash :: Rule+ruleIntervalNumeralDash = Rule+ { name = "<numeral> - <amount-of-money>"+ , pattern =+ [ Predicate isPositive+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData {TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<amount-of-money> - <amount-of-money>"+ , pattern =+ [ financeWith TAmountOfMoney.value isJust+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}:+ _:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }++ruleIntervalMax :: Rule+ruleIntervalMax = Rule+ { name = "under/less/lower/no more than <amount-of-money>"+ , pattern =+ [ regex "(حتى|[أا]قل من|تحت|(ما )?دون)|على ال[أا]كثر"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalAtMost :: Rule+ruleIntervalAtMost = Rule+ { name = "under/less/lower/no more than <amount-of-money>"+ , pattern =+ [ regex "على ال[أا]كثر"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalMin :: Rule+ruleIntervalMin = Rule+ { name = "at least/over/above/more than <amount-of-money>"+ , pattern =+ [ regex "فوق||[أا]كثر من|على ال[اأ]قل"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalAtLeast :: Rule+ruleIntervalAtLeast = Rule+ { name = "<amount-of-money> at least"+ , pattern =+ [ financeWith TAmountOfMoney.value isJust+ , regex "على ال[اأ]قل"+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleCent+ , rulePounds+ , ruleDinars+ , ruleDirhams+ , ruleRiyals+ , ruleDollars+ , ruleShekel+ , ruleEuro+ , ruleOtherPounds+ , ruleOtherDinars+ , ruleOtherDirhams+ , ruleOtherRiyals+ , ruleLBP+ , ruleIntersect+ , ruleIntersectAndNumeral+ , ruleIntersectAndXCents+ , ruleIntersectXCents+ , ruleIntervalBetweenNumeral+ , ruleIntervalBetween+ , ruleIntervalMax+ , ruleIntervalAtMost+ , ruleIntervalMin+ , ruleIntervalAtLeast+ , ruleIntervalNumeralDash+ , ruleIntervalDash+ , rulePrecision+ ]
Duckling/AmountOfMoney/BG/Rules.hs view
@@ -21,6 +21,7 @@ import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..)) import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural, isPositive) import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Regex.Types import Duckling.Types@@ -76,14 +77,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "и"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -92,12 +93,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -106,14 +107,14 @@ ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "и"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -122,14 +123,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith id $ \x -> case TAmountOfMoney.value x of- Just v | v > 0 -> TAmountOfMoney.currency x == Cent- _ -> False+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -139,7 +138,7 @@ { name = "about|exactly <amount-of-money>" , pattern = [ regex "точно|около|приблизително|близо (до)?|почти"- , dimension AmountOfMoney+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -151,16 +150,17 @@ { name = "between|from <numeral> to|and <amount-of-money>" , pattern = [ regex "между|от"- , dimension Numeral+ , Predicate isPositive , regex "до|и" , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = from}):+ Token Numeral NumeralData{TNumeral.value = from}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):- _) ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c _ -> Nothing }@@ -176,10 +176,12 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}):- _) | c1 == c2 ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1 _ -> Nothing }@@ -188,15 +190,16 @@ ruleIntervalNumeralDash = Rule { name = "<numeral> - <amount-of-money>" , pattern =- [ dimension Numeral+ [ Predicate isPositive , regex "-" , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = from}):+ (Token Numeral NumeralData{TNumeral.value = from}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):- _) ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c _ -> Nothing }@@ -210,10 +213,12 @@ , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of- (Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}):+ (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}):- _) | c1 == c2 ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1 _ -> Nothing }@@ -227,7 +232,8 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}: _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c _ -> Nothing }@@ -241,7 +247,8 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}: _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c _ -> Nothing }
Duckling/AmountOfMoney/EN/Corpus.hs view
@@ -10,6 +10,7 @@ module Duckling.AmountOfMoney.EN.Corpus ( corpus+ , negativeCorpus ) where import Data.String@@ -18,6 +19,13 @@ import Duckling.AmountOfMoney.Types import Duckling.Testing.Types +negativeCorpus :: NegativeCorpus+negativeCorpus = (testContext, examples)+ where+ examples =+ [ "exactly dollars"+ ]+ corpus :: Corpus corpus = (testContext, allExamples) @@ -146,6 +154,21 @@ , "20 ringgit 43" , "twenty ringgit and 43" ]+ , examples (simple Dinar 10)+ [ "10 dinars"+ ]+ , examples (simple ILS 10)+ [ "ten shekels"+ , "10 ILS"+ ]+ , examples (simple Riyal 10)+ [ "ten riyals"+ , "10 riyals"+ ]+ , examples (simple Rial 10)+ [ "ten rials"+ , "10 rials"+ ] , examples (between Dollar (10, 20)) [ "between 10 and 20 dollars" , "from 10 dollars to 20 dollars"@@ -154,6 +177,10 @@ , "from 10 to 20 dollars" , "about $10-$20" , "10-20 dollars"+ ]+ , examples (between Dollar (1.1, 1.3))+ [ "between 1.1 and 1.3 dollars"+ , "from 1 point 1 and one point three dollars" ] , examples (under EUR 7) [ "under seven euros"
Duckling/AmountOfMoney/EN/Rules.hs view
@@ -10,21 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.EN.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.Text as Text import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural, isPositive) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral rulePounds :: Rule rulePounds = Rule@@ -72,7 +74,7 @@ , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of "kuwaiti" -> Just . Token AmountOfMoney $ currencyOnly KWD- _ -> Nothing+ _ -> Nothing _ -> Nothing } @@ -120,7 +122,9 @@ , financeWith TAmountOfMoney.value isNothing ] , prod = \tokens -> case tokens of- (_:Token AmountOfMoney fd:_) -> Just . Token AmountOfMoney $ fd {TAmountOfMoney.value = Just 1}+ (_:+ Token AmountOfMoney fd:+ _) -> Just . Token AmountOfMoney $ fd {TAmountOfMoney.value = Just 1} _ -> Nothing } @@ -128,14 +132,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "and"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -144,12 +148,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -158,14 +162,14 @@ ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "and"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -174,14 +178,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith id $ \x -> case TAmountOfMoney.value x of- Just v | v > 0 -> TAmountOfMoney.currency x == Cent- _ -> False+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -191,7 +193,7 @@ { name = "about|exactly <amount-of-money>" , pattern = [ regex "exactly|precisely|about|approx(\\.|imately)?|close to|near( to)?|around|almost"- , dimension AmountOfMoney+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -203,16 +205,17 @@ { name = "between|from <numeral> to|and <amount-of-money>" , pattern = [ regex "between|from"- , dimension Numeral+ , Predicate isPositive , regex "to|and" , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = from}):+ Token Numeral NumeralData{TNumeral.value = from}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):- _) ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c _ -> Nothing }@@ -228,10 +231,12 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}):- _) | c1 == c2 ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1 _ -> Nothing }@@ -240,15 +245,16 @@ ruleIntervalNumeralDash = Rule { name = "<numeral> - <amount-of-money>" , pattern =- [ dimension Numeral+ [ Predicate isNatural , regex "-" , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = from}):+ (Token Numeral NumeralData{TNumeral.value = from}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):- _) ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to-> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c _ -> Nothing }@@ -262,10 +268,12 @@ , financeWith TAmountOfMoney.value isJust ] , prod = \tokens -> case tokens of- (Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just from, TAmountOfMoney.currency = c1}):+ (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c2}):- _) | c1 == c2 ->+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 -> Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1 _ -> Nothing }@@ -279,7 +287,8 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}: _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c _ -> Nothing }@@ -293,7 +302,8 @@ ] , prod = \tokens -> case tokens of (_:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}: _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c _ -> Nothing }
Duckling/AmountOfMoney/ES/Rules.hs view
@@ -10,19 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.ES.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleDollar :: Rule ruleDollar = Rule@@ -55,14 +57,14 @@ ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "y"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -71,12 +73,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -85,14 +87,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "y"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -101,12 +103,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/FR/Corpus.hs view
@@ -34,6 +34,8 @@ [ "$10.000" , "10K$" , "$10k"+ , "10 000 dollars"+ , "10 000,00 $" ] , examples (simple USD 1.23) [ "USD1,23"@@ -62,5 +64,30 @@ , examples (simple GBP 3.01) [ "GBP3,01" , "GBP 3,01"+ ]+ , examples (simple ILS 10)+ [ "dix shekels"+ ]+ , examples (simple Rial 10)+ [ "dix rials"+ ]+ , examples (simple Riyal 10)+ [ "dix riyals"+ ]+ , examples (between EUR (10, 20))+ [ "entre 10 et 20 euro"+ , "entre 10 euro et 20 euro"+ , "10 - 20 euro"+ , "10 euro - 20 euro"+ ]+ , examples (above EUR 10)+ [ "au moins 10 euro"+ , "plus que 10 euros"+ , "plus de 10 euros"+ ]+ , examples (under Dollar 10)+ [ "en-dessous de 10 dollars"+ , "moins de 10 dollars"+ , "pas plus de 10 dollars" ] ]
Duckling/AmountOfMoney/FR/Rules.hs view
@@ -10,32 +10,34 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.FR.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency (..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural, isPositive) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectAndNumeral :: Rule ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "et"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -45,7 +47,7 @@ { name = "precision" , pattern = [ regex "exactement|quasi|plus ou moins|environ|autour de|(a|à) peu pr(e|è)s"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -65,16 +67,131 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing } +ruleIntervalBetweenNumeral :: Rule+ruleIntervalBetweenNumeral = Rule+ { name = "between|from <numeral> to|and <amount-of-money>"+ , pattern =+ [ regex "entre"+ , Predicate isPositive+ , regex "et"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }+++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between|from <amount-of-money> to|and <amount-of-money>"+ , pattern =+ [ regex "entre"+ , financeWith TAmountOfMoney.value isJust+ , regex "et"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData {+ TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1+ }:+ _:+ Token AmountOfMoney AmountOfMoneyData {+ TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2+ }:+ _) | c1 == c2, from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }+++ruleIntervalNumeralDash :: Rule+ruleIntervalNumeralDash = Rule+ { name = "<numeral> - <amount-of-money>"+ , pattern =+ [ Predicate isNatural+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<amount-of-money> - <amount-of-money>"+ , pattern =+ [ financeWith TAmountOfMoney.value isJust+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }++ruleIntervalMax :: Rule+ruleIntervalMax = Rule+ { name = "under/less/lower/no more than <amount-of-money>"+ , pattern =+ [ regex "(moins|pas plus|en-dessous) de"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalMin :: Rule+ruleIntervalMin = Rule+ { name = "over/above/at least/more than <amount-of-money>"+ , pattern =+ [ regex "plus (que|de)|au moins"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c+ _ -> Nothing+ }++ rulePounds :: Rule rulePounds = Rule { name = "£"@@ -88,14 +205,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "et"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -104,12 +221,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -130,6 +247,12 @@ , ruleIntersectAndNumeral , ruleIntersectAndXCents , ruleIntersectXCents+ , ruleIntervalBetween+ , ruleIntervalBetweenNumeral+ , ruleIntervalDash+ , ruleIntervalMax+ , ruleIntervalMin+ , ruleIntervalNumeralDash , rulePounds , rulePrecision , ruleUnnamedCurrency
Duckling/AmountOfMoney/GA/Rules.hs view
@@ -10,19 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.GA.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency (..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleDollar :: Rule ruleDollar = Rule@@ -47,7 +49,7 @@ { name = "thart ar <amount-of-money>" , pattern = [ regex "thart( ar)?|beagnach|breis (is|agus)"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -58,12 +60,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -81,14 +83,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "agus|is"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -97,12 +99,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -120,14 +122,14 @@ ruleIntersectAgusNumeral = Rule { name = "intersect (agus number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "agus|is"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -136,7 +138,7 @@ ruleAmountofmoneyGlan = Rule { name = "<amount-of-money> glan" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isMoneyWithValue , regex "glan|baileach|(go )?d(í|i)reach" ] , prod = \tokens -> case tokens of
Duckling/AmountOfMoney/HR/Rules.hs view
@@ -9,7 +9,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.HR.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe import Data.String@@ -20,6 +21,7 @@ import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..)) import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Regex.Types import Duckling.Types@@ -30,14 +32,14 @@ ruleIntersectAndNumber = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "i"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -73,14 +75,14 @@ ruleIntersectIXLipa = Rule { name = "intersect (i X lipa)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "i"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -89,12 +91,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -121,12 +123,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/Helpers.hs view
@@ -7,11 +7,14 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.AmountOfMoney.Helpers ( currencyOnly , financeWith+ , isCents+ , isMoneyWithValue+ , isWithoutCents , withCents , withInterval , withMax@@ -20,9 +23,11 @@ ) where +import Data.Maybe (isJust) import Prelude import Duckling.AmountOfMoney.Types (Currency (..), AmountOfMoneyData (..))+import Duckling.Numeral.Types (isInteger) import Duckling.Dimensions.Types import Duckling.Types hiding (Entity(..)) @@ -35,6 +40,20 @@ (Token AmountOfMoney x) -> pred (f x) _ -> False +isCents :: Predicate+isCents (Token AmountOfMoney AmountOfMoneyData{value = Just _, currency = Cent}) = True+isCents _ = False++isWithoutCents :: Predicate+isWithoutCents (Token AmountOfMoney AmountOfMoneyData{currency = Cent}) = False+isWithoutCents (Token AmountOfMoney AmountOfMoneyData{value = Just v}) = isInteger v+isWithoutCents _ = False++isMoneyWithValue :: Predicate+isMoneyWithValue (Token AmountOfMoney AmountOfMoneyData{value = v1, minValue = v2, maxValue = v3}) =+ any isJust [v1, v2, v3]+isMoneyWithValue _ = False+ -- ----------------------------------------------------------------- -- Production @@ -52,7 +71,8 @@ {value = Just x, currency = Cent, minValue = Nothing, maxValue = Nothing} withInterval :: (Double, Double) -> AmountOfMoneyData -> AmountOfMoneyData-withInterval (from, to) fd = fd {minValue = Just from, maxValue = Just to}+withInterval (from, to) fd = fd+ {minValue = Just from, maxValue = Just to, value = Nothing} withMin :: Double -> AmountOfMoneyData -> AmountOfMoneyData withMin x fd = fd {minValue = Just x}
Duckling/AmountOfMoney/ID/Rules.hs view
@@ -10,19 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.ID.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleDollar :: Rule ruleDollar = Rule@@ -55,12 +57,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/KO/Rules.hs view
@@ -10,23 +10,24 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.KO.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.Dimensions.Types import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney ruleAmountofmoneyAbout :: Rule ruleAmountofmoneyAbout = Rule { name = "<amount-of-money> about" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isMoneyWithValue , regex "정도|쯤" ] , prod = \tokens -> case tokens of@@ -57,7 +58,7 @@ { name = "about <amount-of-money>" , pattern = [ regex "약|대충|얼추"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -78,7 +79,7 @@ { name = "exactly <amount-of-money>" , pattern = [ regex "딱|정확히"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -89,12 +90,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/NB/Rules.hs view
@@ -10,32 +10,34 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.NB.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency (..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectAndNumeral :: Rule ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "og"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -45,7 +47,7 @@ { name = "about <amount-of-money>" , pattern = [ regex "omtrent|cirka|rundt|ca"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -65,12 +67,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -79,14 +81,14 @@ ruleIntersectXCentsWithAnd = Rule { name = "intersect (X cents) with and" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "og"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -113,14 +115,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "og"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -129,12 +131,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/PT/Rules.hs view
@@ -10,32 +10,34 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.PT.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectAndNumeral :: Rule ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "e"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -62,12 +64,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -85,14 +87,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "e"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -101,12 +103,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/RO/Rules.hs view
@@ -10,34 +10,36 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.RO.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.Text as Text import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectAndNumeral :: Rule ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "(s|ș)i"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -72,7 +74,7 @@ { name = "about/exactly <amount-of-money>" , pattern = [ regex "exact|cam|aprox(\\.|imativ)?|aproape|(i|î)n jur (de)?"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -101,14 +103,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "(s|ș)i"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -117,12 +119,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -154,12 +156,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
+ Duckling/AmountOfMoney/RU/Corpus.hs view
@@ -0,0 +1,168 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.AmountOfMoney.RU.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.AmountOfMoney.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale RU Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (simple RUB 1)+ [ "1 rub"+ , "один рубль"+ , "1 ₽"+ , "1 рубль"+ ]+ , examples (simple RUB 10)+ [ "10 рублей"+ , "₽ 10"+ , "10₽"+ , "10RUB"+ , "10руб"+ , "10 рублей"+ , "рублей 10"+ , "10 рублях"+ ]+ , examples (simple Dollar 1)+ [ "$1"+ , "один доллар"+ ]+ , examples (simple Dollar 10)+ [ "$10"+ , "$ 10"+ , "10$"+ , "10 долларов"+ , "десять долларов"+ ]+ , examples (simple Cent 10)+ [ "10 центов"+ , "десять пени"+ , "десять центов"+ , "10 c"+ , "10¢"+ ]+ , examples (simple Dollar 1e4)+ [ "$10К"+ , "10к$"+ , "$10,000"+ ]+ , examples (simple USD 3.14)+ [ "USD3.14"+ , "3.14US$"+ , "US$ 3.14"+ ]+ , examples (simple EUR 20)+ [ "20\x20ac"+ , "20 euros"+ , "20 Euro"+ , "20 Euros"+ , "EUR 20"+ , "EUR 20.0"+ , "20€"+ , "20 €ur"+ , "20 евро"+ , "Евро 20"+ ]+ , examples (simple Pound 10)+ [ "\x00a3\&10"+ , "десять фунтов"+ ]+ , examples (simple INR 20)+ [ "Rs. 20"+ , "Rs 20"+ , "20Rs"+ , "Rs20"+ ]+ , examples (simple Dollar 20.43)+ [ "$20 и 43ц"+ , "$20 43"+ , "20 долларов 43ц"+ , "20 долларов 43 центов"+ , "20 долларами 43 центами"+ , "20 долларов 43"+ , "двадцать долларов и 43"+ ]+ , examples (simple GBP 3.01)+ [ "GBP3.01"+ , "GBP 3.01"+ , "3 GBP 1 пенс"+ ]+ , examples (simple Unnamed 42)+ [ "42 бакса"+ , "бакса 42"+ , "42 баксов"+ ]+ , examples (simple BYN 42)+ [ "42 BYN"+ ]+ , examples (simple KWD 42)+ [ "42 KWD"+ ]+ , examples (simple LBP 42)+ [ "42 LBP"+ ]+ , examples (simple EGP 42)+ [ "42 EGP"+ ]+ , examples (simple QAR 42)+ [ "42 QAR"+ ]+ , examples (simple SAR 42)+ [ "42 SAR"+ ]+ , examples (simple BGN 42)+ [ "42 BGN"+ ]+ , examples (simple MYR 42)+ [ "42 MYR"+ , "42 RM"+ , "RM 42"+ , "MYR 42"+ , "42MYR"+ , "42RM"+ , "RM42"+ , "MYR42"+ ]+ , examples (between Dollar (10, 20))+ [ "между 10 и 20 долларами"+ , "от 10 долларов до 20"+ , "10-20 долларов"+ , "между 10 долларами и 20 долларами"+ , "от 10 до 20 долларов"+ , "10$-20$"+ , "10-20 долларов"+ ]+ , examples (under EUR 7)+ [ "менее 7 евро"+ , "меньше чем 7 EUR"+ , "ниже 7€"+ , "меньше 7 евро"+ , "не больше 7 евро"+ , "не более 7 евро"+ ]+ , examples (above Dollar 1.42)+ [ "больше чем 1 доллар и сорок два цента"+ , "как минимум $1.42"+ , "более 1.42 долларов"+ , "выше 1 доллара и 42 центов"+ , "свыше 1 доллара и 42 центов"+ ]+ ]
+ Duckling/AmountOfMoney/RU/Rules.hs view
@@ -0,0 +1,305 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.AmountOfMoney.RU.Rules+ ( rules+ ) where++import Data.Maybe+import Data.String+import Prelude+import qualified Data.Text as Text++import Duckling.AmountOfMoney.Helpers+import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))+import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural, isPositive)+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral++ruleRuble :: Rule+ruleRuble = Rule+ { name = "руб"+ , pattern =+ [ regex "руб(л(ь|ями|ям|ях|я|ю|(е|ё)м|ей|е|и))?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly RUB+ }++rulePounds :: Rule+rulePounds = Rule+ { name = "£"+ , pattern =+ [ regex "фунт(ами|ам|ах|а|у|ом|е|ы|ов)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Pound+ }++ruleDollar :: Rule+ruleDollar = Rule+ { name = "$"+ , pattern =+ [ regex "долл?ар(ами|ам|ах|а|у|ом|е|ы|ов)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Dollar+ }++ruleCent :: Rule+ruleCent = Rule+ { name = "cent"+ , pattern =+ [ regex "цент(ами|ам|ах|а|у|ом|е|ы|ов)?|пени|пенс(ами|ам|ах|а|у|ом|е|ы|ов)?|ц"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Cent+ }++ruleEUR :: Rule+ruleEUR = Rule+ { name = "€"+ , pattern =+ [ regex "евр(о|а)"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly EUR+ }++ruleBucks :: Rule+ruleBucks = Rule+ { name = "bucks"+ , pattern =+ [ regex "бакс(ами|ам|ах|а|у|ом|ах|ы|ов)?"+ ]+ , prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Unnamed+ }++ruleIntersectAndXCents :: Rule+ruleIntersectAndXCents = Rule+ { name = "intersect (and X cents)"+ , pattern =+ [ Predicate isWithoutCents+ , regex "и"+ , Predicate isCents+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersect :: Rule+ruleIntersect = Rule+ { name = "intersect"+ , pattern =+ [ Predicate isWithoutCents+ , Predicate isNatural+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ Token Numeral NumeralData{TNumeral.value = c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersectAndNumeral :: Rule+ruleIntersectAndNumeral = Rule+ { name = "intersect (and number)"+ , pattern =+ [ Predicate isWithoutCents+ , regex "и"+ , Predicate isNatural+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ _:+ Token Numeral NumeralData{TNumeral.value = c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++ruleIntersectXCents :: Rule+ruleIntersectXCents = Rule+ { name = "intersect (X cents)"+ , pattern =+ [ Predicate isWithoutCents+ , Predicate isCents+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney fd:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}:+ _) -> Just . Token AmountOfMoney $ withCents c fd+ _ -> Nothing+ }++rulePrecision :: Rule+rulePrecision = Rule+ { name = "about|exactly <amount-of-money>"+ , pattern =+ [ regex "точно|около|приблизительно|блико( к)?|почти"+ , Predicate isMoneyWithValue+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleIntervalBetweenNumeral :: Rule+ruleIntervalBetweenNumeral = Rule+ { name = "between|from <numeral> to|and <amount-of-money>"+ , pattern =+ [ regex "между|от"+ , Predicate isPositive+ , regex "до|и"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalBetweenNumeral2 :: Rule+ruleIntervalBetweenNumeral2 = Rule+ { name = "between|from <amount-of-money> to|and <numeral>"+ , pattern =+ [ regex "между|от"+ , financeWith TAmountOfMoney.value isJust+ , regex "до|и"+ , Predicate isNatural+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c}:+ _:+ Token Numeral NumeralData{TNumeral.value = to}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between|from <amount-of-money> to|and <amount-of-money>"+ , pattern =+ [ regex "между|от"+ , financeWith TAmountOfMoney.value isJust+ , regex "до|и"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }++ruleIntervalNumeralDash :: Rule+ruleIntervalNumeralDash = Rule+ { name = "<numeral> - <amount-of-money>"+ , pattern =+ [ Predicate isPositive+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) | from < to ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<amount-of-money> - <amount-of-money>"+ , pattern =+ [ financeWith TAmountOfMoney.value isJust+ , regex "-"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from,+ TAmountOfMoney.currency = c1}:+ _:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c2}:+ _) | from < to && c1 == c2 ->+ Just . Token AmountOfMoney . withInterval (from, to) $ currencyOnly c1+ _ -> Nothing+ }++ruleIntervalMax :: Rule+ruleIntervalMax = Rule+ { name = "under/less/lower/no more than <amount-of-money>"+ , pattern =+ [ regex "под|((менее|меньше|ниже|не больше|не более)( чем)?)"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c+ _ -> Nothing+ }++ruleIntervalMin :: Rule+ruleIntervalMin = Rule+ { name = "over/above/at least/more than <amount-of-money>"+ , pattern =+ [ regex "сверх|как минимум|((с?выше|больше|более)( чем)?)"+ , financeWith TAmountOfMoney.value isJust+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just to,+ TAmountOfMoney.currency = c}:+ _) -> Just . Token AmountOfMoney . withMin to $ currencyOnly c+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleBucks+ , ruleCent+ , ruleDollar+ , ruleEUR+ , ruleIntersect+ , ruleIntersectAndNumeral+ , ruleIntersectAndXCents+ , ruleIntersectXCents+ , ruleIntervalBetweenNumeral+ , ruleIntervalBetweenNumeral2+ , ruleIntervalBetween+ , ruleIntervalMax+ , ruleIntervalMin+ , ruleIntervalNumeralDash+ , ruleIntervalDash+ , rulePounds+ , rulePrecision+ , ruleRuble+ ]
Duckling/AmountOfMoney/Rules.hs view
@@ -24,6 +24,7 @@ import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..)) import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isPositive) import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Regex.Types import Duckling.Types@@ -36,9 +37,12 @@ , ("aud", AUD) , ("bgn", BGN) , ("brl", BRL)+ , ("byn", BYN) , ("¢", Cent) , ("c", Cent) , ("$", Dollar)+ , ("dinar", Dinar)+ , ("dinars", Dinar) , ("dollar", Dollar) , ("dollars", Dollar) , ("egp", EGP)@@ -54,17 +58,21 @@ , ("gbp", GBP) , ("hrk", HRK) , ("idr", IDR)+ , ("ils", ILS) , ("inr", INR)+ , ("iqd", IQD) , ("rs", INR) , ("rs.", INR) , ("rupee", INR) , ("rupees", INR)+ , ("jod", JOD) , ("¥", JPY) , ("jpy", JPY) , ("yen", JPY) , ("krw", KRW) , ("kwd", KWD) , ("lbp", LBP)+ , ("mad", MAD) , ("myr", MYR) , ("rm", MYR) , ("nok", NOK)@@ -74,10 +82,18 @@ , ("ptas", PTS) , ("pts", PTS) , ("qar", QAR)+ , ("₽", RUB)+ , ("rial", Rial)+ , ("rials", Rial)+ , ("riyal", Riyal)+ , ("riyals", Riyal) , ("ron", RON)+ , ("rub", RUB) , ("sar", SAR) , ("sek", SEK) , ("sgd", SGD)+ , ("shekel", ILS)+ , ("shekels", ILS) , ("usd", USD) , ("us$", USD) , ("vnd", VND)@@ -87,7 +103,7 @@ ruleCurrencies = Rule { name = "currencies" , pattern =- [ regex "(aed|aud|bgn|brl|¢|c|\\$|dollars?|egp|(e|€)uro?s?|€|gbp|hrk|idr|inr|¥|jpy|krw|kwd|lbp|myr|rm|nok|£|pta?s?|qar|rs\\.?|ron|rupees?|sar|sek|sgb|us(d|\\$)|vnd|yen)"+ [ regex "(aed|aud|bgn|brl|byn|¢|c|\\$|dinars?|dollars?|egp|(e|€)uro?s?|€|gbp|hrk|idr|ils|inr|iqd|jod|¥|jpy|krw|kwd|lbp|mad|myr|rm|nok|£|pta?s?|qar|₽|rs\\.?|riy?als?|ron|rub|rupees?|sar|sek|sgb|shekels?|us(d|\\$)|vnd|yen)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> do@@ -100,12 +116,12 @@ ruleAmountUnit = Rule { name = "<amount> <unit>" , pattern =- [ dimension Numeral+ [ Predicate isPositive , financeWith TAmountOfMoney.value isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.currency = c}):+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.currency = c}: _) -> Just . Token AmountOfMoney . withValue v $ currencyOnly c _ -> Nothing }@@ -115,11 +131,11 @@ { name = "<unit> <amount>" , pattern = [ financeWith TAmountOfMoney.value isNothing- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.currency = c}):- Token Numeral (NumeralData {TNumeral.value = v}):+ (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.currency = c}:+ Token Numeral NumeralData{TNumeral.value = v}: _) -> Just . Token AmountOfMoney . withValue v $ currencyOnly c _ -> Nothing }
Duckling/AmountOfMoney/SV/Rules.hs view
@@ -10,32 +10,34 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.SV.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectAndNumeral :: Rule ruleIntersectAndNumeral = Rule { name = "intersect (and number)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "och"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -45,7 +47,7 @@ { name = "about <amount-of-money>" , pattern = [ regex "omkring|cirka|runt|ca"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -66,7 +68,7 @@ { name = "exactly <amount-of-money>" , pattern = [ regex "exakt|precis"- , financeWith TAmountOfMoney.value isJust+ , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token@@ -77,12 +79,12 @@ ruleIntersectXCents = Rule { name = "intersect (X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -109,14 +111,14 @@ ruleIntersectAndXCents = Rule { name = "intersect (and X cents)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "och"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -125,12 +127,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/AmountOfMoney/Types.hs view
@@ -28,29 +28,39 @@ data Currency -- ambiguous = Cent+ | Dinar+ | Dirham | Dollar | Pound+ | Rial+ | Riyal | Unnamed -- e.g. bucks -- unambiguous | AED | AUD | BGN | BRL+ | BYN | EGP | EUR | GBP | HRK | IDR+ | ILS | INR+ | IQD+ | JOD | JPY | KRW | KWD | LBP+ | MAD | MYR | NOK | PTS | QAR | RON+ | RUB | SAR | SEK | SGD@@ -62,26 +72,36 @@ toJSON Cent = "cent" toJSON Dollar = "$" toJSON Pound = "\x00a3"+ toJSON Dinar = "dinar"+ toJSON Dirham = "dirham"+ toJSON Rial = "rial"+ toJSON Riyal = "riyal" toJSON Unnamed = "unknown" toJSON AED = "AED" toJSON AUD = "AUD" toJSON BGN = "BGN" toJSON BRL = "BRL"+ toJSON BYN = "BYN" toJSON EGP = "EGP" toJSON EUR = "EUR" toJSON GBP = "GBP" toJSON HRK = "HRK" toJSON IDR = "IDR"+ toJSON ILS = "ILS"+ toJSON IQD = "IQD" toJSON INR = "INR"+ toJSON JOD = "JOD" toJSON JPY = "JPY" toJSON KRW = "KRW" toJSON KWD = "KWD" toJSON LBP = "LBP"+ toJSON MAD = "MAD" toJSON MYR = "MYR" toJSON NOK = "NOK" toJSON PTS = "PTS" toJSON QAR = "QAR" toJSON RON = "RON"+ toJSON RUB = "RUB" toJSON SAR = "SAR" toJSON SEK = "SEK" toJSON SGD = "SGD"@@ -98,14 +118,18 @@ instance Resolve AmountOfMoneyData where type ResolvedValue AmountOfMoneyData = AmountOfMoneyValue- resolve _ AmountOfMoneyData {value = Nothing, minValue = Nothing, maxValue = Nothing} = Nothing+ resolve _ AmountOfMoneyData {value = Nothing, minValue = Nothing+ , maxValue = Nothing} = Nothing resolve _ AmountOfMoneyData {value = Just value, currency} = Just $ simple currency value- resolve _ AmountOfMoneyData {value = Nothing, currency = c, minValue = Just from, maxValue = Just to} =+ resolve _ AmountOfMoneyData {value = Nothing, currency = c+ , minValue = Just from, maxValue = Just to} = Just $ between c (from, to)- resolve _ AmountOfMoneyData {value = Nothing, currency = c, minValue = Just v, maxValue = Nothing} =+ resolve _ AmountOfMoneyData {value = Nothing, currency = c+ , minValue = Just v, maxValue = Nothing} = Just $ above c v- resolve _ AmountOfMoneyData {value = Nothing, currency = c, minValue = Nothing, maxValue = Just v} =+ resolve _ AmountOfMoneyData {value = Nothing, currency = c+ , minValue = Nothing, maxValue = Just v} = Just $ under c v data IntervalDirection = Above | Under
Duckling/AmountOfMoney/VI/Rules.hs view
@@ -10,19 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.VI.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.AmountOfMoney.Helpers import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))-import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (isNatural) import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.AmountOfMoney.Types as TAmountOfMoney+import qualified Duckling.Numeral.Types as TNumeral ruleNg :: Rule ruleNg = Rule@@ -73,12 +75,12 @@ ruleIntersect = Rule { name = "intersect" , pattern =- [ financeWith TAmountOfMoney.value isJust- , dimension Numeral+ [ Predicate isWithoutCents+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -87,14 +89,14 @@ ruleIntersectAndNumeral = Rule { name = "intersect and number" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "và"- , dimension Numeral+ , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token Numeral (NumeralData {TNumeral.value = c}):+ Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -103,12 +105,12 @@ ruleIntersectXXuxen = Rule { name = "intersect (X xu|xen)" , pattern =- [ financeWith TAmountOfMoney.value isJust- , financeWith TAmountOfMoney.currency (== Cent)+ [ Predicate isWithoutCents+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }@@ -117,14 +119,14 @@ ruleIntersectVXXuxen = Rule { name = "intersect (và X xu|xen)" , pattern =- [ financeWith TAmountOfMoney.value isJust+ [ Predicate isWithoutCents , regex "và"- , financeWith TAmountOfMoney.currency (== Cent)+ , Predicate isCents ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: _:- Token AmountOfMoney (AmountOfMoneyData {TAmountOfMoney.value = Just c}):+ Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
Duckling/Api.hs view
@@ -8,6 +8,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE NamedFieldPuns #-} module Duckling.Api ( analyze@@ -48,14 +49,15 @@ analyze :: Text -> Context -> HashSet (Some Dimension) -> [ResolvedToken] analyze input context@Context{..} targets = rank (classifiers locale) targets- . filter (\(Resolved{node = Node{token = (Token d _)}}) ->+ . filter (\Resolved{node = Node{token = (Token d _)}} -> HashSet.null targets || HashSet.member (This d) targets ) $ parseAndResolve (rulesFor locale targets) input context -- | Converts the resolved token to the API format formatToken :: Text -> ResolvedToken -> Entity-formatToken sentence (Resolved (Range start end) (Node{token=Token dimension _}) value) =- Entity (toName dimension) body value start end+formatToken sentence+ (Resolved (Range start end) node@Node{token = Token dimension _} value) =+ Entity (toName dimension) body value start end node where body = Text.drop start $ Text.take end sentence
Duckling/Core.hs view
@@ -15,6 +15,8 @@ , Region(..) , Dimension(..) , Entity(..)+ , Node(..)+ , Range(..) , Lang(..) , Locale , Some(..)
Duckling/Debug.hs view
@@ -45,20 +45,19 @@ fullParses :: Locale -> Text -> [Some Dimension] -> IO [Entity] fullParses l sentence targets = debugTokens sentence .- filter (\(Resolved {range = Range start end}) -> start == 0 && end == n) $+ filter (\Resolved{range = Range start end} -> start == 0 && end == n) $ parses l sentence targets where n = Text.length sentence -ptree :: Text -> ResolvedToken -> IO ()-ptree sentence Resolved {node} = pnode sentence 0 node-+ptree :: Text -> Entity -> IO ()+ptree sentence Entity {enode} = pnode sentence 0 enode -- ----------------------------------------------------------------- -- Internals parses :: Locale -> Text -> [Some Dimension] -> [ResolvedToken] parses l sentence targets = flip filter tokens $- \(Resolved {node = Node{token = (Token d _)}}) ->+ \Resolved{node = Node{token = (Token d _)}} -> case targets of [] -> True _ -> elem (This d) targets@@ -72,8 +71,9 @@ debugTokens :: Text -> [ResolvedToken] -> IO [Entity] debugTokens sentence tokens = do- mapM_ (ptree sentence) tokens- return $ map (formatToken sentence) tokens+ mapM_ (ptree sentence) entities+ return entities+ where entities = map (formatToken sentence) tokens pnode :: Text -> Int -> Node -> IO () pnode sentence depth Node {children, rule, nodeRange = Range start end} = do
Duckling/Dimensions.hs view
@@ -25,12 +25,14 @@ import qualified Duckling.Dimensions.CS as CSDimensions import qualified Duckling.Dimensions.DA as DADimensions import qualified Duckling.Dimensions.DE as DEDimensions+import qualified Duckling.Dimensions.EL as ELDimensions import qualified Duckling.Dimensions.EN as ENDimensions import qualified Duckling.Dimensions.ES as ESDimensions import qualified Duckling.Dimensions.ET as ETDimensions import qualified Duckling.Dimensions.FR as FRDimensions import qualified Duckling.Dimensions.GA as GADimensions import qualified Duckling.Dimensions.HE as HEDimensions+import qualified Duckling.Dimensions.HI as HIDimensions import qualified Duckling.Dimensions.HR as HRDimensions import qualified Duckling.Dimensions.HU as HUDimensions import qualified Duckling.Dimensions.ID as IDDimensions@@ -40,6 +42,7 @@ import qualified Duckling.Dimensions.KO as KODimensions import qualified Duckling.Dimensions.MY as MYDimensions import qualified Duckling.Dimensions.NB as NBDimensions+import qualified Duckling.Dimensions.NE as NEDimensions import qualified Duckling.Dimensions.NL as NLDimensions import qualified Duckling.Dimensions.PL as PLDimensions import qualified Duckling.Dimensions.PT as PTDimensions@@ -85,12 +88,14 @@ langDimensions CS = CSDimensions.allDimensions langDimensions DA = DADimensions.allDimensions langDimensions DE = DEDimensions.allDimensions+langDimensions EL = ELDimensions.allDimensions langDimensions EN = ENDimensions.allDimensions langDimensions ES = ESDimensions.allDimensions langDimensions ET = ETDimensions.allDimensions langDimensions FR = FRDimensions.allDimensions langDimensions GA = GADimensions.allDimensions langDimensions HE = HEDimensions.allDimensions+langDimensions HI = HIDimensions.allDimensions langDimensions HR = HRDimensions.allDimensions langDimensions HU = HUDimensions.allDimensions langDimensions ID = IDDimensions.allDimensions@@ -100,6 +105,7 @@ langDimensions KO = KODimensions.allDimensions langDimensions MY = MYDimensions.allDimensions langDimensions NB = NBDimensions.allDimensions+langDimensions NE = NEDimensions.allDimensions langDimensions NL = NLDimensions.allDimensions langDimensions PL = PLDimensions.allDimensions langDimensions PT = PTDimensions.allDimensions
Duckling/Dimensions/AR.hs view
@@ -14,6 +14,11 @@ allDimensions :: [Some Dimension] allDimensions =- [ This Numeral+ [ This Duration+ , This Numeral , This Ordinal+ , This Quantity+ , This Temperature+ , This Time+ , This Volume ]
Duckling/Dimensions/Common.hs view
@@ -14,8 +14,9 @@ allDimensions :: [Some Dimension] allDimensions =- [ This Email- , This AmountOfMoney+ [ This AmountOfMoney+ , This Email+ , This Numeral , This PhoneNumber , This Url ]
+ Duckling/Dimensions/EL.hs view
@@ -0,0 +1,21 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Dimensions.EL+ ( allDimensions+ ) where++import Duckling.Dimensions.Types++allDimensions :: [Some Dimension]+allDimensions =+ [ This Duration+ , This Numeral+ , This Ordinal+ , This Time+ ]
+ Duckling/Dimensions/HI.hs view
@@ -0,0 +1,19 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Dimensions.HI+ ( allDimensions+ ) where++import Duckling.Dimensions.Types++allDimensions :: [Some Dimension]+allDimensions =+ [ This Numeral+ , This Ordinal+ ]
Duckling/Dimensions/JA.hs view
@@ -18,5 +18,4 @@ , This Numeral , This Ordinal , This Temperature- , This Time ]
+ Duckling/Dimensions/NE.hs view
@@ -0,0 +1,18 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Dimensions.NE+ ( allDimensions+ ) where++import Duckling.Dimensions.Types++allDimensions :: [Some Dimension]+allDimensions =+ [ This Numeral+ ]
Duckling/Dimensions/NL.hs view
@@ -18,5 +18,6 @@ , This Duration , This Numeral , This Ordinal+ , This Time , This Volume ]
Duckling/Dimensions/RU.hs view
@@ -14,6 +14,10 @@ allDimensions :: [Some Dimension] allDimensions =- [ This Numeral+ [ This Distance+ , This Duration+ , This Numeral , This Ordinal+ , This Quantity+ , This Volume ]
Duckling/Dimensions/Types.hs view
@@ -6,7 +6,7 @@ -- of patent rights can be found in the PATENTS file in the same directory. -{-# LANGUAGE DeriveAnyClass #-}+ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-}
Duckling/Distance/CS/Corpus.hs view
@@ -25,36 +25,36 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilometry" , "3 km" , "3km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 mil" , "osm mil" ]- , examples (DistanceValue Metre 1)+ , examples (simple Metre 1) [ "1m" , "1 metr" ]- , examples (DistanceValue Metre 2)+ , examples (simple Metre 2) [ "2m" , "2 metry" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9 metrů" ]- , examples (DistanceValue Centimetre 1)+ , examples (simple Centimetre 1) [ "1cm" , "1 centimetr" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centimetry" ]- , examples (DistanceValue Centimetre 9)+ , examples (simple Centimetre 9) [ "9cm" , "9 centimetrů" ]
Duckling/Distance/EN/Corpus.hs view
@@ -22,29 +22,50 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilometers" , "3 km" , "3km" , "3k" , "3.0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 miles" , "eight mile" , "8 mi" ]- , examples (DistanceValue M 9)+ , examples (simple M 9) [ "9m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centimeters" ]- , examples (DistanceValue Inch 5)+ , examples (simple Inch 5) [ "5 in" , "5''" , "five inches" , "5\""+ ]+ , examples (simple Metre 1.87)+ [ "1.87 meters"+ ]+ , examples (between Kilometre (3, 5))+ [ "between 3 and 5 kilometers"+ , "from 3km to 5km"+ , "around 3-5 kilometers"+ , "about 3km-5km"+ , "3-5 kilometers"+ ]+ , examples (under Mile 3.5)+ [ "under 3.5 miles"+ , "less than 3.5mi"+ , "lower than three point five miles"+ ]+ , examples (above Inch 5)+ [ "more than five inches"+ , "at least 5''"+ , "over 5\""+ , "above 5 in" ] ]
Duckling/Distance/EN/Rules.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Distance.EN.Rules@@ -20,19 +21,22 @@ import Duckling.Dimensions.Types import Duckling.Distance.Helpers import Duckling.Distance.Types (DistanceData(..))-import qualified Duckling.Distance.Types as TDistance+import Duckling.Numeral.Helpers+import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Types+import qualified Duckling.Distance.Types as TDistance+import qualified Duckling.Numeral.Types as TNumeral ruleDistanceFeetInch :: Rule ruleDistanceFeetInch = Rule { name = "<distance|feet> <distance|inch>" , pattern =- [ unitDistance TDistance.Foot- , unitDistance TDistance.Inch+ [ Predicate $ isDistanceOfUnit TDistance.Foot+ , Predicate $ isDistanceOfUnit TDistance.Inch ]- , prod = \tokens -> case tokens of- (Token Distance DistanceData {TDistance.value = feet}:- Token Distance DistanceData {TDistance.value = inches}:+ , prod = \case+ (Token Distance DistanceData {TDistance.value = Just feet}:+ Token Distance DistanceData {TDistance.value = Just inches}: _) -> Just . Token Distance . withUnit TDistance.Inch . distance $ feet * 12 + inches _ -> Nothing@@ -42,30 +46,42 @@ ruleDistanceFeetAndInch = Rule { name = "<distance|feet> and <distance|inch>" , pattern =- [ unitDistance TDistance.Foot+ [ Predicate $ isDistanceOfUnit TDistance.Foot , regex "and"- , unitDistance TDistance.Inch+ , Predicate $ isDistanceOfUnit TDistance.Inch ]- , prod = \tokens -> case tokens of- (Token Distance DistanceData {TDistance.value = feet}:+ , prod = \case+ (Token Distance DistanceData {TDistance.value = Just feet}: _:- Token Distance DistanceData {TDistance.value = inches}:+ Token Distance DistanceData {TDistance.value = Just inches}: _) -> Just . Token Distance . withUnit TDistance.Inch . distance $ feet * 12 + inches _ -> Nothing } distances :: [(Text, String, TDistance.Unit)]-distances = [ ("<latent dist> km", "k(ilo)?m?(eter)?s?", TDistance.Kilometre)- , ("<latent dist> feet", "('|f(oo|ee)?ts?)", TDistance.Foot)- , ("<latent dist> inch", "(\"|''|in(ch(es)?)?)", TDistance.Inch)- , ("<latent dist> yard", "y(ar)?ds?", TDistance.Yard)- , ("<dist> meters", "meters?", TDistance.Metre)- , ("<dist> centimeters", "cm|centimeters?", TDistance.Centimetre)- , ("<dist> miles", "mi(le(s)?)?", TDistance.Mile)- , ("<dist> m (ambiguous miles or meters)", "m", TDistance.M)+distances = [ ("km", "k(ilo)?m?(eter)?s?", TDistance.Kilometre)+ , ("feet", "('|f(oo|ee)?ts?)", TDistance.Foot)+ , ("inch", "(\"|''|in(ch(es)?)?)", TDistance.Inch)+ , ("yard", "y(ar)?ds?", TDistance.Yard)+ , ("meters", "meters?", TDistance.Metre)+ , ("centimeters", "cm|centimeters?", TDistance.Centimetre)+ , ("miles", "mi(le(s)?)?", TDistance.Mile)+ , ("m (ambiguous miles or meters)", "m", TDistance.M) ] +rulePrecision :: Rule+rulePrecision = Rule+ { name = "about|exactly <dist>"+ , pattern =+ [ regex "exactly|precisely|about|approx(\\.|imately)?|close to| near( to)?|around|almost"+ , dimension Distance+ ]+ , prod = \case+ (_:token:_) -> Just token+ _ -> Nothing+ }+ ruleDistances :: [Rule] ruleDistances = map go distances where@@ -73,14 +89,120 @@ go (name, regexPattern, u) = Rule { name = name , pattern = [ dimension Distance, regex regexPattern ]- , prod = \tokens -> case tokens of+ , prod = \case (Token Distance dd:_) -> Just . Token Distance $ withUnit u dd _ -> Nothing } +ruleIntervalBetweenNumeral :: Rule+ruleIntervalBetweenNumeral = Rule+ { name = "between|from <numeral> to|and <dist>"+ , pattern =+ [ regex "between|from"+ , Predicate isPositive+ , regex "to|and"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (_:+ Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u}:+ _) | from < to ->+ Just . Token Distance . withInterval (from, to) $ unitOnly u+ _ -> Nothing+ }++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between|from <dist> to|and <dist>"+ , pattern =+ [ regex "between|from"+ , Predicate isSimpleDistance+ , regex "to|and"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (_:+ Token Distance DistanceData{TDistance.value = Just from, TDistance.unit = Just u1}:+ _:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u2}:+ _) | from < to && u1 == u2 ->+ Just . Token Distance . withInterval (from, to) $ unitOnly u1+ _ -> Nothing+ }++ruleIntervalNumeralDash :: Rule+ruleIntervalNumeralDash = Rule+ { name = "<numeral> - <dist>"+ , pattern =+ [ Predicate isPositive+ , regex "-"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u}:+ _) | from < to ->+ Just . Token Distance . withInterval (from, to) $ unitOnly u+ _ -> Nothing+ }++ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<dist> - <dist>"+ , pattern =+ [ Predicate isSimpleDistance+ , regex "-"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (Token Distance DistanceData{TDistance.value = Just from, TDistance.unit = Just u1}:+ _:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u2}:+ _) | from < to && u1 == u2 ->+ Just . Token Distance . withInterval (from, to) $ unitOnly u1+ _ -> Nothing+ }++ruleIntervalMax :: Rule+ruleIntervalMax = Rule+ { name = "under/less/lower/no more than <dist>"+ , pattern =+ [ regex "under|(less|lower|not? more) than"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (_:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u}:+ _) -> Just . Token Distance . withMax to $ unitOnly u+ _ -> Nothing+ }++ruleIntervalMin :: Rule+ruleIntervalMin = Rule+ { name = "over/above/at least/more than <dist>"+ , pattern =+ [ regex "over|above|at least|more than"+ , Predicate isSimpleDistance+ ]+ , prod = \case+ (_:+ Token Distance DistanceData{TDistance.value = Just to, TDistance.unit = Just u}:+ _) -> Just . Token Distance . withMin to $ unitOnly u+ _ -> Nothing+ }+ rules :: [Rule] rules = [ ruleDistanceFeetInch , ruleDistanceFeetAndInch- ]+ , ruleIntervalBetweenNumeral+ , ruleIntervalBetween+ , ruleIntervalMax+ , ruleIntervalMin+ , ruleIntervalNumeralDash+ , ruleIntervalDash+ , rulePrecision] ++ ruleDistances
Duckling/Distance/ES/Corpus.hs view
@@ -25,24 +25,24 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilómetros" , "3 kilometros" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 miles" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9 metros" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centímetros" ]
Duckling/Distance/FR/Corpus.hs view
@@ -24,24 +24,24 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilomètres" , "3 kilometres" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 miles" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9 metres" , "9m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centimetres" ]
Duckling/Distance/GA/Corpus.hs view
@@ -24,23 +24,23 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 ciliméadair" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3.0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 mhíle" , "8 míle" ]- , examples (DistanceValue M 9)+ , examples (simple M 9) [ "9m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 cheintiméadar" ]
Duckling/Distance/HR/Corpus.hs view
@@ -23,22 +23,22 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilometra" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 milja" ]- , examples (DistanceValue M 9)+ , examples (simple M 9) [ "9m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centimetra" ]
Duckling/Distance/Helpers.hs view
@@ -7,35 +7,65 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} module Duckling.Distance.Helpers ( distance- , unitDistance+ , isDistanceOfUnit+ , isSimpleDistance+ , unitOnly+ , withInterval+ , withMax+ , withMin , withUnit+ , withValue ) where - import Prelude import Duckling.Dimensions.Types import Duckling.Distance.Types (DistanceData(..))-import qualified Duckling.Distance.Types as TDistance import Duckling.Types+import qualified Duckling.Distance.Types as TDistance -- ----------------------------------------------------------------- -- Patterns -unitDistance :: TDistance.Unit -> PatternItem-unitDistance value = Predicate $ \x -> case x of- (Token Distance DistanceData {TDistance.unit = Just unit}) -> value == unit- _ -> False+isSimpleDistance :: Predicate+isSimpleDistance (Token Distance DistanceData {TDistance.value = Just _+ , TDistance.unit = Just _}) = True+isSimpleDistance _ = False +isDistanceOfUnit :: TDistance.Unit -> Predicate+isDistanceOfUnit unit (Token Distance DistanceData {TDistance.unit = Just u}) = unit == u+isDistanceOfUnit _ _ = False+ -- ----------------------------------------------------------------- -- Production distance :: Double -> DistanceData-distance x = DistanceData {TDistance.value = x, TDistance.unit = Nothing}+distance x = DistanceData {TDistance.value = Just x+ , TDistance.unit = Nothing+ , TDistance.minValue = Nothing+ , TDistance.maxValue = Nothing} +unitOnly :: TDistance.Unit -> DistanceData+unitOnly u = DistanceData {TDistance.unit = Just u+ , TDistance.value = Nothing+ , TDistance.minValue = Nothing+ , TDistance.maxValue = Nothing}+ withUnit :: TDistance.Unit -> DistanceData -> DistanceData-withUnit value dd = dd {TDistance.unit = Just value}+withUnit u dd = dd {TDistance.unit = Just u}++withValue :: Double -> DistanceData -> DistanceData+withValue value dd = dd {TDistance.value = Just value}++withInterval :: (Double, Double) -> DistanceData -> DistanceData+withInterval (from, to) dd = dd {TDistance.minValue = Just from+ , TDistance.maxValue = Just to}++withMin :: Double -> DistanceData -> DistanceData+withMin from dd = dd {TDistance.minValue = Just from}++withMax :: Double -> DistanceData -> DistanceData+withMax to dd = dd {TDistance.maxValue = Just to}
Duckling/Distance/KO/Corpus.hs view
@@ -24,28 +24,28 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 킬로미터" , "3 킬로" , "3 키로" , "3 km" , "3km" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3.0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 miles" , "8 마일" , "8 마일즈" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9미터" , "9메터" , "구메터" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 센치" , "이센치"
Duckling/Distance/NL/Corpus.hs view
@@ -24,25 +24,25 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilometer" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" , "3,0km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 mijl" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9 m" , "9 meter" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 cm" , "2 centimeter"
Duckling/Distance/PT/Corpus.hs view
@@ -24,24 +24,24 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilómetros" , "3 kilometros" , "3 km" , "3km" , "3k" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 milhas" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9 metros" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centímetros" ]
Duckling/Distance/RO/Corpus.hs view
@@ -24,24 +24,24 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 kilometri" , "3 km" , "3km" , "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 mile" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9m" , "9 m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2cm" , "2 centimetri" ]- , examples (DistanceValue Foot 10)+ , examples (simple Foot 10) [ "zece picioare" ] ]
+ Duckling/Distance/RU/Corpus.hs view
@@ -0,0 +1,66 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Distance.RU.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Distance.Types+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale RU Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (simple Kilometre 3)+ [ "3 километра"+ , "3 км"+ , "3км"+ , "3.0 км"+ ]+ , examples (simple Mile 8)+ [ "8 миль"+ , "восемь миль"+ ]+ , examples (simple Metre 1)+ [ "1 м",+ "1 метр",+ "один метр"+ ]+ , examples (simple Centimetre 2)+ [ "2см"+ , "2 сантиметра"+ ]+ , examples (simple Millimetre 4)+ [ "4мм"+ , "4 миллиметра"+ ]+ , examples (simple Inch 5)+ [ "5 дюймов"+ , "5''"+ , "пять дюймов"+ , "5\""+ ]+ , examples (simple Foot 35)+ [ "35 футов"+ , "35'"+ , "тридцать пять футов"+ ]+ , examples (simple Yard 47)+ [ "47 ярдов"+ , "сорок семь ярдов"+ ]+ ]
+ Duckling/Distance/RU/Rules.hs view
@@ -0,0 +1,50 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Distance.RU.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude++import Duckling.Dimensions.Types+import Duckling.Distance.Helpers+import Duckling.Distance.Types (DistanceData(..))+import Duckling.Types+import qualified Duckling.Distance.Types as TDistance++distances :: [(Text, String, TDistance.Unit)]+distances = [ ("<latent dist> km", "км|километр(а|ов)?", TDistance.Kilometre)+ , ("<latent dist> feet", "('|фут(а|ов)?)", TDistance.Foot)+ , ("<latent dist> inch", "(\"|''|дюйм(а|ов)?)", TDistance.Inch)+ , ("<latent dist> yard", "ярд(а|ов)?", TDistance.Yard)+ , ("<dist> meters", "м(етр(а|ов)?)?", TDistance.Metre)+ , ("<dist> centimeters", "см|сантиметр(а|ов)?", TDistance.Centimetre)+ , ("<dist> millimeters", "мм|миллиметр(а|ов)?", TDistance.Millimetre)+ , ("<dist> miles", "мил(я|и|ь)", TDistance.Mile)+ ]++ruleDistances :: [Rule]+ruleDistances = map go distances+ where+ go :: (Text, String, TDistance.Unit) -> Rule+ go (name, regexPattern, u) = Rule+ { name = name+ , pattern = [ dimension Distance, regex regexPattern ]+ , prod = \tokens -> case tokens of+ (Token Distance dd:_) -> Just . Token Distance $ withUnit u dd+ _ -> Nothing+ }++rules :: [Rule]+rules = ruleDistances
Duckling/Distance/TR/Corpus.hs view
@@ -24,26 +24,26 @@ allExamples :: [Example] allExamples = concat- [ examples (DistanceValue Kilometre 3)+ [ examples (simple Kilometre 3) [ "3 Kilometre" , "3 kilometre" , "3 km" , "3km" ]- , examples (DistanceValue Kilometre 3.0)+ , examples (simple Kilometre 3.0) [ "3,0 km" ]- , examples (DistanceValue Mile 8)+ , examples (simple Mile 8) [ "8 Mil" , "8 mil" ]- , examples (DistanceValue Metre 9)+ , examples (simple Metre 9) [ "9 Metre" , "9 metre" , "9 m" , "9m" ]- , examples (DistanceValue Centimetre 2)+ , examples (simple Centimetre 2) [ "2 Santimetre" , "2 santim" , "2 cm"
Duckling/Distance/Types.hs view
@@ -19,9 +19,10 @@ import Data.Aeson import Data.Hashable import Data.Text (Text)-import qualified Data.Text as Text import GHC.Generics import Prelude+import qualified Data.HashMap.Strict as H+import qualified Data.Text as Text import Duckling.Resolve (Resolve(..)) @@ -33,6 +34,7 @@ | M -- ambiguous between Mile and Metre | Metre | Mile+ | Millimetre | Yard deriving (Eq, Generic, Hashable, Ord, Show, NFData) @@ -40,26 +42,84 @@ toJSON = String . Text.toLower . Text.pack . show data DistanceData = DistanceData- { unit :: Maybe Unit- , value :: Double+ { unit :: Maybe Unit+ , value :: Maybe Double+ , minValue :: Maybe Double+ , maxValue :: Maybe Double } deriving (Eq, Generic, Hashable, Ord, Show, NFData) instance Resolve DistanceData where type ResolvedValue DistanceData = DistanceValue- resolve _ DistanceData {unit = Nothing} = Nothing- resolve _ DistanceData {unit = Just unit, value} =- Just DistanceValue {vValue = value, vUnit = unit}+ resolve _ DistanceData {unit = Just unit, value = Just val} =+ Just $ simple unit val+ resolve _ DistanceData {unit = Just unit, value = Nothing+ , minValue = Just from, maxValue = Just to} =+ Just $ between unit (from, to)+ resolve _ DistanceData {unit = Just unit, value = Nothing+ , minValue = Just from, maxValue = Nothing} =+ Just $ above unit from+ resolve _ DistanceData {unit = Just unit, value = Nothing+ , minValue = Nothing, maxValue = Just to} =+ Just $ under unit to+ resolve _ _ = Nothing -data DistanceValue = DistanceValue+data IntervalDirection = Above | Under+ deriving (Eq, Generic, Hashable, Ord, Show, NFData)++data SingleValue = SingleValue { vUnit :: Unit , vValue :: Double } deriving (Eq, Ord, Show) +instance ToJSON SingleValue where+ toJSON (SingleValue unit value) = object+ [ "value" .= value+ , "unit" .= unit+ ]++data DistanceValue+ = SimpleValue SingleValue+ | IntervalValue (SingleValue, SingleValue)+ | OpenIntervalValue (SingleValue, IntervalDirection)+ deriving (Eq, Ord, Show)+ instance ToJSON DistanceValue where- toJSON (DistanceValue unit value) = object- [ "type" .= ("value" :: Text)- , "value" .= value- , "unit" .= unit+ toJSON (SimpleValue value) = case toJSON value of+ Object o -> Object $ H.insert "type" (toJSON ("value" :: Text)) o+ _ -> Object H.empty+ toJSON (IntervalValue (from, to)) = object+ [ "type" .= ("interval" :: Text)+ , "from" .= toJSON from+ , "to" .= toJSON to ]+ toJSON (OpenIntervalValue (from, Above)) = object+ [ "type" .= ("interval" :: Text)+ , "from" .= toJSON from+ ]+ toJSON (OpenIntervalValue (to, Under)) = object+ [ "type" .= ("interval" :: Text)+ , "to" .= toJSON to+ ]++-- -----------------------------------------------------------------+-- Value helpers++simple :: Unit -> Double -> DistanceValue+simple u v = SimpleValue $ single u v++between :: Unit -> (Double, Double) -> DistanceValue+between u (from, to) = IntervalValue (single u from, single u to)++above :: Unit -> Double -> DistanceValue+above = openInterval Above++under :: Unit -> Double -> DistanceValue+under = openInterval Under++openInterval :: IntervalDirection -> Unit -> Double -> DistanceValue+openInterval direction u v = OpenIntervalValue (single u v, direction)++single :: Unit -> Double -> SingleValue+single u v = SingleValue {vUnit = u, vValue = v}
+ Duckling/Duration/AR/Corpus.hs view
@@ -0,0 +1,61 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.AR.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Duration.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types+import Duckling.TimeGrain.Types (Grain(..))++corpus :: Corpus+corpus = (testContext {locale = makeLocale AR Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (DurationData 1 Second)+ [ "ثانية"+ , "لحظة"+ ]+ , examples (DurationData 2 Minute)+ [ "دقيقتان"+ , "دقيقتين"+ ]+ , examples (DurationData 5 Hour)+ [ "خمسة ساعات"+ ]+ , examples (DurationData 30 Day)+ [ "30 يوم"+ ]+ , examples (DurationData 1 Week)+ [ "اسبوع"+ ]+ , examples (DurationData 7 Week)+ [ "سبع اسابيع"+ ]+ , examples (DurationData 1 Month)+ [ "شهر"+ ]+ , examples (DurationData 2 Month)+ [ "شهرين"+ ]+ , examples (DurationData 2 Year)+ [ "سنتين"+ , "سنتان"+ , "عامين"+ , "عامان"+ ]+ ]
+ Duckling/Duration/AR/Rules.hs view
@@ -0,0 +1,176 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.AR.Rules+ ( rules+ ) where++import Data.String+import Prelude+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers+import Duckling.Numeral.Helpers (parseInt, parseInteger)+import Duckling.Numeral.Types (NumeralData(..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.TimeGrain.Types as TG++ruleDurationQuarterOfAnHour :: Rule+ruleDurationQuarterOfAnHour = Rule+ { name = "quarter of an hour"+ , pattern =+ [ regex "(ربع ساعة)"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 15+ }++ruleDurationHalfAnHour :: Rule+ruleDurationHalfAnHour = Rule+ { name = "half an hour"+ , pattern =+ [ regex "(1/2\\s?ساع[ةه]?|نصف? ساع[ةه])"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 30+ }++ruleDurationThreeQuartersOfAnHour :: Rule+ruleDurationThreeQuartersOfAnHour = Rule+ { name = "three-quarters of an hour"+ , pattern =+ [ regex "(3/4\\s?(ال)?ساع[ةه]?|ثلاث[ةه]?(\\s|-)[أا]رباع (ال)?ساع[ةه])"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 45+ }++ruleNumeralQuotes :: Rule+ruleNumeralQuotes = Rule+ { name = "<integer> + '\""+ , pattern =+ [ Predicate isNatural+ , regex "(['\"])"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (x:_)):+ _) -> case x of+ "'" -> Just . Token Duration . duration TG.Minute $ floor v+ "\"" -> Just . Token Duration . duration TG.Second $ floor v+ _ -> Nothing+ _ -> Nothing+ }++ruleDurationDotNumeralHours :: Rule+ruleDurationDotNumeralHours = Rule+ { name = "number.number hours"+ , pattern =+ [ regex "(\\d+)\\.(\\d+) *ساع(ة|ات)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (h:m:_)):_) -> do+ hh <- parseInteger h+ mnum <- parseInteger m+ let mden = 10 ^ Text.length m+ Just . Token Duration $ minutesFromHourMixedFraction hh mnum mden+ _ -> Nothing+ }++ruleDurationAndHalfHour :: Rule+ruleDurationAndHalfHour = Rule+ { name = "<integer> and an half hour"+ , pattern =+ [ Predicate isNatural+ , regex "و ?نصف? ساع[ةه]"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:_) ->+ Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v+ _ -> Nothing+ }++ruleTwoSeconds :: Rule+ruleTwoSeconds = Rule+ { name = "two seconds"+ , pattern =+ [ regex "ثانيتين|ثانيتان|لحظتين|لحظتان"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Second 2+ }++ruleTwoMinutes :: Rule+ruleTwoMinutes = Rule+ { name = "two minutes"+ , pattern =+ [ regex "دقيقتين|دقيقتان"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 2+ }++ruleTwoHours :: Rule+ruleTwoHours = Rule+ { name = "two hours"+ , pattern =+ [ regex "ساعتين|ساعتان"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Hour 2+ }++ruleTwoYears :: Rule+ruleTwoYears = Rule+ { name = "dual years"+ , pattern =+ [ regex "سنتين|سنتان"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Year 2+ }++-- this rule handles TG.Day, TG.Week and TG.Month+ruleDualUnitofduration :: Rule+ruleDualUnitofduration = Rule+ { name = "dual <unit-of-duration>"+ , pattern =+ [ dimension TimeGrain+ , regex "(ان|ين)"+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:_) -> Just . Token Duration $ duration grain 2+ _ -> Nothing+ }++ruleSingleUnitofduration :: Rule+ruleSingleUnitofduration = Rule+ { name = "single <unit-of-duration>"+ , pattern =+ [ dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:_) -> Just . Token Duration $ duration grain 1+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleDurationQuarterOfAnHour+ , ruleDurationHalfAnHour+ , ruleDurationThreeQuartersOfAnHour+ , ruleDurationDotNumeralHours+ , ruleDurationAndHalfHour+ , ruleNumeralQuotes+ , ruleTwoSeconds+ , ruleTwoMinutes+ , ruleTwoHours+ , ruleTwoYears+ , ruleDualUnitofduration+ , ruleSingleUnitofduration+ ]
Duckling/Duration/DA/Rules.hs view
@@ -47,7 +47,7 @@ , regex "og (en )?halv timer?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }@@ -73,7 +73,7 @@ , regex "mere|mindre" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v _ -> Nothing
Duckling/Duration/DE/Rules.hs view
@@ -53,7 +53,7 @@ , dimension TimeGrain ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: _: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v@@ -83,7 +83,7 @@ , regex "ein ?halb stunden?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
+ Duckling/Duration/EL/Corpus.hs view
@@ -0,0 +1,143 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.EL.Corpus+ ( corpus+ , negativeCorpus+ ) where++import Prelude+import Data.String++import Duckling.Duration.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types+import Duckling.TimeGrain.Types (Grain(..))++context :: Context+context = testContext {locale = makeLocale EL Nothing}++corpus :: Corpus+corpus = (context, allExamples)++negativeCorpus :: NegativeCorpus+negativeCorpus = (context, examples)+ where+ examples =+ [ "για μήνες"+ , "και ημέρες"+ ]++allExamples :: [Example]+allExamples = concat+ [ examples (DurationData 1 Second)+ [ "ένα δευτερόλεπτο"+ , "ενός δευτερολέπτου"+ , "1 δεύτερο"+ , "1\""+ ]+ , examples (DurationData 30 Second)+ [ "30 δευτερόλεπτα"+ , "τριάντα δευτερολέπτων"+ , "μισό λεπτό"+ , "30\""+ ]+ , examples (DurationData 1 Minute)+ [ "ενός λεπτού"+ , "1 λεπτού"+ ]+ , examples (DurationData 2 Minute)+ [ "2 λεπτά"+ , "δίλεπτο"+ , "Δίλεπτο"+ , "δύο λεπτά"+ , "δυο λεπτά"+ , "2'"+ ]+ , examples (DurationData 15 Minute)+ [ "ένα τέταρτο"+ , "δεκαπέντε λεπτά"+ , "δεκαπεντάλεπτο"+ , "Δεκαπεντάλεπτο"+ , "15'"+ ]+ , examples (DurationData 30 Minute)+ [ "μισάωρο"+ , "τριάντα λεπτά"+ , "μισή ώρα"+ , "30'"+ ]+ , examples (DurationData 45 Minute)+ [ "τρία τέταρτα"+ , "σαρανταπεντάλεπτος"+ , "45'"+ ]+ , examples (DurationData 60 Minute)+ [ "60 λεπτά"+ , "εξηντάλεπτο"+ ]+ , examples (DurationData 90 Minute)+ [ "μια και μισή ώρα"+ , "περίπου μια και μισή ώρα"+ , "ακριβώς μια και μισή ώρα"+ , "μιάμιση ώρα"+ , "Μιάμιση ώρα"+ , "1,5 ώρα"+ ]+ , examples (DurationData 5 Hour)+ [ "πεντάωρο"+ , "Πεντάωρο"+ , "5 ώρες"+ ]+ , examples (DurationData 60 Hour)+ [ "δυόμισι μέρες"+ , "60 ώρες"+ , "εξήντα ώρες"+ ]+ , examples (DurationData 15 Day)+ [ "15 μέρες"+ , "δεκαπενθήμερο"+ ]+ , examples (DurationData 30 Day)+ [ "30 μέρες"+ ]+ , examples (DurationData 7 Week)+ [ "εφτά εβδομάδες"+ , "7 βδομάδες"+ ]+ , examples (DurationData 1 Month)+ [ "1 μήνας"+ , "ένα μήνα"+ ]+ , examples (DurationData 3 Quarter)+ [ "3 τρίμηνα"+ ]+ , examples (DurationData 18 Month)+ [ "18 μήνες"+ , "ενάμισης χρόνος"+ , "ένας και μισός χρόνος"+ , "ενάμισι έτος"+ , "ένα και μισό έτος"+ ]+ , examples (DurationData 2 Year)+ [ "δυο χρόνια"+ , "δύο έτη"+ , "διετία"+ , "διετής"+ , "δίχρονο"+ ]+ , examples (DurationData 35 Year)+ [ "τριανταπενταετής"+ , "τριανταπεντάχρονος"+ , "τριανταπενταετία"+ , "35 χρόνια"+ ]+ ]
+ Duckling/Duration/EL/Rules.hs view
@@ -0,0 +1,223 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.EL.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers+import Duckling.Duration.Types (DurationData (DurationData))+import Duckling.Numeral.Helpers (integer, numeralMapEL, parseInt, parseInteger)+import Duckling.Numeral.Types (NumeralData(..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.TimeGrain.Types as TG++timeGrainMap :: HashMap Text TG.Grain+timeGrainMap = HashMap.fromList+ [ ( "λεπτο" , TG.Minute )+ , ( "ωρο" , TG.Hour )+ , ( "μερο" , TG.Day )+ , ( "ήμερο" , TG.Day )+ , ( "μηνο" , TG.Month )+ , ( "ετία" , TG.Year )+ , ( "ετίας" , TG.Year )+ , ( "ετή" , TG.Year )+ , ( "ετέ" , TG.Year )+ , ( "χρονο" , TG.Year )+ ]++ruleDurationQuarterOfAnHour :: Rule+ruleDurationQuarterOfAnHour = Rule+ { name = "quarter of an hour"+ , pattern =+ [ regex "(1/4|[εέ]ν(α|ός)\\s+τ[εέ]τ[αά]ρτου?)(\\s*ω|\\s+(της\\s+)?ώρας)?"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 15+ }++ruleDurationHalfAnHour :: Rule+ruleDurationHalfAnHour = Rule+ { name = "half an hour"+ , pattern =+ [ regex "(1/2\\s?((της )?ώρας?|ω)|μισάωρου?)"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 30+ }++ruleDurationThreeQuartersOfAnHour :: Rule+ruleDurationThreeQuartersOfAnHour = Rule+ { name = "three quarters of an hour"+ , pattern =+ [ regex "(3/4|τρ[ιί](α|ών)\\s+τ[εέ]τ[αά]ρτ(α|ων))(\\s*ω|\\s+(της\\s+)?ώρας)?"+ ]+ , prod = \_ -> Just . Token Duration $ duration TG.Minute 45+ }++-- TODO: Single-word composition (#110)+ruleNumeralWithGrain :: Rule+ruleNumeralWithGrain = Rule+ { name = "<number><grain> (one word)"+ , pattern =+ [ regex $ "(δ[ιί]|τρ[ιί]|τετρ|πεν[θτ]|εξ|ε[πφ]τ|ο[κχ]τ|εννι|δεκ|"+ ++ "δεκαπεν[θτ]|εικοσ|εικοσιπεν[θτ]|τριαντ|τριανταπεν[θτ]|σαραντ|"+ ++ "σαρανταπεν[θτ]|πενηντ|πενηνταπεν[θτ]|εξηντ|ενενηντ)[αά]?"+ ++ "(λεπτο|ωρο|ή?μερο|μηνο|ετία?|ετ[ήέ]|χρονο)ς?υ?"+ ]+ , prod = \tokens -> case tokens of+ ( Token RegexMatch (GroupMatch (m:g:_)) : _ ) ->+ (Token Duration .) . duration+ <$> HashMap.lookup (Text.toLower g) timeGrainMap+ <*> HashMap.lookup (Text.toLower m) numeralMapEL+ _ -> Nothing+ }++ruleNumeralQuotes :: Rule+ruleNumeralQuotes = Rule+ { name = "<integer> + '\""+ , pattern =+ [ Predicate isNatural+ , regex "(['\"])"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (x:_)):+ _) -> case x of+ "'" -> Just . Token Duration . duration TG.Minute $ floor v+ "\"" -> Just . Token Duration . duration TG.Second $ floor v+ _ -> Nothing+ _ -> Nothing+ }++ruleDurationMoreNumeral :: Rule+ruleDurationMoreNumeral = Rule+ { name = "<integer> more <unit-of-duration>"+ , pattern =+ [ Predicate isNatural+ , regex "ακόμα|λιγότερ[οη]"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd:_:Token TimeGrain grain:_) ->+ Just . Token Duration . duration grain . floor $ TNumeral.value nd+ _ -> Nothing+ }++ruleDurationNumeralMore :: Rule+ruleDurationNumeralMore = Rule+ { name = "<integer> more <unit-of-duration>"+ , pattern =+ [ Predicate isNatural+ , dimension TimeGrain+ , regex "ακόμα|λιγότερ[οη]"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd:Token TimeGrain grain:_:_) ->+ Just . Token Duration . duration grain . floor $ TNumeral.value nd+ _ -> Nothing+ }++ruleDurationDotNumeralHours :: Rule+ruleDurationDotNumeralHours = Rule+ { name = "number.number hours"+ , pattern =+ [ regex "(\\d+),(\\d+)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (h:m:_)):Token TimeGrain TG.Hour:_) -> do+ hh <- parseInteger h+ mnum <- parseInteger m+ let mden = 10 ^ Text.length m+ Just . Token Duration $ minutesFromHourMixedFraction hh mnum mden+ _ -> Nothing+ }++ruleHalfDuration :: Rule+ruleHalfDuration = Rule+ { name = "half a <grain>"+ , pattern =+ [ regex "μισ[ήό]ς?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain g:_) -> Token Duration <$> timesOneAndAHalf g 0+ _ -> Nothing+ }++ruleDurationAndAHalf :: Rule+ruleDurationAndAHalf = Rule+ { name = "<integer> and a half <grain>"+ , pattern =+ [ Predicate isNatural+ , regex "και μισ[ήό]ς?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd:_:Token TimeGrain grain:_) ->+ timesOneAndAHalf grain (floor $ TNumeral.value nd) >>=+ Just . Token Duration+ _ -> Nothing+ }++ruleDurationAndAHalfOneWord :: Rule+ruleDurationAndAHalfOneWord = Rule+ { name = "<integer-and-half> <grain>"+ , pattern =+ [ regex $ "(μιά|ενά|δυό|τρεισή|τεσσερι?σή|πεντέ|εξί|ε[πφ]τά|ο[κχ]τώ|εννιά|"+ ++ "δεκά|εντεκά|δωδεκά)μισ[ιη]ς?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (num:_)):Token TimeGrain grain:_) ->+ HashMap.lookup (Text.toLower num) numeralMapEL >>=+ timesOneAndAHalf grain >>=+ Just . Token Duration+ _ -> Nothing+ }++ruleDurationPrecision :: Rule+ruleDurationPrecision = Rule+ { name = "about|exactly <duration>"+ , pattern =+ [ regex "(περίπου|πάνω κάτω|ακριβώς)"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleDurationQuarterOfAnHour+ , ruleDurationHalfAnHour+ , ruleNumeralQuotes+ , ruleDurationNumeralMore+ , ruleDurationMoreNumeral+ , ruleNumeralWithGrain+ , ruleDurationThreeQuartersOfAnHour+ , ruleDurationDotNumeralHours+ , ruleHalfDuration+ , ruleDurationAndAHalf+ , ruleDurationAndAHalfOneWord+ , ruleDurationPrecision+ ]
Duckling/Duration/EN/Rules.hs view
@@ -7,50 +7,59 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Duration.EN.Rules- ( rules ) where+ ( rules+ ) where -import Control.Monad (join)-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Duration.Helpers import Duckling.Numeral.Helpers (parseInt, parseInteger) import Duckling.Numeral.Types (NumeralData(..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types-import qualified Duckling.TimeGrain.Types as TG import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.TimeGrain.Types as TG ruleDurationQuarterOfAnHour :: Rule ruleDurationQuarterOfAnHour = Rule { name = "quarter of an hour"- , pattern = [ regex "(1/4\\s?h(our)?|(a\\s)?quarter of an hour)" ]+ , pattern =+ [ regex "(1/4\\s?h(our)?|(a\\s)?quarter of an hour)"+ ] , prod = \_ -> Just . Token Duration $ duration TG.Minute 15 } ruleDurationHalfAnHour :: Rule ruleDurationHalfAnHour = Rule { name = "half an hour"- , pattern = [regex "(1/2\\s?h(our)?|half an? hour)"]+ , pattern =+ [ regex "(1/2\\s?h(our)?|half an? hour)"+ ] , prod = \_ -> Just . Token Duration $ duration TG.Minute 30 } ruleDurationThreeQuartersOfAnHour :: Rule ruleDurationThreeQuartersOfAnHour = Rule { name = "three-quarters of an hour"- , pattern = [regex "(3/4\\s?h(our)?|three(\\s|-)quarters of an hour)"]+ , pattern =+ [ regex "(3/4\\s?h(our)?|three(\\s|-)quarters of an hour)"+ ] , prod = \_ -> Just . Token Duration $ duration TG.Minute 45 } ruleDurationFortnight :: Rule ruleDurationFortnight = Rule { name = "fortnight"- , pattern = [regex "(a|one)? fortnight"]+ , pattern =+ [ regex "(a|one)? fortnight"+ ] , prod = \_ -> Just . Token Duration $ duration TG.Day 14 } @@ -62,7 +71,7 @@ , regex "(['\"])" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (x:_)): _) -> case x of "'" -> Just . Token Duration . duration TG.Minute $ floor v@@ -88,7 +97,9 @@ ruleDurationDotNumeralHours :: Rule ruleDurationDotNumeralHours = Rule { name = "number.number hours"- , pattern = [regex "(\\d+)\\.(\\d+) *hours?"]+ , pattern =+ [ regex "(\\d+)\\.(\\d+) *hours?"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (h:m:_)):_) -> do hh <- parseInteger h@@ -106,7 +117,7 @@ , regex "and (an? )?half hours?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/FR/Rules.hs view
@@ -31,7 +31,7 @@ , regex "(['\"])" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (x:_)): _) -> case x of "'" -> Just . Token Duration . duration TG.Minute $ floor v
Duckling/Duration/GA/Corpus.hs view
@@ -12,8 +12,8 @@ ( corpus ) where -import Prelude import Data.String+import Prelude import Duckling.Duration.Types import Duckling.Locale@@ -35,6 +35,9 @@ , examples (DurationData 30 Minute) [ "leathuair" , "30 noimead"+ ]+ , examples (DurationData 27 Minute)+ [ "7 noimead 20" ] , examples (DurationData 14 Day) [ "coicís"
Duckling/Duration/GA/Rules.hs view
@@ -17,6 +17,7 @@ import Duckling.Dimensions.Types import Duckling.Duration.Helpers+import Duckling.Numeral.Helpers (numberWith) import Duckling.Numeral.Types (NumeralData(..)) import qualified Duckling.Numeral.Types as TNumeral import qualified Duckling.TimeGrain.Types as TG@@ -44,9 +45,9 @@ ruleAonDurationAmhain = Rule { name = "aon X amhain" , pattern =- [ isNumeralWith TNumeral.value (== 1)+ [ numberWith TNumeral.value (== 1) , dimension TimeGrain- , isNumeralWith TNumeral.value (== 1)+ , numberWith TNumeral.value (== 1) ] , prod = \tokens -> case tokens of (_:Token TimeGrain grain:_) -> Just . Token Duration $ duration grain 1@@ -57,14 +58,14 @@ ruleIntegerUnitofdurationInteger = Rule { name = "<unit-integer> <unit-of-duration> <tens-integer>" , pattern =- [ isNumeralWith TNumeral.value (< 10)+ [ numberWith TNumeral.value (< 10) , dimension TimeGrain- , isNumeralWith TNumeral.value (`elem` [10, 20 .. 50])+ , numberWith TNumeral.value (`elem` [10, 20 .. 50]) ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: Token TimeGrain grain:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> Just . Token Duration . duration grain . floor $ v1 + v2 _ -> Nothing }
Duckling/Duration/HE/Rules.hs view
@@ -80,7 +80,7 @@ , regex "וחצי (שעות|שעה)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/HR/Rules.hs view
@@ -49,7 +49,7 @@ , regex "i pol?a?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }@@ -63,7 +63,7 @@ , dimension TimeGrain ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: _: Token TimeGrain grain:_) -> Just . Token Duration . duration grain $ floor v
Duckling/Duration/HU/Rules.hs view
@@ -76,7 +76,7 @@ , regex "\x00E9s f\x00E9l[\\s-]?\x00F3ra" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/Helpers.hs view
@@ -7,25 +7,23 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} module Duckling.Duration.Helpers ( duration , isGrain , isNatural- , isNumeralWith , minutesFromHourMixedFraction+ , timesOneAndAHalf ) where import Prelude import Duckling.Dimensions.Types import Duckling.Duration.Types (DurationData (DurationData))+import Duckling.Numeral.Helpers (isNatural)+import Duckling.Types import qualified Duckling.Duration.Types as TDuration-import Duckling.Numeral.Types (NumeralData (NumeralData))-import qualified Duckling.Numeral.Types as TNumeral import qualified Duckling.TimeGrain.Types as TG-import Duckling.Types -- ----------------------------------------------------------------- -- Patterns@@ -34,16 +32,6 @@ isGrain value (Token TimeGrain grain) = grain == value isGrain _ _ = False -isNatural :: Predicate-isNatural (Token Numeral NumeralData {TNumeral.value = x}) =- TNumeral.isNatural x-isNatural _ = False--isNumeralWith :: (NumeralData -> t) -> (t -> Bool) -> PatternItem-isNumeralWith f pred = Predicate $ \x -> case x of- (Token Numeral x) -> pred $ f x- _ -> False- -- ----------------------------------------------------------------- -- Production @@ -53,3 +41,12 @@ minutesFromHourMixedFraction :: Integer -> Integer -> Integer -> DurationData minutesFromHourMixedFraction h n d = duration TG.Minute $ fromIntegral $ 60 * h + quot (n * 60) d++timesOneAndAHalf :: TG.Grain -> Int -> Maybe DurationData+timesOneAndAHalf grain = case grain of+ TG.Minute -> Just . duration TG.Second . (30+) . (60*)+ TG.Hour -> Just . duration TG.Minute . (30+) . (60*)+ TG.Day -> Just . duration TG.Hour . (12+) . (24*)+ TG.Month -> Just . duration TG.Day . (15+) . (30*)+ TG.Year -> Just . duration TG.Month . (6+) . (12*)+ _ -> const Nothing
Duckling/Duration/KO/Rules.hs view
@@ -69,7 +69,7 @@ , regex "시간반" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/NB/Rules.hs view
@@ -44,7 +44,7 @@ , regex "mere?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v _ -> Nothing@@ -73,7 +73,7 @@ , regex "og (en )?halv time?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/NL/Corpus.hs view
@@ -55,9 +55,21 @@ , "2 m" , "2'" ]+ , examples (DurationData 45 Minute)+ [ "3 kwartier"+ ]+ , examples (DurationData 1 Hour)+ [ "een uur"+ , "één uur"+ , "1 u"+ , "1 h"+ ] , examples (DurationData 30 Day) [ "30 dagen" ]+ , examples (DurationData 7 Day)+ [ "7 dagen"+ ] , examples (DurationData 7 Week) [ "zeven weken" , "7 w"@@ -68,7 +80,7 @@ , "één maand" ] , examples (DurationData 3 Quarter)- [ "drie kwartier"+ [ "drie kwartalen" ] , examples (DurationData 2 Year) [ "2 jaar"@@ -76,8 +88,8 @@ , "twee jaren" , "2 j" ]- , examples (DurationData 150 Minute)- [ "twee en een half uur"- , "2,5 uur"- ]+ , examples (DurationData 150 Minute)+ [ "twee en een half uur"+ , "2,5 uur"+ ] ]
Duckling/Duration/NL/Rules.hs view
@@ -29,10 +29,23 @@ ruleDurationQuarterOfAnHour :: Rule ruleDurationQuarterOfAnHour = Rule { name = "quarter of an hour"- , pattern = [ regex "1/4\\s?uur"]+ , pattern = [ regex "1/4\\s?(h|u(ur)?)|kwartier"] , prod = \_ -> Just . Token Duration $ duration TG.Minute 15 } +ruleDurationKwartier :: Rule+ruleDurationKwartier = Rule+ { name = "<integer> kwartier"+ , pattern =+ [ Predicate isNatural+ , regex "kwartier"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:_) ->+ Just . Token Duration . duration TG.Minute $ 15 * floor v+ _ -> Nothing+ }+ ruleDurationHalfAnHour :: Rule ruleDurationHalfAnHour = Rule { name = "half an hour"@@ -55,7 +68,7 @@ , regex "(['\"])" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (x:_)): _) -> case x of "'" -> Just . Token Duration . duration TG.Minute $ floor v@@ -85,7 +98,7 @@ , regex "en een half (uur|uren)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }@@ -105,6 +118,7 @@ rules :: [Rule] rules = [ ruleDurationQuarterOfAnHour+ , ruleDurationKwartier , ruleDurationHalfAnHour , ruleDurationThreeQuartersOfAnHour , ruleDurationDotNumeralHours
Duckling/Duration/PL/Rules.hs view
@@ -44,7 +44,7 @@ , dimension TimeGrain ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: _: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v@@ -75,7 +75,7 @@ , regex "i (p(o|ó)(l|ł)) godziny" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
+ Duckling/Duration/RU/Corpus.hs view
@@ -0,0 +1,96 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.RU.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Duration.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types+import Duckling.TimeGrain.Types (Grain(..))++corpus :: Corpus+corpus = (testContext {locale = makeLocale RU Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (DurationData 1 Second)+ [ "1 сек"+ , "1 секунда"+ , "секунда"+ , "1\""+ ]+ , examples (DurationData 15 Minute)+ [ "15 мин"+ , "пятнадцать минут"+ , "15'"+ ]+ , examples (DurationData 30 Minute)+ [ "30 минут"+ , "пол часа"+ , "полчаса"+ , "тридцать минут"+ ]+ , examples (DurationData 5400 Second)+ [ "полтора часа"+ , "1.5 часа"+ , "5400 секунд"+ ]+ , examples (DurationData 8 Hour)+ [ "8 часов"+ , "8 ч"+ , "восемь часов"+ ]+ , examples (DurationData 15 Day)+ [ "15 дней"+ , "пятнадцать дней"+ , "полмесяца"+ ]+ , examples (DurationData 7 Week)+ [ "7 недель"+ , "семь недель"+ ]+ , examples (DurationData 1 Month)+ [ "1 месяц"+ , "месяц"+ , "ровно месяц"+ ]+ , examples (DurationData 6 Month)+ [ "6 месяцев"+ , "шесть месяцев"+ , "полгода"+ , "пол года"+ ]+ , examples (DurationData 9072000 Second)+ [ "3.5 месяца"+ , "три с половиной месяца"+ , "приблизительно 3.5 месяца"+ ]+ , examples (DurationData 3 Quarter)+ [ "3 квартала"+ ]+ , examples (DurationData 2 Year)+ [ "2 года"+ , "два года"+ , "где-то два года"+ ]+ , examples (DurationData 12 Hour)+ [ "12 часов"+ , "двенадцать часов"+ , "полдня"+ , "примерно полдня"+ , "пол дня"+ ]+ ]
+ Duckling/Duration/RU/Rules.hs view
@@ -0,0 +1,118 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Duration.RU.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers+import Duckling.Numeral.Helpers (numberWith)+import Duckling.Numeral.Types (NumeralData(..), isInteger)+import Duckling.Duration.Types (DurationData (DurationData))+import Duckling.Regex.Types+import Duckling.Types+import Duckling.TimeGrain.Types+import qualified Duckling.Numeral.Types as TNumeral++grainsMap :: HashMap Text Grain+grainsMap = HashMap.fromList+ [ ("года" , Year)+ , ("месяца", Month)+ , ("дня" , Day)+ , ("часа" , Hour)+ , ("минуты", Minute)+ ]++-- TODO: Single-word composition (#110)+ruleHalves :: Rule+ruleHalves = Rule+ { name = "half of a grain"+ , pattern =+ [ regex "пол\\s?(года|месяца|дня|часа|минуты)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (x:_)):_) -> do+ grain <- HashMap.lookup (Text.toLower x) grainsMap+ Token Duration <$> timesOneAndAHalf grain 0+ _ -> Nothing+ }++ruleNumeralQuotes :: Rule+ruleNumeralQuotes = Rule+ { name = "<integer> + '\""+ , pattern =+ [ Predicate isNatural+ , regex "(['\"])"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (x:_)):+ _) -> case x of+ "'" -> Just . Token Duration . duration Minute $ floor v+ "\"" -> Just . Token Duration . duration Second $ floor v+ _ -> Nothing+ _ -> Nothing+ }++ruleDurationPrecision :: Rule+ruleDurationPrecision = Rule+ { name = "about|exactly <duration>"+ , pattern =+ [ regex "(где-то|приблизительно|примерно|ровно)"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleGrainAsDuration :: Rule+ruleGrainAsDuration = Rule+ { name = "a <unit-of-duration>"+ , pattern =+ [ dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:_) -> Just . Token Duration $ duration grain 1+ _ -> Nothing+ }++rulePositiveDuration :: Rule+rulePositiveDuration = Rule+ { name = "<positive-numeral> <time-grain>"+ , pattern =+ [ numberWith TNumeral.value $ and . sequence [not . isInteger, (>0)]+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token TimeGrain grain:+ _) -> Just . Token Duration . duration Second . floor $ inSeconds grain v+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ rulePositiveDuration+ , ruleDurationPrecision+ , ruleNumeralQuotes+ , ruleGrainAsDuration+ , ruleHalves+ ]
Duckling/Duration/Rules.hs view
@@ -13,14 +13,14 @@ ( rules ) where -import Prelude import Data.String+import Prelude import Duckling.Dimensions.Types import Duckling.Duration.Helpers import Duckling.Numeral.Types (NumeralData(..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleIntegerUnitofduration :: Rule ruleIntegerUnitofduration = Rule@@ -30,7 +30,7 @@ , dimension TimeGrain ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v _ -> Nothing
Duckling/Duration/SV/Corpus.hs view
@@ -44,5 +44,12 @@ , examples (DurationData 5 Year) [ "5 år" , "fem år"+ , "omkring fem år"+ , "ungefär fem år"+ , "runt fem år"+ , "cirka fem år"+ , "ca fem år"+ , "ca. fem år"+ , "c:a fem år" ] ]
Duckling/Duration/SV/Rules.hs view
@@ -10,21 +10,22 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Duration.SV.Rules- ( rules ) where+ ( rules+ ) where import Control.Monad (join)-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Duration.Helpers import Duckling.Numeral.Helpers (parseInteger) import Duckling.Numeral.Types (NumeralData(..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types-import qualified Duckling.TimeGrain.Types as TG import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.TimeGrain.Types as TG ruleHalfAnHour :: Rule ruleHalfAnHour = Rule@@ -44,7 +45,7 @@ , regex "fler|mer" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token TimeGrain grain: _) -> Just . Token Duration . duration grain $ floor v _ -> Nothing@@ -74,7 +75,7 @@ , regex "och (en )?halv timme?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }@@ -96,7 +97,7 @@ ruleAboutDuration = Rule { name = "about <duration>" , pattern =- [ regex "(omkring|cirka|ca.|ca|runt)"+ [ regex "(omkring|cirka|ca\\.?|c:a|runt|ungefär)" , dimension Duration ] , prod = \tokens -> case tokens of
Duckling/Duration/TR/Rules.hs view
@@ -63,7 +63,7 @@ , regex "(['\"])" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (x:_)): _) -> case x of "'" -> Just . Token Duration . duration TG.Minute $ floor v@@ -93,7 +93,7 @@ , regex "buçeuk sa(at)?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . Token Duration . duration TG.Minute $ 30 + 60 * floor v _ -> Nothing }
Duckling/Duration/Types.hs view
@@ -38,7 +38,8 @@ instance ToJSON DurationData where toJSON DurationData {value, grain} = object- [ "value" .= value+ [ "type" .= ("value" :: Text)+ , "value" .= value , "unit" .= grain , showt grain .= value , "normalized" .= object
Duckling/Email/EN/Corpus.hs view
@@ -15,6 +15,7 @@ import Data.String import Prelude+import qualified Data.Text as Text import Duckling.Email.Types import Duckling.Testing.Types@@ -26,6 +27,11 @@ [ "fitness at 6.40" , "class at 12.00" , "tonight at 9.15"+ , " dot 2@abci"+ , "x@ dot x"+ , "x@ x dot "+ , "abc@x dot "+ , Text.replicate 10000 "a at a" ] corpus :: Corpus@@ -44,5 +50,11 @@ ] , examples (EmailData "jean-jacques@stuff.co.uk") [ "jean-jacques at stuff.co.uk"+ ]+ , examples (EmailData "asdf+ab.c@gmail.com")+ [ "asdf+ab dot c at gmail dot com"+ ]+ , examples (EmailData "asdf.k@fb.com")+ [ "asdf dot k@fb dot com" ] ]
Duckling/Email/EN/Rules.hs view
@@ -26,11 +26,13 @@ ruleEmailSpelledOut = Rule { name = "email spelled out" , pattern =- [ regex "([\\w\\._+-]+) at ([\\w_-]+(\\.[a-zA-Z]+)+)"+ [ regex "([\\w_+-]+(?:(?: dot |\\.)[\\w_+-]+){0,10})(?: at |@)([a-zA-Z]+(?:(?:\\.| dot )[\\w_-]+){1,10})" ] , prod = \xs -> case xs of (Token RegexMatch (GroupMatch (m1:m2:_)):_) ->- Just $ Token Email EmailData {TEmail.value = Text.concat [m1, "@", m2]}+ Just $ Token Email EmailData+ { TEmail.value = Text.concat [replaceDots m1, "@", replaceDots m2] }+ where replaceDots = Text.replace " dot " "." _ -> Nothing }
Duckling/Engine.hs view
@@ -9,8 +9,8 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE NoRebindableSyntax #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Engine ( parseAndResolve , lookupRegexAnywhere@@ -129,7 +129,7 @@ return $ filter (p . token) $ Stash.toPosOrderedList stash isPositionValid :: Int -> Document -> Node -> Bool-isPositionValid position sentence (Node {nodeRange = Range start _}) =+isPositionValid position sentence Node{nodeRange = Range start _} = Document.isAdjacent sentence position start -- | A match is full if its rule pattern is empty.@@ -153,7 +153,7 @@ -- resuming from a Match position matchFirst :: Document -> Stash -> Match -> Duckling [Match] matchFirst _ _ (Rule {pattern = []}, _, _) = return []-matchFirst sentence stash (rule@(Rule {pattern = p:ps}), position, route) =+matchFirst sentence stash (rule@Rule{pattern = p : ps}, position, route) = map (mkMatch route newRule) <$> lookupItem sentence p stash position where newRule = rule { pattern = ps }@@ -162,7 +162,7 @@ -- starting anywhere matchFirstAnywhere :: Document -> Stash -> Rule -> Duckling [Match] matchFirstAnywhere _sentence _stash Rule {pattern = []} = return []-matchFirstAnywhere sentence stash rule@(Rule {pattern = p:ps}) =+matchFirstAnywhere sentence stash rule@Rule{pattern = p : ps} = map (mkMatch [] newRule) <$> lookupItemAnywhere sentence p stash where newRule = rule { pattern = ps }@@ -216,7 +216,7 @@ saturateParseString headPredicateRules sentence new new partialMatches where headPredicateRules =- [ rule | rule@(Rule {pattern = (Predicate _:_)}) <- rules ]+ [ rule | rule@Rule{pattern = (Predicate _ : _)} <- rules ] resolveNode :: Context -> Node -> Maybe ResolvedToken resolveNode context n@Node{token = (Token _ dd), nodeRange = nodeRange} = do
Duckling/Locale.hs view
@@ -36,12 +36,14 @@ | CS | DA | DE+ | EL | EN | ES | ET | FR | GA | HE+ | HI | HR | HU | ID@@ -51,6 +53,7 @@ | KO | MY | NB+ | NE | NL | PL | PT@@ -69,13 +72,22 @@ -- | ISO 3166-1 alpha-2 Country code (includes regions and territories). -- See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 data Region- = CA+ = AU+ | BZ+ | CA | CN | GB | HK+ | IE+ | IN+ | JM | MO+ | NZ+ | PH+ | TT | TW | US+ | ZA deriving (Bounded, Enum, Eq, Generic, Hashable, Ord, Read, Show) instance TextShow Region where@@ -101,6 +113,6 @@ allLocales :: HashMap Lang (HashSet Region) allLocales = HashMap.fromList- [ (EN, HashSet.fromList [CA, GB, US])+ [ (EN, HashSet.fromList [AU, BZ, CA, GB, IN, IE, JM, NZ, PH, ZA, TT, US]) , (ZH, HashSet.fromList [CN, HK, MO, TW]) ]
Duckling/Numeral/AR/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.AR.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -36,20 +37,24 @@ [ "4" , "أربعة" , "أربع"+ , "اربعه" ] , examples (NumeralValue 6) [ "6" , "ستة" , "ست"+ , "سته" ]- , examples (NumeralValue 33)- [ "33"- , "ثلاث و ثلاثون"+ , examples (NumeralValue 10)+ [ "10"+ , "عشرة"+ , "عشره" ] , examples (NumeralValue 11) [ "11" , "إحدى عشرة" , "إحدى عشر"+ , "احد عشر" ] , examples (NumeralValue 12) [ "12"@@ -72,9 +77,9 @@ [ "18" , "ثمان عشرة" ]- , examples (NumeralValue 525)- [ "خمسمائة و خمسة و عشرون"- , "525"+ , examples (NumeralValue 20)+ [ "عشرون"+ , "عشرين" ] , examples (NumeralValue 21) [ "واحدة و عشرون"@@ -87,6 +92,42 @@ , examples (NumeralValue 26) [ "ستة و عشرون" , "26"+ ]+ , examples (NumeralValue 20)+ [ "عشرون"+ , "عشرين"+ ]+ , examples (NumeralValue 30)+ [ "ثلاثون"+ , "ثلاثين"+ ]+ , examples (NumeralValue 33)+ [ "33"+ , "ثلاث و ثلاثون"+ ]+ , examples (NumeralValue 40)+ [ "اربعون"+ , "أربعين"+ ]+ , examples (NumeralValue 200)+ [ "مائتين"+ , "مائتان"+ ]+ , examples (NumeralValue 300)+ [ "ثلاثمائة"+ ]+ , examples (NumeralValue 350)+ [ "ثلاثمائة وخمسين"+ ]+ , examples (NumeralValue 500)+ [ "خمسمائة"+ ]+ , examples (NumeralValue 525)+ [ "خمسمائة و خمسة و عشرون"+ , "525"+ ]+ , examples (NumeralValue 700)+ [ "سبعمائة" ] , examples (NumeralValue 1.1) [ "1.1"
Duckling/Numeral/AR/Rules.hs view
@@ -10,25 +10,29 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.AR.Rules- ( rules ) where+ ( rules+ ) where +import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleInteger5 :: Rule ruleInteger5 = Rule { name = "integer 4" , pattern =- [ regex "(أربع(ة)?)"+ [ regex "([أا]ربع[ةه]?)" ] , prod = \_ -> integer 4 }@@ -42,9 +46,9 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -53,44 +57,45 @@ ruleInteger18 = Rule { name = "integer 12" , pattern =- [ regex "(إثن(ت)?ى عشر)"+ [ regex "([إا]?ثن(ت)?[يىا] ?عشر[ةه]?)" ] , prod = \_ -> integer 12 } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }+digitsMap :: HashMap Text Integer+digitsMap = HashMap.fromList+ [ ("عشر", 2)+ , ("ثلاث", 3)+ , ("اربع", 4)+ , ("أربع", 4)+ , ("خمس", 5)+ , ("ست", 6)+ , ("سبع", 7)+ , ("ثمان", 8)+ , ("تسع", 9)+ ] ruleInteger19 :: Rule ruleInteger19 = Rule { name = "integer (20..90)" , pattern =- [ regex "(عشرون|ثلاثون|أربعون|خمسون|ستون|سبعون|ثمانون|تسعون)"+ [ regex "(عشر|ثلاث|[أا]ربع|خمس|ست|سبع|ثمان|تسع)(ون|ين)" ] , prod = \tokens -> case tokens of- Token RegexMatch (GroupMatch (match:_)):_ -> case match of- "عشرون" -> integer 20- "ثلاثون" -> integer 30- "أربعون" -> integer 40- "خمسون" -> integer 50- "ستون" -> integer 60- "سبعون" -> integer 70- "ثمانون" -> integer 80- "تسعون" -> integer 90- _ -> Nothing+ Token RegexMatch (GroupMatch (match:_)):_ ->+ (* 10) <$> HashMap.lookup match digitsMap >>= integer _ -> Nothing } +ruleInteger200 :: Rule+ruleInteger200 = Rule+ { name = "integer (200)"+ , pattern =+ [ regex "مائتان|مائتين"+ ]+ , prod = const $ integer 200+ }+ ruleInteger22 :: Rule ruleInteger22 = Rule { name = "integer 21..99"@@ -100,9 +105,9 @@ , oneOf [20, 30 .. 90] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -115,7 +120,7 @@ , numberWith TNumeral.value (== 10) ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 10+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 10 _ -> Nothing } @@ -127,7 +132,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -147,7 +152,7 @@ ruleInteger15 = Rule { name = "integer 11" , pattern =- [ regex "(إحدى عشر(ة)?)"+ [ regex "([إاأ]حد[يى]? عشر[ةه]?)" ] , prod = \_ -> integer 11 }@@ -168,16 +173,24 @@ rulePowersOfTen = Rule { name = "powers of tens" , pattern =- [ regex "(مائة|مئات|ألف|الف|آلاف|ملايي(ن)?)"+ [ regex "(ما?[ئي][ةه]|مئات|[أا]لف|ال??|[آا]لاف|ملايين)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of+ "مئة" ->+ double 1e2 >>= withGrain 2 >>= withMultipliable+ "مئه" ->+ double 1e2 >>= withGrain 2 >>= withMultipliable "مائة" -> double 1e2 >>= withGrain 2 >>= withMultipliable+ "مائه" ->+ double 1e2 >>= withGrain 2 >>= withMultipliable "مئات" -> double 1e2 >>= withGrain 2 >>= withMultipliable "ألف" -> double 1e3 >>= withGrain 3 >>= withMultipliable "الف" -> double 1e3 >>= withGrain 3 >>= withMultipliable+ "الاف" ->+ double 1e3 >>= withGrain 3 >>= withMultipliable "آلاف" -> double 1e3 >>= withGrain 3 >>= withMultipliable "ملايي" ->@@ -192,7 +205,7 @@ ruleInteger3 = Rule { name = "integer 2" , pattern =- [ regex "(اثنان|اثنين)"+ [ regex "[إا]ثنت?[اي]ن" ] , prod = \_ -> integer 2 }@@ -201,7 +214,7 @@ ruleInteger13 = Rule { name = "integer 9" , pattern =- [ regex "(تسعة|تسع)"+ [ regex "تسع[ةه]?" ] , prod = \_ -> integer 9 }@@ -210,7 +223,7 @@ ruleInteger12 = Rule { name = "integer 8" , pattern =- [ regex "(ثمانية|ثمان)"+ [ regex "ثما??ني?[ةه]?" ] , prod = \_ -> integer 8 }@@ -223,7 +236,7 @@ , dimension Numeral ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double (v * (- 1)) _ -> Nothing }@@ -232,7 +245,7 @@ ruleInteger7 = Rule { name = "integer 5" , pattern =- [ regex "(خمس)(ة)?"+ [ regex "خمس[ةه]?" ] , prod = \_ -> integer 5 }@@ -241,7 +254,7 @@ ruleInteger14 = Rule { name = "integer 10" , pattern =- [ regex "(عشرة|عشر)"+ [ regex "عشر[ةه]?" ] , prod = \_ -> integer 10 }@@ -250,7 +263,7 @@ ruleInteger9 = Rule { name = "integer 6" , pattern =- [ regex "(ست(ة)?)"+ [ regex "ست[ةه]?" ] , prod = \_ -> integer 6 }@@ -259,7 +272,7 @@ ruleInteger = Rule { name = "integer 0" , pattern =- [ regex "(صفر)"+ [ regex "صفر" ] , prod = \_ -> integer 0 }@@ -268,7 +281,7 @@ ruleInteger4 = Rule { name = "integer 3" , pattern =- [ regex "(ثلاث|ثلاثة)"+ [ regex "(ثلاث[ةه]?)" ] , prod = \_ -> integer 3 }@@ -277,7 +290,7 @@ ruleInteger2 = Rule { name = "integer 1" , pattern =- [ regex "(واحدة|واحده|واحد)"+ [ regex "واحد[ةه]?" ] , prod = \_ -> integer 1 }@@ -286,44 +299,23 @@ ruleInteger11 = Rule { name = "integer 7" , pattern =- [ regex "(سبعة|سبع)"+ [ regex "سبع[ةه]?" ] , prod = \_ -> integer 7 } -ruleInteger20 :: Rule-ruleInteger20 = Rule- { name = "integer (100..900)"- , pattern =- [ regex "(مائة|مائتان|ثلاثمائة|أربعمائة|خمسمائة|ستمائة|سبعمائة|ثمانمائة|تسعمائة)"- ]- , prod = \tokens -> case tokens of- Token RegexMatch (GroupMatch (match:_)):_ -> case match of- "مائة" -> integer 100- "سبعمائة" -> integer 700- "خمسمائة" -> integer 500- "أربعمائة" -> integer 400- "ستمائة" -> integer 600- "مائتان" -> integer 200- "ثلاثمائة" -> integer 300- "ثمانمائة" -> integer 800- "تسعمائة" -> integer 900- _ -> Nothing- _ -> Nothing- }- ruleNumeralDotNumeral :: Rule ruleNumeralDotNumeral = Rule { name = "number dot number" , pattern = [ dimension Numeral- , regex "فاصلة"+ , regex "فاصل[ةه]" , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -336,7 +328,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -353,7 +345,6 @@ , ruleInteger18 , ruleInteger19 , ruleInteger2- , ruleInteger20 , ruleInteger21 , ruleInteger22 , ruleInteger23@@ -362,10 +353,10 @@ , ruleInteger5 , ruleInteger7 , ruleInteger9- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleMultiply , ruleNumeralDotNumeral , ruleNumeralsPrefixWithMinus , rulePowersOfTen+ , ruleInteger200 ]
Duckling/Numeral/BG/Rules.hs view
@@ -11,7 +11,8 @@ {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Numeral.BG.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap) import Data.Maybe@@ -28,19 +29,6 @@ import Duckling.Types import qualified Duckling.Numeral.Types as TNumeral -ruleIntegers :: Rule-ruleIntegers = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- zeroNineteenMap :: HashMap Text Integer zeroNineteenMap = HashMap.fromList [ ( "нула", 0 )@@ -128,9 +116,9 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = tens}):+ (Token Numeral NumeralData{TNumeral.value = tens}: _:- Token Numeral (NumeralData {TNumeral.value = units}):+ Token Numeral NumeralData{TNumeral.value = units}: _) -> double $ tens + units _ -> Nothing }@@ -164,8 +152,8 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = hundreds}):- Token Numeral (NumeralData {TNumeral.value = tens}):+ (Token Numeral NumeralData{TNumeral.value = hundreds}:+ Token Numeral NumeralData{TNumeral.value = tens}: _) -> double $ hundreds + tens _ -> Nothing }@@ -195,20 +183,6 @@ _ -> Nothing } -ruleFractions :: Rule-ruleFractions = Rule- { name = "fractional number"- , pattern =- [ regex "(\\d+)/(\\d+)"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (numerator:denominator:_)):_) -> do- n <- parseDecimal False numerator- d <- parseDecimal False denominator- divide n d- _ -> Nothing- }- ruleCommas :: Rule ruleCommas = Rule { name = "comma-separated numbers"@@ -217,7 +191,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -257,8 +231,7 @@ rules :: [Rule] rules =- [ ruleIntegers- , ruleToNineteen+ [ ruleToNineteen , ruleTens , rulePowersOfTen , ruleCompositeTens@@ -266,7 +239,6 @@ , ruleCompositeHundreds , ruleDotSpelledOut , ruleDecimals- , ruleFractions , ruleCommas , ruleSuffixes , ruleNegative
Duckling/Numeral/CS/Rules.hs view
@@ -10,7 +10,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.CS.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap) import Data.Maybe@@ -27,20 +28,6 @@ import Duckling.Types import qualified Duckling.Numeral.Types as TNumeral -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleNumeralMap :: HashMap Text Integer ruleNumeralMap = HashMap.fromList [ ( "nula", 0 )@@ -73,6 +60,5 @@ rules :: [Rule] rules =- [ ruleIntegerNumeric- , ruleNumeral+ [ ruleNumeral ]
Duckling/Numeral/DA/Rules.hs view
@@ -10,49 +10,37 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.DA.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|minus\\s?|negativ\\s?"- , dimension Numeral+ [ regex "-|minus|negativ"+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * (-1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -79,7 +67,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -103,8 +91,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -123,11 +111,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , dimension Numeral+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -140,7 +128,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -186,9 +174,9 @@ , oneOf [70, 20, 60, 50, 40, 90, 30, 80] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -207,7 +195,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -284,9 +272,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -299,7 +287,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -313,7 +301,6 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleMultiply
Duckling/Numeral/DE/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.DE.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -27,6 +28,8 @@ [ examples (NumeralValue 0) [ "0" , "null"+ , "keiner"+ , "keinen" ] , examples (NumeralValue 1) [ "1"@@ -35,6 +38,12 @@ , examples (NumeralValue 3) [ "3" , "Drei"+ ]+ , examples (NumeralValue 8)+ [ "acht"+ ]+ , examples (NumeralValue 18)+ [ "achtzehn" ] , examples (NumeralValue 30) [ "30"
Duckling/Numeral/DE/Rules.hs view
@@ -7,53 +7,41 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.DE.Rules- ( rules ) where+ ( rules+ ) where -import Control.Monad (join) import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe import Data.Text (Text)-import qualified Data.Text as Text import Prelude import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|minus|negativ"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * (- 1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -79,10 +67,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -99,6 +85,7 @@ _ -> Nothing } +-- TODO: Single-word composition (#110) ruleInteger3 :: Rule ruleInteger3 = Rule { name = "integer ([2-9][1-9])"@@ -141,9 +128,9 @@ , oneOf [20, 30 .. 90] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -153,7 +140,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -165,11 +152,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , dimension Numeral+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -182,7 +169,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -263,60 +250,32 @@ , ("neunzehn", 19) ] -ruleToNineteen :: Rule-ruleToNineteen = Rule+-- TODO: Single-word composition (#110)+ruleZeroToNineteen :: Rule+ruleZeroToNineteen = Rule { name = "integer (0..19)"- -- e.g. fourteen must be before four,- -- otherwise four will always shadow fourteen- , pattern = [regex "(keine?|keine?s|keiner|keinen|null|nichts|eins?(er)?|zwei|dreizehn|drei|vierzehn|vier|fünf|sechzehn|sechs|siebzehn|sieben|achtzehn|acht|neunzehn|neun|elf|zwölf|füfzehn)"]+ , pattern =+ [ regex "(keine[rn]|keine?s?|null|nichts|eins?(er)?|zwei|dreizehn|drei|vierzehn|vier|fünf|sechzehn|sechs|siebzehn|sieben|achtzehn|acht|neunzehn|neun|elf|zwölf|füfzehn)"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> HashMap.lookup (Text.toLower match) zeroNineteenMap >>= integer _ -> Nothing } -ruleInteger :: Rule-ruleInteger = Rule- { name = "integer (0..19)"- , pattern =- [ regex "(keine?|keine?s|keiner|keinen|null|nichts|eins?(er)?|zwei|dreizehn|drei|vierzehn|vier|fünf|sechzehn|sechs|siebzehn|sieben|achtzehn|acht|neunzehn|neun|elf|zwölf|füfzehn)"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "nichts" -> integer 0- "keine" -> integer 0- "null" -> integer 0- "keiner" -> integer 0- "kein" -> integer 0- "keins" -> integer 0- "keinen" -> integer 0- "keines" -> integer 0- "einer" -> integer 1- "eins" -> integer 1- "ein" -> integer 1- "eine" -> integer 1- "zwei" -> integer 2- "drei" -> integer 3- "vier" -> integer 4- "fünf" -> integer 5- "sechs" -> integer 6- "sieben" -> integer 7- "acht" -> integer 8- "neun" -> integer 9- "zehn" -> integer 10- "elf" -> integer 11- "zwölf" -> integer 12- "dreizehn" -> integer 13- "vierzehn" -> integer 14- "fünfzehn" -> integer 15- "sechzehn" -> integer 16- "siebzehn" -> integer 17- "achtzehn" -> integer 18- "neunzehn" -> integer 19- _ -> Nothing- _ -> Nothing- }+tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ( "zwanzig" , 20 )+ , ( "dreissig", 30 )+ , ( "vierzig" , 40 )+ , ( "fünfzig" , 50 )+ , ( "sechzig" , 60 )+ , ( "siebzig" , 70 )+ , ( "achtzig" , 80 )+ , ( "neunzig" , 90 )+ ] +-- TODO: Single-word composition (#110) ruleInteger2 :: Rule ruleInteger2 = Rule { name = "integer (20..90)"@@ -324,16 +283,8 @@ [ regex "(zwanzig|dreissig|vierzig|fünfzig|sechzig|siebzig|achtzig|neunzig)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "zwanzig" -> integer 20- "dreissig" -> integer 30- "vierzig" -> integer 40- "fünfzig" -> integer 50- "sechzig" -> integer 60- "siebzig" -> integer 70- "achtzig" -> integer 80- "neunzig" -> integer 90- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } @@ -346,9 +297,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -361,7 +312,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -372,10 +323,8 @@ , ruleDecimalWithThousandsSeparator , ruleDozen , ruleFew- , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleMultiply@@ -385,5 +334,5 @@ , ruleNumeralsUnd , rulePowersOfTen , ruleTen- , ruleToNineteen+ , ruleZeroToNineteen ]
+ Duckling/Numeral/EL/Corpus.hs view
@@ -0,0 +1,151 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Numeral.EL.Corpus+ ( corpus ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Numeral.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale EL Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (NumeralValue 0)+ [ "0"+ , "μηδέν"+ ]+ , examples (NumeralValue 1)+ [ "1"+ , "ένα"+ ]+ , examples (NumeralValue 2)+ [ "δύο"+ ]+ , examples (NumeralValue 3)+ [ "τρία"+ ]+ , examples (NumeralValue 4)+ [ "τέσσερα"+ ]+ , examples (NumeralValue 5)+ [ "πέντε"+ ]+ , examples (NumeralValue 6)+ [ "έξι"+ ]+ , examples (NumeralValue 7)+ [ "επτά"+ , "εφτά"+ ]+ , examples (NumeralValue 8)+ [ "οκτώ"+ , "οχτώ"+ ]+ , examples (NumeralValue 9)+ [ "εννιά"+ , "εννέα"+ ]+ , examples (NumeralValue 10)+ [ "δέκα"+ , "δεκαριά"+ ]+ , examples (NumeralValue 11)+ [ "έντεκα"+ , "ένδεκα"+ ]+ , examples (NumeralValue 15)+ [ "δεκαπέντε"+ ]+ , examples (NumeralValue 20)+ [ "20"+ , "είκοσι"+ ]+ , examples (NumeralValue 50)+ [ "πενήντα"+ ]+ , examples (NumeralValue 33)+ [ "33"+ , "τριάντα τρία"+ , "τριάντα τρεις"+ ]+ , examples (NumeralValue 24)+ [ "24"+ , "είκοσι τέσσερα"+ , "είκοσι τέσσερις"+ ]+ , examples (NumeralValue 0.77)+ [ "μηδέν κόμμα εβδομήντα επτά"+ , "0,77"+ ]+ , examples (NumeralValue 200032)+ [ "διακόσιες χιλιάδες τριάντα δύο"+ ]+ , examples (NumeralValue 7200032.356)+ [ "εφτά εκατομμύρια διακόσιες χιλιάδες τριάντα δύο κόμμα τριακόσια πενήντα έξι"+ , "7200032,356"+ , "7.200.032,356"+ ]+ , examples (NumeralValue 100000)+ [ "100000"+ , "100.000"+ , "εκατό χιλιάδες"+ ]+ , examples (NumeralValue 3e6)+ [ "τρία εκατομμύρια"+ , "3 εκατομμύρια"+ ]+ , examples (NumeralValue 1.2e6)+ [ "ένα εκατομμύριο διακόσιες χιλιάδες"+ , "1.200.000"+ , "1200000"+ ]+ , examples (NumeralValue 5000)+ [ "5 χιλιάδες"+ , "πέντε χιλιάδες"+ ]+ , examples (NumeralValue 122)+ [ "εκατόν είκοσι δύο"+ ]+ , examples (NumeralValue 743)+ [ "εφτακόσιοι σαράντα τρεις"+ , "εφτακόσια σαράντα τρία"+ , "εφτακόσιες σαράντα τρεις"+ ]+ , examples (NumeralValue 398)+ [ "τριακόσια ενενήντα οχτώ"+ ]+ , examples (NumeralValue 2e5)+ [ "διακόσιες χιλιάδες"+ ]+ , examples (NumeralValue 21011)+ [ "είκοσι μία χιλιάδες έντεκα"+ ]+ , examples (NumeralValue 721012)+ [ "εφτακόσιες είκοσι μία χιλιάδες δώδεκα"+ ]+ , examples (NumeralValue 31256721)+ [ "τριάντα ένα εκατομμύρια διακόσιες πενήντα έξι χιλιάδες εφτακόσια είκοσι ένα"+ , "31.256.721"+ ]+ , examples (NumeralValue 2400)+ [ "δύο χιλιάδες τετρακόσια"+ ]+ , examples (NumeralValue 2200000)+ [ "δύο κόμμα δύο εκατομμύρια"+ , "2,2 εκατομμύρια"+ ]+ ]
+ Duckling/Numeral/EL/Rules.hs view
@@ -0,0 +1,269 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Numeral.EL.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.List (intercalate)+import Data.Maybe+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral++oneOrTwoDigitsMap :: HashMap Text Integer+oneOrTwoDigitsMap = HashMap.fromList+ [ ( "μηδέν" , 0 )+ , ( "ένα" , 1 )+ , ( "ένας" , 1 )+ , ( "ενός" , 1 )+ , ( "μία" , 1 )+ , ( "μια" , 1 )+ , ( "δύο" , 2 )+ , ( "δυο" , 2 )+ , ( "τρία" , 3 )+ , ( "τρεις" , 3 )+ , ( "τέσσερα" , 4 )+ , ( "τέσσερις" , 4 )+ , ( "πέντε" , 5 )+ , ( "έξι" , 6 )+ , ( "επτά" , 7 )+ , ( "εφτά" , 7 )+ , ( "οκτώ" , 8 )+ , ( "οχτώ" , 8 )+ , ( "εννιά" , 9 )+ , ( "εννέα" , 9 )+ , ( "δέκα" , 10 )+ , ( "δεκαριά" , 10 )+ , ( "έντεκα" , 11 )+ , ( "ένδεκα" , 11 )+ , ( "δώδεκα" , 12 )+ , ( "ντουζίνα" , 12 )+ , ( "ντουζίνες" , 12 )+ , ( "δεκατρία" , 13 )+ , ( "δεκατέσσερα" , 14 )+ , ( "δεκαπέντε" , 15 )+ , ( "δεκαέξι" , 16 )+ , ( "δεκαεπτά" , 17 )+ , ( "δεκαοκτώ" , 18 )+ , ( "δεκαεννέα" , 19 )+ , ( "δεκαεννιά" , 19 )+ , ( "είκοσι" , 20 )+ , ( "τριάντα" , 30 )+ , ( "σαράντα" , 40 )+ , ( "πενήντα" , 50 )+ , ( "εξήντα" , 60 )+ , ( "εβδομήντα" , 70 )+ , ( "ογδόντα" , 80 )+ , ( "ενενήντα" , 90 )+ ]++hundredsMap :: HashMap Text Integer+hundredsMap = HashMap.fromList+ [ ( "δι" , 200 )+ , ( "τρι" , 300 )+ , ( "τετρ" , 400 )+ , ( "πεντ" , 500 )+ , ( "εξ" , 600 )+ , ( "επτ" , 700 )+ , ( "εφτ" , 700 )+ , ( "οκτ" , 800 )+ , ( "οχτ" , 800 )+ , ( "εννι" , 900 )+ ]++ruleNumeral :: Rule+ruleNumeral = Rule+ { name = "number (0..19, 20, 30..90)"+ , pattern = [ regex regexString ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) oneOrTwoDigitsMap >>= integer+ _ -> Nothing+ }+ where+ regexString = "(" ++ intercalate "|"+ [ "μηδέν|[εέ]ν[αοό]ς?|μ[ιί]ας?" -- [0..1]+ , "δ[υύ]ο|τρ(ία|εις)|τέσσερ(α|ις)|πέντε" -- [2..5]+ , "έξι|ε[πφ]τά|ο[κχ]τώ|ενν(ιά|έα)|δέκα|δεκαριά" -- [6..10]+ , "έν[τδ]εκα|δώδεκα|ντουζίν(α|ες)" -- [11..12]+ , "δεκα(τρία|τέσσερα|πέντε|έξι|ε[πφ]τά|ο[χκ]τώ|ενν(έα|ιά))" -- [13..19]+ , "είκοσι|(τριά|σαρά|πενή|εξή|εβδομή|ογδό|ενενή)ντα" -- [2..9]0+ ] ++ ")"++ruleFew :: Rule+ruleFew = Rule+ { name = "few"+ , pattern =+ [ regex "μερικ(ά|ές|οί)"+ ]+ , prod = \_ -> integer 3+ }++ruleCompositeTens :: Rule+ruleCompositeTens = Rule+ { name = "integer 21..99"+ , pattern =+ [ oneOf [20,30..90]+ , numberBetween 1 10+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = tens} :+ Token Numeral NumeralData{TNumeral.value = units} :+ _) -> double (tens + units)+ _ -> Nothing+ }++ruleHundred :: Rule+ruleHundred = Rule+ { name = "number (100)"+ , pattern = [ regex "(εκατόν?)" ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch _):_) -> integer 100 >>= withGrain 2+ _ -> Nothing+ }++ruleHundreds :: Rule+ruleHundreds = Rule+ { name = "number (200..900)"+ , pattern =+ [ regex "(δι|τρι|τετρ|πεντ|εξ|ε(π|φ)τ|ο(χ|κ)τ|εννι)ακόσι(α|ες|οι)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) hundredsMap >>=+ integer >>= withGrain 2+ _ -> Nothing+ }++rulePowersOfTen :: Rule+rulePowersOfTen = Rule+ { name = "powers of tens"+ , pattern =+ [ regex "(χίλι(α|οι|ες)|χιλιάδες|εκατομμύρι(ο|α)|δις|δισεκατομμύριο)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of+ "χίλια" -> double 1e3 >>= withGrain 3 >>= withMultipliable+ "χιλιάδες" -> double 1e3 >>= withGrain 3 >>= withMultipliable+ "εκατομμύριο" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "εκατομμύρια" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "δις" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ "δισεκατομμύριο" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ "δισεκατομμύρια" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ _ -> Nothing+ _ -> Nothing+ }++ruleNegative :: Rule+ruleNegative = Rule+ { name = "negative numbers"+ , pattern =+ [ regex "-|μείον"+ , Predicate isPositive+ ]+ , prod = \tokens -> case tokens of+ (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))+ _ -> Nothing+ }++ruleSum :: Rule+ruleSum = Rule+ { name = "intersect 2 numbers"+ , pattern =+ [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)+ , Predicate $ and . sequence [not . isMultipliable, isPositive]+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2+ _ -> Nothing+ }++ruleMultiply :: Rule+ruleMultiply = Rule+ { name = "compose by multiplication"+ , pattern =+ [ dimension Numeral+ , Predicate isMultipliable+ ]+ , prod = \tokens -> case tokens of+ (token1:token2:_) -> multiply token1 token2+ _ -> Nothing+ }++ruleDecimals :: Rule+ruleDecimals = Rule+ { name = "decimal number"+ , pattern =+ [ regex "(\\d+,\\d+)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ parseDecimal True (Text.replace "," "." match)+ _ -> Nothing+ }++ruleCommaSpelledOut :: Rule+ruleCommaSpelledOut = Rule+ { name = "one point two"+ , pattern =+ [ dimension Numeral+ , regex "κόμμα"+ , numberWith TNumeral.grain isNothing+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd1:_:Token Numeral nd2:_) ->+ double $ TNumeral.value nd1 + decimalsToDouble (TNumeral.value nd2)+ _ -> Nothing+ }++ruleDots :: Rule+ruleDots = Rule+ { name = "dot-separated numbers"+ , pattern =+ [ regex "(\\d+(\\.\\d\\d\\d)+(,\\d+)?)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ parseDouble (+ Text.replace "," "." $ Text.replace "." Text.empty match+ ) >>= double+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleFew+ , ruleNumeral+ , ruleCompositeTens+ , rulePowersOfTen+ , ruleNegative+ , ruleHundred+ , ruleHundreds+ , ruleSum+ , ruleMultiply+ , ruleDecimals+ , ruleCommaSpelledOut+ , ruleDots+ ]
Duckling/Numeral/EN/Corpus.hs view
@@ -160,4 +160,8 @@ , examples (NumeralValue 2200000) [ "two point two million" ]+ , examples (NumeralValue 3000000000)+ [ "three billions"+ , "three thousand millions"+ ] ]
Duckling/Numeral/EN/Rules.hs view
@@ -11,7 +11,8 @@ {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Numeral.EN.Rules- ( rules ) where+ ( rules+ ) where import Control.Applicative ((<|>)) import Data.HashMap.Strict (HashMap)@@ -29,18 +30,6 @@ import Duckling.Types import qualified Duckling.Numeral.Types as TNumeral -ruleIntegers :: Rule-ruleIntegers = Rule- { name = "integer (numeric)"- , pattern = [regex "(\\d{1,18})"]- , prod = \tokens ->- case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleDozen :: Rule ruleDozen = Rule { name = "a dozen of"@@ -52,50 +41,50 @@ zeroNineteenMap :: HashMap Text Integer zeroNineteenMap = HashMap.fromList- [ ( "naught", 0 )- , ( "nil" , 0 )- , ( "nought", 0 )- , ( "none" , 0 )- , ( "zero" , 0 )- , ( "zilch" , 0 )- , ( "one" , 1 )- , ( "two", 2 )- , ( "three", 3 )- , ( "four", 4 )- , ( "five", 5 )- , ( "six", 6 )- , ( "seven", 7 )- , ( "eight", 8 )- , ( "nine", 9 )- , ( "ten", 10 )- , ( "eleven", 11 )- , ( "twelve", 12 )- , ( "thirteen", 13 )- , ( "fourteen", 14 )- , ( "fifteen", 15 )- , ( "sixteen", 16 )+ [ ( "naught" , 0 )+ , ( "nil" , 0 )+ , ( "nought" , 0 )+ , ( "none" , 0 )+ , ( "zero" , 0 )+ , ( "zilch" , 0 )+ , ( "one" , 1 )+ , ( "two" , 2 )+ , ( "three" , 3 )+ , ( "four" , 4 )+ , ( "five" , 5 )+ , ( "six" , 6 )+ , ( "seven" , 7 )+ , ( "eight" , 8 )+ , ( "nine" , 9 )+ , ( "ten" , 10 )+ , ( "eleven" , 11 )+ , ( "twelve" , 12 )+ , ( "thirteen" , 13 )+ , ( "fourteen" , 14 )+ , ( "fifteen" , 15 )+ , ( "sixteen" , 16 ) , ( "seventeen", 17 )- , ( "eighteen", 18 )- , ( "nineteen", 19 )+ , ( "eighteen" , 18 )+ , ( "nineteen" , 19 ) ] informalMap :: HashMap Text Integer informalMap = HashMap.fromList- [ ( "single", 1 )- , ( "a couple", 2 )+ [ ( "single" , 1 )+ , ( "a couple" , 2 ) , ( "a couple of", 2 )- , ( "couple", 2 )- , ( "couples", 2 )- , ( "couple of", 2 )- , ( "couples of", 2 )- , ( "a pair", 2 )- , ( "a pair of", 2 )- , ( "pair", 2 )- , ( "pairs", 2 )- , ( "pair of", 2 )- , ( "pairs of", 2 )- , ( "a few", 3 )- , ( "few", 3 )+ , ( "couple" , 2 )+ , ( "couples" , 2 )+ , ( "couple of" , 2 )+ , ( "couples of" , 2 )+ , ( "a pair" , 2 )+ , ( "a pair of" , 2 )+ , ( "pair" , 2 )+ , ( "pairs" , 2 )+ , ( "pair of" , 2 )+ , ( "pairs of" , 2 )+ , ( "a few" , 3 )+ , ( "few" , 3 ) ] ruleToNineteen :: Rule@@ -113,25 +102,29 @@ _ -> Nothing } +tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ( "twenty" , 20 )+ , ( "thirty" , 30 )+ , ( "forty" , 40 )+ , ( "fourty" , 40 )+ , ( "fifty" , 50 )+ , ( "sixty" , 60 )+ , ( "seventy" , 70 )+ , ( "eighty" , 80 )+ , ( "ninety" , 90 )+ ]+ ruleTens :: Rule ruleTens = Rule { name = "integer (20..90)"- , pattern = [regex "(twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)"]- , prod = \tokens ->- case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- case Text.toLower match of- "twenty" -> integer 20- "thirty" -> integer 30- "forty" -> integer 40- "fourty" -> integer 40- "fifty" -> integer 50- "sixty" -> integer 60- "seventy" -> integer 70- "eighty" -> integer 80- "ninety" -> integer 90- _ -> Nothing- _ -> Nothing+ , pattern =+ [ regex "(twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) tensMap >>= integer+ _ -> Nothing } rulePowersOfTen :: Rule@@ -153,22 +146,56 @@ ruleCompositeTens :: Rule ruleCompositeTens = Rule { name = "integer 21..99"- , pattern = [oneOf [20,30..90], numberBetween 1 10]+ , pattern =+ [ oneOf [20,30..90]+ , numberBetween 1 10+ ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData { TNumeral.value = tens }) :- Token Numeral (NumeralData { TNumeral.value = units }) :- _) -> double (tens + units)+ (Token Numeral NumeralData{TNumeral.value = tens}:+ Token Numeral NumeralData{TNumeral.value = units}:+ _) -> double $ tens + units _ -> Nothing } -ruleSkipHundreds :: Rule-ruleSkipHundreds = Rule+ruleSkipHundreds1 :: Rule+ruleSkipHundreds1 = Rule+ { name = "one eleven"+ , pattern =+ [ regex "(one|two|three|four|five|six|seven|eight|nine)"+ , regex "(ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:_)):+ Token RegexMatch (GroupMatch (m2:_)):+ _) -> do+ let x1 = Text.toLower m1+ let x2 = Text.toLower m2+ hundreds <- HashMap.lookup x1 zeroNineteenMap+ rest <- HashMap.lookup x2 zeroNineteenMap <|> HashMap.lookup x2 tensMap+ integer (hundreds * 100 + rest)+ _ -> Nothing+ }++ruleSkipHundreds2 :: Rule+ruleSkipHundreds2 = Rule { name = "one twenty two"- , pattern = [numberBetween 1 10, numberBetween 10 100]+ , pattern =+ [ regex "(one|two|three|four|five|six|seven|eight|nine)"+ , regex "(twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)"+ , regex "(one|two|three|four|five|six|seven|eight|nine)"+ ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData { TNumeral.value = hundreds }) :- Token Numeral (NumeralData { TNumeral.value = rest }) :- _) -> double (hundreds*100 + rest)+ (Token RegexMatch (GroupMatch (m1:_)):+ Token RegexMatch (GroupMatch (m2:_)):+ Token RegexMatch (GroupMatch (m3:_)):+ _) -> do+ let x1 = Text.toLower m1+ let x2 = Text.toLower m2+ let x3 = Text.toLower m3+ hundreds <- HashMap.lookup x1 zeroNineteenMap+ tens <- HashMap.lookup x2 tensMap+ rest <- HashMap.lookup x3 zeroNineteenMap+ integer (hundreds * 100 + tens + rest) _ -> Nothing } @@ -201,31 +228,23 @@ ruleDecimals :: Rule ruleDecimals = Rule { name = "decimal number"- , pattern = [regex "(\\d*\\.\\d+)"]+ , pattern =+ [ regex "(\\d*\\.\\d+)"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> parseDecimal True match _ -> Nothing } -ruleFractions :: Rule-ruleFractions = Rule- { name = "fractional number"- , pattern = [regex "(\\d+)/(\\d+)"]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (numerator:denominator:_)):_) -> do- n <- parseDecimal False numerator- d <- parseDecimal False denominator- divide n d- _ -> Nothing- }- ruleCommas :: Rule ruleCommas = Rule { name = "comma-separated numbers"- , pattern = [regex "(\\d+(,\\d\\d\\d)+(\\.\\d+)?)"]+ , pattern =+ [ regex "(\\d+(,\\d\\d\\d)+(\\.\\d+)?)"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -236,24 +255,23 @@ [ dimension Numeral , regex "(k|m|g)(?=[\\W$€¢£]|$)" ]- , prod = \tokens ->- case tokens of- (Token Numeral nd : Token RegexMatch (GroupMatch (match : _)):_) -> do- x <- case Text.toLower match of- "k" -> Just 1e3- "m" -> Just 1e6- "g" -> Just 1e9- _ -> Nothing- double $ TNumeral.value nd * x- _ -> Nothing+ , prod = \tokens -> case tokens of+ (Token Numeral nd : Token RegexMatch (GroupMatch (match : _)):_) -> do+ x <- case Text.toLower match of+ "k" -> Just 1e3+ "m" -> Just 1e6+ "g" -> Just 1e9+ _ -> Nothing+ double $ TNumeral.value nd * x+ _ -> Nothing } ruleNegative :: Rule ruleNegative = Rule { name = "negative numbers" , pattern =- [ regex "-|minus\\s?|negative\\s?"- , dimension Numeral+ [ regex "(-|minus|negative)(?!\\s*-)"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))@@ -265,14 +283,13 @@ { name = "intersect 2 numbers" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ]- , prod = \tokens ->- case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):- _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2- _ -> Nothing+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2+ _ -> Nothing } ruleSumAnd :: Rule@@ -281,15 +298,14 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "and"- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ]- , prod = \tokens ->- case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- _:- Token Numeral (NumeralData {TNumeral.value = val2}):- _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2- _ -> Nothing+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ _:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2+ _ -> Nothing } ruleMultiply :: Rule@@ -297,7 +313,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -306,16 +322,15 @@ rules :: [Rule] rules =- [ ruleIntegers- , ruleToNineteen+ [ ruleToNineteen , ruleTens , rulePowersOfTen , ruleCompositeTens- , ruleSkipHundreds+ , ruleSkipHundreds1+ , ruleSkipHundreds2 , ruleDotSpelledOut , ruleLeadingDotSpelledOut , ruleDecimals- , ruleFractions , ruleCommas , ruleSuffixes , ruleNegative
Duckling/Numeral/ES/Rules.hs view
@@ -10,47 +10,35 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.ES.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|menos"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * (- 1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleDecimalWithThousandsSeparator :: Rule ruleDecimalWithThousandsSeparator = Rule { name = "decimal with thousands separator"@@ -58,10 +46,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -184,7 +170,7 @@ , numberBetween 6 10 ] , prod = \tokens -> case tokens of- (_:_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ 10 + v _ -> Nothing }@@ -197,7 +183,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -245,9 +231,9 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -261,9 +247,9 @@ , numberBetween 0 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ 100 * v1 + v2 _ -> Nothing }@@ -277,9 +263,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -292,7 +278,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -300,7 +286,6 @@ rules = [ ruleDecimalNumeral , ruleDecimalWithThousandsSeparator- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeral , ruleNumeral2
Duckling/Numeral/ET/Rules.hs view
@@ -10,60 +10,38 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.ET.Rules- ( rules ) where+ ( rules+ ) where +import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types--ruleIntegerWithThousandsSeparatorSpace :: Rule-ruleIntegerWithThousandsSeparatorSpace = Rule- { name = "integer with thousands separator space"- , pattern =- [ regex "(\\d{1,3}(\\s\\d\\d\\d){1,5})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ' ') Text.empty match) >>= double- _ -> Nothing- }+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|miinus|negatiivne"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = v}):+ Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ v * (-1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleACoupleOf :: Rule ruleACoupleOf = Rule { name = "a couple of"@@ -113,8 +91,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):_) -> double $ v1 + v2+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}:_) -> double $ v1 + v2 _ -> Nothing } @@ -144,11 +122,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -161,7 +139,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -176,13 +154,37 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2 _ -> Nothing } +zeroNineteenMap :: HashMap Text Integer+zeroNineteenMap = HashMap.fromList+ [ ("null", 0)+ , ("üks", 1)+ , ("kaks", 2)+ , ("kolm", 3)+ , ("neli", 4)+ , ("viis", 5)+ , ("kuus", 6)+ , ("seitse", 7)+ , ("kaheksa", 8)+ , ("üheksa", 9)+ , ("kümme", 10)+ , ("üksteist", 11)+ , ("kaksteist", 12)+ , ("kolmteist", 13)+ , ("neliteist", 14)+ , ("viisteist", 15)+ , ("kuusteist", 16)+ , ("seitseteist", 17)+ , ("kaheksateist", 18)+ , ("üheksateist", 19)+ ]+ ruleInteger :: Rule ruleInteger = Rule { name = "integer (0..19)"@@ -190,29 +192,9 @@ [ regex "(null|üksteist|üks|kaksteist|kaks|kolmteist|kolm|neliteist|neli|viisteist|viis|kuusteist|kuus|seitseteist|seitse|kaheksateist|kaheksa|üheksateist|üheksa|kümme)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "null" -> integer 0- "üks" -> integer 1- "kaks" -> integer 2- "kolm" -> integer 3- "neli" -> integer 4- "viis" -> integer 5- "kuus" -> integer 6- "seitse" -> integer 7- "kaheksa" -> integer 8- "üheksa" -> integer 9- "kümme" -> integer 10- "üksteist" -> integer 11- "kaksteist" -> integer 12- "kolmteist" -> integer 13- "neliteist" -> integer 14- "viisteist" -> integer 15- "kuusteist" -> integer 16- "seitseteist" -> integer 17- "kaheksateist" -> integer 18- "üheksateist" -> integer 19- _ -> Nothing- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) zeroNineteenMap >>= integer+ _ -> Nothing } ruleInteger4 :: Rule@@ -235,24 +217,28 @@ _ -> Nothing } -ruleInteger2 :: Rule-ruleInteger2 = Rule+twentyNinetyMap :: HashMap Text Integer+twentyNinetyMap = HashMap.fromList+ [ ("kakskümmend", 20)+ , ("kolmkümmend", 30)+ , ("nelikümmend", 40)+ , ("viiskümmend", 50)+ , ("kuuskümmend", 60)+ , ("seitsekümmend", 70)+ , ("kaheksakümmend", 80)+ , ("üheksakümmend", 90)+ ]++ruletwentyNinety :: Rule+ruletwentyNinety = Rule { name = "integer (20..90)" , pattern = [ regex "((kaks|kolm|neli|viis|kuus|seitse|kaheksa|(ü)heksa)k(ü)mmend)" ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "kakskümmend" -> integer 20- "kolmkümmend" -> integer 30- "nelikümmend" -> integer 40- "viiskümmend" -> integer 50- "kuuskümmend" -> integer 60- "seitsekümmend" -> integer 70- "kaheksakümmend" -> integer 80- "üheksakümmend" -> integer 90+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) twentyNinetyMap >>= integer _ -> Nothing- _ -> Nothing } ruleNumeralDotNumeral :: Rule@@ -264,9 +250,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -275,11 +261,11 @@ ruleIntegerWithThousandsSeparator = Rule { name = "integer with thousands separator ," , pattern =- [ regex "(\\d{1,3}(,\\d\\d\\d){1,5})"+ [ regex "(\\d{1,3}(([, ])\\d\\d\\d){1,5})" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ (Token RegexMatch (GroupMatch (match:_:sep:_)):_) ->+ parseDouble (Text.replace sep Text.empty match) >>= double _ -> Nothing } @@ -290,12 +276,10 @@ , ruleDecimalNumeral , ruleDecimalWithThousandsSeparator , ruleInteger- , ruleInteger2+ , ruletwentyNinety , ruleInteger3 , ruleInteger4- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator- , ruleIntegerWithThousandsSeparatorSpace , ruleIntersect , ruleMultiply , ruleNumeralDotNumeral
Duckling/Numeral/FR/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.FR.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -100,6 +101,7 @@ , "100K" , "100k" , "cent mille"+ , "100 000" ] , examples (NumeralValue 3000000) [ "3M"
Duckling/Numeral/FR/Rules.hs view
@@ -10,22 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.FR.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap-import Data.Text (Text)-import qualified Data.Text as Text-import Prelude import Data.Maybe import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumerals4 :: Rule ruleNumerals4 = Rule@@ -46,25 +47,11 @@ ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = v}):+ Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ v * (-1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleNumerals2 :: Rule ruleNumerals2 = Rule { name = "numbers 22..29 32..39 .. 52..59"@@ -73,8 +60,8 @@ , numberBetween 2 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -83,13 +70,11 @@ ruleDecimalWithThousandsSeparator = Rule { name = "decimal with thousands separator" , pattern =- [ regex "(\\d+(\\.\\d\\d\\d)+,\\d+)"+ [ regex "(\\d+(([\\. ])\\d\\d\\d)+,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_:sep:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace sep Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -135,8 +120,8 @@ , numberBetween 2 20 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -144,7 +129,7 @@ ruleNumeralMap :: HashMap Text Integer ruleNumeralMap = HashMap.fromList [ ( "zero" , 0 )- , ( "zéro", 0 )+ , ( "zéro" , 0 ) , ( "un" , 1 ) , ( "une" , 1 ) , ( "deux" , 2 )@@ -185,7 +170,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = v}):+ Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ 10 + v _ -> Nothing }@@ -199,9 +184,9 @@ , oneOf [1, 11] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -214,7 +199,7 @@ , regex "([kmg])(?=[\\W$€¢£]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -243,9 +228,9 @@ , numberWith TNumeral.value (== 1) ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -254,11 +239,11 @@ ruleIntegerWithThousandsSeparator = Rule { name = "integer with thousands separator ." , pattern =- [ regex "(\\d{1,3}(\\.\\d\\d\\d){1,5})"+ [ regex "(\\d{1,3}(([\\. ])\\d\\d\\d){1,5})" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton '.') Text.empty match+ (Token RegexMatch (GroupMatch (match:_:sep:_)):+ _) -> let fmt = Text.replace sep Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -286,11 +271,11 @@ { name = "intersect 2 numbers" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -300,7 +285,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -311,7 +296,6 @@ rules = [ ruleDecimalNumeral , ruleDecimalWithThousandsSeparator- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeral , ruleNumeral2
Duckling/Numeral/GA/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.GA.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -37,5 +38,16 @@ , examples (NumeralValue 20) [ "20" , "Fiche"+ ]+ , examples (NumeralValue 30)+ [ "déag is fiche"+ ]+ , examples (NumeralValue 40)+ [ "is dha fhichead"+ , "is dá fhichead"+ ]+ , examples (NumeralValue 50)+ [ "deag is dha fhichead"+ , "deag is dá fhichead" ] ]
Duckling/Numeral/GA/Rules.hs view
@@ -7,48 +7,58 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.GA.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.Text as Text-import Prelude+import Data.HashMap.Strict (HashMap) import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|m(í|i)neas(\\sa)?\\s?"- , dimension Numeral+ [ regex "-|m(í|i)neas(\\sa)?"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = v}):+ Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ v * (-1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }+oneToTenMap :: HashMap Text Integer+oneToTenMap = HashMap.fromList+ [ ("aon", 1)+ , ("dha", 2)+ , ("dhá", 2)+ , ("trí", 3)+ , ("tri", 3)+ , ("ceithre", 4)+ , ("cuig", 5)+ , ("cúig", 5)+ , ("sé", 6)+ , ("se", 6)+ , ("seacht", 7)+ , ("ocht", 8)+ , ("naoi", 9)+ , ("deich", 10)+ ] ruleNumerals2 :: Rule ruleNumerals2 = Rule@@ -57,22 +67,8 @@ [ regex "(aon|dh(á|a)|tr(í|i)|ceithre|c(ú|u)ig|seacht|s(é|e)|ocht|naoi|deich)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "aon" -> integer 1- "dha" -> integer 2- "dhá" -> integer 2- "trí" -> integer 3- "tri" -> integer 3- "ceithre" -> integer 4- "cuig" -> integer 5- "cúig" -> integer 5- "sé" -> integer 6- "se" -> integer 6- "seacht" -> integer 7- "ocht" -> integer 8- "naoi" -> integer 9- "deich" -> integer 10- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) oneToTenMap >>= integer _ -> Nothing } @@ -84,7 +80,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -116,7 +112,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -126,43 +122,37 @@ _ -> Nothing } +oldVigNumeralsSMap :: HashMap Text Integer+oldVigNumeralsSMap = HashMap.fromList+ [ ("dá fhichead", 40)+ , ("da fhichead", 40)+ , ("dhá fhichead", 40)+ , ("dha fhichead", 40)+ , ("trí fichid", 60)+ , ("tri fichid", 60)+ , ("ceithre fichid", 80)+ ]+ ruleOldVigesimalNumeralsS :: Rule ruleOldVigesimalNumeralsS = Rule { name = "old vigesimal numbers, 20s" , pattern =- [ regex "is (dh?(á|a) fhichead|tr(í|i) fichid|ceithre fichid)"+ [ regex "(d[ée]ag )?is (dh?(á|a) fhichead|tr(í|i) fichid|ceithre fichid)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "dá fhichead" -> integer 40- "da fhichead" -> integer 40- "dhá fhichead" -> integer 40- "dha fhichead" -> integer 40- "trí fichid" -> integer 60- "tri fichid" -> integer 60- "ceithre fichid" -> integer 80- _ -> Nothing+ (Token RegexMatch (GroupMatch (ten:match:_)):_) -> do+ x <- HashMap.lookup (Text.toLower match) oldVigNumeralsSMap+ integer $ if Text.null ten then x else x + 10 _ -> Nothing } -ruleOldVigesimalNumeralsS2 :: Rule-ruleOldVigesimalNumeralsS2 = Rule- { name = "old vigesimal numbers, 20s + 10"+ruleOldVigesimalFiche :: Rule+ruleOldVigesimalFiche = Rule+ { name = "old vigesimal 20 + 10" , pattern =- [ regex "d(é|e)ag is (fiche|dh?(á|a) fhichead|tr(í|i) fichid|ceithre fichid)"+ [ regex "d[ée]ag is fiche" ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "fiche" -> integer 30- "dá fhichead" -> integer 50- "da fhichead" -> integer 50- "dhá fhichead" -> integer 50- "dha fhichead" -> integer 50- "trí fichid" -> integer 70- "tri fichid" -> integer 70- "ceithre fichid" -> integer 90- _ -> Nothing- _ -> Nothing+ , prod = const $ integer 30 } ruleAmhin :: Rule@@ -174,6 +164,22 @@ , prod = \_ -> integer 1 } +twentyToNinetyMap :: HashMap Text Integer+twentyToNinetyMap = HashMap.fromList+ [ ("fiche", 20)+ , ("triocha", 30)+ , ("tríocha", 30)+ , ("daichead", 40)+ , ("caoga", 50)+ , ("seasca", 60)+ , ("seachto", 70)+ , ("seachtó", 70)+ , ("ochto", 80)+ , ("ochtó", 80)+ , ("nócha", 90)+ , ("nocha", 90)+ ]+ ruleNumerals :: Rule ruleNumerals = Rule { name = "numbers, 20-90"@@ -181,20 +187,8 @@ [ regex "(fiche|tr(í|i)ocha|daichead|caoga|seasca|seacht(ó|o)|ocht(ó|o)|n(ó|o)cha)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "fiche" -> integer 20- "triocha" -> integer 30- "tríocha" -> integer 30- "daichead" -> integer 40- "caoga" -> integer 50- "seasca" -> integer 60- "seachto" -> integer 70- "seachtó" -> integer 70- "ochto" -> integer 80- "ochtó" -> integer 80- "nócha" -> integer 90- "nocha" -> integer 90- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) twentyToNinetyMap >>= integer _ -> Nothing } @@ -206,10 +200,30 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } +countNumeralsMap :: HashMap Text Integer+countNumeralsMap = HashMap.fromList+ [ ("naid", 0)+ , ("náid", 0)+ , ("haon", 1)+ , ("dó", 2)+ , ("do", 2)+ , ("trí", 3)+ , ("tri", 3)+ , ("ceathair", 4)+ , ("cuig", 5)+ , ("cúig", 5)+ , ("sé", 6)+ , ("se", 6)+ , ("seacht", 7)+ , ("hocht", 8)+ , ("naoi", 9)+ , ("deich", 10)+ ]+ ruleCountNumerals :: Rule ruleCountNumerals = Rule { name = "count numbers"@@ -217,24 +231,8 @@ [ regex "a (n(á|a)id|haon|d(ó|o)|tr(í|i)|ceathair|c(ú|u)ig|s(é|e)|seacht|hocht|naoi|deich)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "naid" -> integer 0- "náid" -> integer 0- "haon" -> integer 1- "dó" -> integer 2- "do" -> integer 2- "trí" -> integer 3- "tri" -> integer 3- "ceathair" -> integer 4- "cuig" -> integer 5- "cúig" -> integer 5- "sé" -> integer 6- "se" -> integer 6- "seacht" -> integer 7- "hocht" -> integer 8- "naoi" -> integer 9- "deich" -> integer 10- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) countNumeralsMap >>= integer _ -> Nothing } @@ -245,12 +243,11 @@ , ruleDag , ruleDecimalNumeral , ruleDecimalWithThousandsSeparator- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumerals , ruleNumerals2 , ruleNumeralsPrefixWithNegativeOrMinus , ruleNumeralsSuffixesKMG , ruleOldVigesimalNumeralsS- , ruleOldVigesimalNumeralsS2+ , ruleOldVigesimalFiche ]
Duckling/Numeral/HE/Rules.hs view
@@ -9,7 +9,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.HE.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe import Data.String@@ -38,11 +39,11 @@ { name = "intersect numbers" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -53,12 +54,12 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "ו"- , numberWith TNumeral.multipliable not+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}: _:- Token Numeral (NumeralData {TNumeral.value = val2}):+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -71,8 +72,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = tens}):- Token Numeral (NumeralData {TNumeral.value = units}):+ (Token Numeral NumeralData{TNumeral.value = tens}:+ Token Numeral NumeralData{TNumeral.value = units}: _) -> double $ tens + units _ -> Nothing }@@ -86,9 +87,9 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = tens}):+ (Token Numeral NumeralData{TNumeral.value = tens}: _:- Token Numeral (NumeralData {TNumeral.value = units}):+ Token Numeral NumeralData{TNumeral.value = units}: _) -> double $ tens + units _ -> Nothing }@@ -98,26 +99,13 @@ { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|מינוס"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleInteger10 :: Rule ruleInteger10 = Rule { name = "integer 9"@@ -247,8 +235,8 @@ , numberWith TNumeral.value (== 10) ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -279,8 +267,8 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -352,7 +340,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -378,7 +366,6 @@ , ruleInteger7 , ruleInteger8 , ruleInteger9- , ruleIntegerNumeric , ruleIntersectNumerals , ruleIntersectWithAnd , ruleMultiply
+ Duckling/Numeral/HI/Corpus.hs view
@@ -0,0 +1,87 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Numeral.HI.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Numeral.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale HI Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (NumeralValue 0)+ [ "शून्य"+ , "०"+ ]+ , examples (NumeralValue 1)+ [ "एक"+ ]+ , examples (NumeralValue 2)+ [ "दो"+ ]+ , examples (NumeralValue 3)+ [ "तीन"+ ]+ , examples (NumeralValue 4)+ [ "चार"+ ]+ , examples (NumeralValue 5)+ [ "पाँच"+ ]+ , examples (NumeralValue 6)+ [ "छह"+ ]+ , examples (NumeralValue 7)+ [ "सात"+ ]+ , examples (NumeralValue 8)+ [ "आठ"+ ]+ , examples (NumeralValue 9)+ [ "नौ"+ ]+ , examples (NumeralValue 10)+ [ "दस"+ ]+ , examples (NumeralValue 15)+ [ "पन्द्रह"+ ]+ , examples (NumeralValue 17)+ [ "सत्रह"+ ]+ , examples (NumeralValue 20)+ [ "बीस"+ ]+ , examples (NumeralValue 22)+ [ "बाईस"+ ]+ , examples (NumeralValue 24)+ [ "चौबीस"+ ]+ , examples (NumeralValue 26)+ [ "छब्बीस"+ ]+ , examples (NumeralValue 28)+ [ "अट्ठाईस"+ ]+ , examples (NumeralValue 50)+ [ "५०"+ , "पचास"+ ]+ ]
+ Duckling/Numeral/HI/Rules.hs view
@@ -0,0 +1,170 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-}++module Duckling.Numeral.HI.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.Maybe+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral++devanagariMap :: HashMap Char Char+devanagariMap = HashMap.fromList+ [ ( '०', '0' )+ , ( '१', '1' )+ , ( '२', '2' )+ , ( '३', '3' )+ , ( '४', '4' )+ , ( '५', '5' )+ , ( '६', '6' )+ , ( '७', '7' )+ , ( '८', '8' )+ , ( '९', '9' )+ ]++devanagariToArab :: Char -> Char+devanagariToArab c = HashMap.lookupDefault c c devanagariMap++ruleDevanagari :: Rule+ruleDevanagari = Rule+ { name = "devanagari forms"+ , pattern =+ [ regex "([०१२३४५६७८९]{1,18})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ toInteger <$> parseInt (Text.map devanagariToArab match) >>= integer+ _ -> Nothing+ }++ruleNumeralMap :: HashMap Text Integer+ruleNumeralMap = HashMap.fromList+ [ ( "शून्य", 0 )+ , ( "एक", 1 )+ , ( "दो" , 2 )+ , ( "तीन", 3 )+ , ( "चार", 4 )+ , ( "पाँच", 5 )+ , ( "छह", 6 )+ , ( "सात", 7 )+ , ( "आठ", 8 )+ , ( "नौ" , 9 )+ , ( "दस", 10 )+ ]++ruleNumeral :: Rule+ruleNumeral = Rule+ { name = "number (0..10)"+ , pattern =+ [ regex "(शून्य|एक|दो|तीन|चार|पाँच|छह|सात|आठ|नौ|दस)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match ruleNumeralMap >>= integer+ _ -> Nothing+ }++elevenToNineteenMap :: HashMap Text Integer+elevenToNineteenMap = HashMap.fromList+ [ ( "ग्यारह", 11 )+ , ( "बारह", 12 )+ , ( "तेरह", 13 )+ , ( "चौदह", 14 )+ , ( "पन्द्रह", 15 )+ , ( "सोलह", 16 )+ , ( "सत्रह", 17 )+ , ( "अठारह", 18 )+ , ( "उन्नीस", 19 )+ ]++ruleElevenToNineteen :: Rule+ruleElevenToNineteen = Rule+ { name = "number (11..19)"+ , pattern =+ [ regex "(ग्यारह|बारह|तेरह|चौदह|पन्द्रह|सोलह|सत्रह|अठारह|उन्नीस)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match elevenToNineteenMap >>= integer+ _ -> Nothing+ }++twentyoneToTwentynineMap :: HashMap Text Integer+twentyoneToTwentynineMap = HashMap.fromList+ [ ( "इक्कीस", 21 )+ , ( "बाईस", 22 )+ , ( "तेईस", 23 )+ , ( "चौबीस", 24 )+ , ( "पच्चीस", 25 )+ , ( "छब्बीस", 26 )+ , ( "सत्ताईस", 27 )+ , ( "अट्ठाईस", 28 )+ , ( "उनतीस", 29 )+ ]++ruleTwentyoneToTwentynine :: Rule+ruleTwentyoneToTwentynine = Rule+ { name = "number (21..29)"+ , pattern =+ [ regex "(इक्कीस|बाईस|तेईस|चौबीस|पच्चीस|छब्बीस|सत्ताईस|अट्ठाईस|उनतीस)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match twentyoneToTwentynineMap >>= integer+ _ -> Nothing+ }++tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ( "बीस", 20 )+ , ( "तीस", 30 )+ , ( "चालीस", 40 )+ , ( "पचास", 50 )+ , ( "साठ", 60 )+ , ( "सत्तर", 70 )+ , ( "अस्सी", 80 )+ , ( "नब्बे", 90 )+ ]++ruleTens :: Rule+ruleTens = Rule+ { name = "integer (20,30..90)"+ , pattern =+ [ regex "(बीस|तीस|चालीस|पचास|साठ|सत्तर|अस्सी|नब्बे)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match tensMap >>= integer+ _ -> Nothing+ }+++rules :: [Rule]+rules =+ [ ruleDevanagari+ , ruleNumeral+ , ruleElevenToNineteen+ , ruleTwentyoneToTwentynine+ , ruleTens+ ]
Duckling/Numeral/HR/Rules.hs view
@@ -9,7 +9,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.HR.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe import Data.String@@ -29,26 +30,13 @@ { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|minus|negativ"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -74,10 +62,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -161,9 +147,9 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -173,11 +159,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -190,7 +176,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -273,8 +259,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -310,9 +296,9 @@ , numberBetween 0 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ 100 * v1 + v2 _ -> Nothing }@@ -326,9 +312,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -341,7 +327,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton '.') Text.empty match+ _) -> let fmt = Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -351,7 +337,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -368,7 +354,7 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleInteger4 , ruleIntegerNumeric+ , ruleInteger4 , ruleIntegerWithThousandsSeparator , ruleMultiply , ruleNumberDotNumber
Duckling/Numeral/HU/Rules.hs view
@@ -11,7 +11,8 @@ {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Numeral.HU.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap) import Data.Maybe@@ -28,20 +29,6 @@ import Duckling.Types import qualified Duckling.Numeral.Types as TNumeral -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleNumeralMap :: HashMap Text Integer ruleNumeralMap = HashMap.fromList [ ( "nulla", 0 )@@ -120,8 +107,8 @@ _ -> Nothing } -dozensMap :: HashMap Text Integer-dozensMap = HashMap.fromList+tensMap :: HashMap Text Integer+tensMap = HashMap.fromList [ ( "h\x00FAsz", 20 ) , ( "harminc", 30 ) , ( "negyven", 40 )@@ -140,7 +127,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- HashMap.lookup (Text.toLower match) dozensMap >>= integer+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } @@ -152,7 +139,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do- v1 <- HashMap.lookup (Text.toLower m1) dozensMap+ v1 <- HashMap.lookup (Text.toLower m1) tensMap v2 <- HashMap.lookup (Text.toLower m2) ruleNumeralMap integer $ v1 + v2 _ -> Nothing@@ -160,8 +147,7 @@ rules :: [Rule] rules =- [ ruleIntegerNumeric- , ruleNumeral+ [ ruleNumeral , ruleElevenToNineteen , ruleTwentyoneToTwentynine , ruleTens
Duckling/Numeral/Helpers.hs view
@@ -14,10 +14,14 @@ , double , integer , multiply+ , isMultipliable+ , isNatural+ , isPositive , divide , notOkForAnyTime , numberBetween , numberWith+ , numeralMapEL , oneOf , parseDouble , parseInt@@ -27,10 +31,13 @@ , parseDecimal ) where +import Data.HashMap.Strict (HashMap) import Data.Maybe+import Data.String import Data.Text (Text) import Prelude import qualified Data.Attoparsec.Text as Atto+import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Duckling.Dimensions.Types@@ -88,6 +95,19 @@ low <= v && v < up _ -> False +isNatural :: Predicate+isNatural (Token Numeral NumeralData {value = v}) =+ isInteger v && v > 0+isNatural _ = False++isPositive :: Predicate+isPositive (Token Numeral NumeralData{value = v}) = v >= 0+isPositive _ = False++isMultipliable :: Predicate+isMultipliable (Token Numeral nd) = multipliable nd+isMultipliable _ = False+ oneOf :: [Double] -> PatternItem oneOf vs = Predicate $ \x -> case x of@@ -125,8 +145,8 @@ multiply :: Token -> Token -> Maybe Token multiply- (Token Numeral (NumeralData {value = v1}))- (Token Numeral (NumeralData {value = v2, grain = g})) = case g of+ (Token Numeral NumeralData{value = v1})+ (Token Numeral NumeralData{value = v2, grain = g}) = case g of Nothing -> double $ v1 * v2 Just grain | v2 > v1 -> double (v1 * v2) >>= withGrain grain | otherwise -> Nothing@@ -134,8 +154,8 @@ divide :: Token -> Token -> Maybe Token divide- (Token Numeral (NumeralData {value = v1}))- (Token Numeral (NumeralData {value = v2})) = case v1 / v2 of+ (Token Numeral NumeralData{value = v1})+ (Token Numeral NumeralData{value = v2}) = case v1 / v2 of x | isInfinite x || isNaN x -> Nothing x -> double x divide _ _ = Nothing@@ -146,3 +166,55 @@ | otherwise = parseDouble (Text.replace comma dot match) >>= double++-- TODO: Single-word composition (#110)+numeralMapEL :: HashMap Text Int+numeralMapEL = HashMap.fromList+ [ ( "δι" , 2 )+ , ( "δί" , 2 )+ , ( "τρι" , 3 )+ , ( "τρί" , 3 )+ , ( "τετρ" , 4 )+ , ( "πεντ" , 5 )+ , ( "πενθ" , 5 )+ , ( "εξ" , 6 )+ , ( "επτ" , 7 )+ , ( "εφτ" , 7 )+ , ( "οκτ" , 8 )+ , ( "οχτ" , 8 )+ , ( "εννι" , 9 )+ , ( "δεκ" , 10 )+ , ( "δεκαπεντ" , 15 )+ , ( "δεκαπενθ" , 15 )+ , ( "εικοσ" , 20 )+ , ( "εικοσιπεντ" , 25 )+ , ( "εικοσιπενθ" , 25 )+ , ( "τριαντ" , 30 )+ , ( "τριανταπεντ" , 35 )+ , ( "τριανταπενθ" , 35 )+ , ( "σαραντ" , 40 )+ , ( "σαρανταπεντ" , 45 )+ , ( "σαρανταπενθ" , 45 )+ , ( "πενηντ" , 50 )+ , ( "πενηνταπετν" , 55 )+ , ( "πενηνταπετθ" , 55 )+ , ( "εξηντ" , 60 )+ , ( "ενενηντ" , 90 )+ -- The following are used as prefixes+ , ( "μιά" , 1 )+ , ( "ενά" , 1 )+ , ( "δυό" , 2 )+ , ( "τρεισή" , 3 )+ , ( "τεσσερισή" , 4 )+ , ( "τεσσερσή" , 4 )+ , ( "πεντέ" , 5 )+ , ( "εξί" , 6 )+ , ( "επτά" , 7 )+ , ( "εφτά" , 7 )+ , ( "οκτώ" , 8 )+ , ( "οχτώ" , 8 )+ , ( "εννιά" , 9 )+ , ( "δεκά" , 10 )+ , ( "εντεκά" , 11 )+ , ( "δωδεκά" , 12 )+ ]
Duckling/Numeral/ID/Rules.hs view
@@ -10,22 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.ID.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text import Data.Text (Text) import Prelude import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleIntegerMap :: HashMap Text Integer ruleIntegerMap = HashMap.fromList@@ -51,7 +52,7 @@ , regex "belas" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 10+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 10 _ -> Nothing } @@ -73,27 +74,14 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|minus\\s?|negatif\\s?"- , dimension Numeral+ [ regex "-|minus|negatif"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleTen :: Rule ruleTen = Rule { name = "ten"@@ -111,9 +99,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -123,7 +109,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -150,8 +136,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -161,11 +147,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -187,7 +173,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -241,8 +227,8 @@ , numberWith TNumeral.value (== 10) ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2, TNumeral.grain = Just g}: _) -> double (v1 * v2) >>= withGrain g _ -> Nothing }@@ -255,7 +241,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -267,7 +253,6 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleMultiply
Duckling/Numeral/IT/Rules.hs view
@@ -10,44 +10,35 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.IT.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.Text as Text-import Prelude+import Data.HashMap.Strict (HashMap) import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|meno|negativo"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleDecimalWithThousandsSeparator :: Rule ruleDecimalWithThousandsSeparator = Rule { name = "decimal with thousands separator"@@ -55,10 +46,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -75,6 +64,18 @@ _ -> Nothing } +tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ("venti", 20)+ , ("trenta", 30)+ , ("quaranta", 40)+ , ("cinquanta", 50)+ , ("sessanta", 60)+ , ("settanta", 70)+ , ("ottanta", 80)+ , ("novanta", 90)+ ]+ ruleNumeral2 :: Rule ruleNumeral2 = Rule { name = "number (20..90)"@@ -82,19 +83,38 @@ [ regex "(venti|trenta|quaranta|cinquanta|sessanta|settanta|ottanta|novanta)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "venti" -> integer 20- "trenta" -> integer 30- "quaranta" -> integer 40- "cinquanta" -> integer 50- "sessanta" -> integer 60- "settanta" -> integer 70- "ottanta" -> integer 80- "novanta" -> integer 90- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } +zeroNineteenMap :: HashMap Text Integer+zeroNineteenMap = HashMap.fromList+ [ ("zero", 0)+ , ("niente", 0)+ , ("nulla", 0)+ , ("un", 1)+ , ("uno", 1)+ , ("due", 2)+ , ("tre", 3)+ , ("quattro", 4)+ , ("cinque", 5)+ , ("sei", 6)+ , ("sette", 7)+ , ("otto", 8)+ , ("nove", 9)+ , ("dieci", 10)+ , ("undici", 11)+ , ("dodici", 12)+ , ("tredici", 13)+ , ("quattordici", 14)+ , ("quindici", 15)+ , ("sedici", 16)+ , ("diciassette", 17)+ , ("diciotto", 18)+ , ("diciannove", 19)+ ]+ ruleNumeral :: Rule ruleNumeral = Rule { name = "number (0..19)"@@ -102,34 +122,26 @@ [ regex "(zero|nulla|niente|uno|due|tredici|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|un)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "zero" -> integer 0- "niente" -> integer 0- "nulla" -> integer 0- "un" -> integer 1- "uno" -> integer 1- "due" -> integer 2- "tre" -> integer 3- "quattro" -> integer 4- "cinque" -> integer 5- "sei" -> integer 6- "sette" -> integer 7- "otto" -> integer 8- "nove" -> integer 9- "dieci" -> integer 10- "undici" -> integer 11- "dodici" -> integer 12- "tredici" -> integer 13- "quattordici" -> integer 14- "quindici" -> integer 15- "sedici" -> integer 16- "diciassette" -> integer 17- "diciotto" -> integer 18- "diciannove" -> integer 19- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) zeroNineteenMap >>= integer _ -> Nothing } +hundredsMap :: HashMap Text Integer+hundredsMap = HashMap.fromList+ [ ("cento", 100)+ , ("duecento", 200)+ , ("trecento", 300)+ , ("quattrocento", 400)+ , ("cinquecento", 500)+ , ("seicento", 600)+ , ("settecento", 700)+ , ("ottocento", 800)+ , ("novecento", 900)+ , ("mila", 1000)+ , ("mille", 1000)+ ]+ ruleNumeral5 :: Rule ruleNumeral5 = Rule { name = "number 100..1000 "@@ -137,19 +149,8 @@ [ regex "(due|tre|quattro|cinque|sei|sette|otto|nove)?cento|mil(a|le)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "cento" -> integer 100- "duecento" -> integer 200- "trecento" -> integer 300- "quattrocento" -> integer 400- "cinquecento" -> integer 500- "seicento" -> integer 600- "settecento" -> integer 700- "ottocento" -> integer 800- "novecento" -> integer 900- " mila" -> integer 1000- "mille" -> integer 1000- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) hundredsMap >>= integer _ -> Nothing } @@ -162,9 +163,9 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -177,7 +178,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -187,6 +188,90 @@ _ -> Nothing } +twentyoneNinetynineMap :: HashMap Text Integer+twentyoneNinetynineMap = HashMap.fromList+ [ ("ventuno", 21)+ , ("ventidue", 22)+ , ("ventitre", 23)+ , ("ventitré", 23)+ , ("ventiquattro", 24)+ , ("venticinque", 25)+ , ("ventisei", 26)+ , ("ventisette", 27)+ , ("ventotto", 28)+ , ("ventinove", 29)+ , ("trentuno", 31)+ , ("trentadue", 32)+ , ("trentatre", 33)+ , ("trentatré", 33)+ , ("trentaquattro", 34)+ , ("trentacinque", 35)+ , ("trentasei", 36)+ , ("trentasette", 37)+ , ("trentotto", 38)+ , ("trentanove", 39)+ , ("quarantuno", 41)+ , ("quarantadue", 42)+ , ("quarantatre", 43)+ , ("quarantatré", 43)+ , ("quarantaquattro", 44)+ , ("quarantacinque", 45)+ , ("quarantasei", 46)+ , ("quarantasette", 47)+ , ("quarantotto", 48)+ , ("quarantanove", 49)+ , ("cinquantuno", 51)+ , ("cinquantadue", 52)+ , ("cinquantatre", 53)+ , ("cinquantatré", 53)+ , ("cinquantaquattro", 54)+ , ("cinquantacinque", 55)+ , ("cinquantasei", 56)+ , ("cinquantasette", 57)+ , ("cinquantotto", 58)+ , ("cinquantanove", 59)+ , ("sessantuno", 61)+ , ("sessantadue", 62)+ , ("sessantatré", 63)+ , ("sessantatre", 63)+ , ("sessantaquattro", 64)+ , ("sessantacinque", 65)+ , ("sessantasei", 66)+ , ("sessantasette", 67)+ , ("sessantotto", 68)+ , ("sessantanove", 69)+ , ("settantuno", 71)+ , ("settantadue", 72)+ , ("settantatré", 73)+ , ("settantatre", 73)+ , ("settantaquattro", 74)+ , ("settantacinque", 75)+ , ("settantasei", 76)+ , ("settantasette", 77)+ , ("settantotto", 78)+ , ("settantanove", 79)+ , ("ottantuno", 81)+ , ("ottantadue", 82)+ , ("ottantatré", 83)+ , ("ottantatre", 83)+ , ("ottantaquattro", 84)+ , ("ottantacinque", 85)+ , ("ottantasei", 86)+ , ("ottantasette", 87)+ , ("ottantotto", 88)+ , ("ottantanove", 89)+ , ("novantuno", 91)+ , ("novantadue", 92)+ , ("novantatre", 93)+ , ("novantatré", 93)+ , ("novantaquattro", 94)+ , ("novantacinque", 95)+ , ("novantasei", 96)+ , ("novantasette", 97)+ , ("novantotto", 98)+ , ("novantanove", 99)+ ]+ ruleNumeral4 :: Rule ruleNumeral4 = Rule { name = "number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)"@@ -194,88 +279,8 @@ [ regex "((venti|trenta|quaranta|cinquanta|sessanta|settanta|ottanta|novanta)(due|tre|tré|quattro|cinque|sei|sette|nove))|((vent|trent|quarant|cinquant|sessant|settant|ottant|novant)(uno|otto))" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "ventuno" -> integer 21- "ventidue" -> integer 22- "ventitre" -> integer 23- "ventitré" -> integer 23- "ventiquattro" -> integer 24- "venticinque" -> integer 25- "ventisei" -> integer 26- "ventisette" -> integer 27- "ventotto" -> integer 28- "ventinove" -> integer 29- "trentuno" -> integer 31- "trentadue" -> integer 32- "trentatre" -> integer 33- "trentatré" -> integer 33- "trentaquattro" -> integer 34- "trentacinque" -> integer 35- "trentasei" -> integer 36- "trentasette" -> integer 37- "trentotto" -> integer 38- "trentanove" -> integer 39- "quarantuno" -> integer 41- "quarantadue" -> integer 42- "quarantatre" -> integer 43- "quarantatré" -> integer 43- "quarantaquattro" -> integer 44- "quarantacinque" -> integer 45- "quarantasei" -> integer 46- "quarantasette" -> integer 47- "quarantotto" -> integer 48- "quarantanove" -> integer 49- "cinquantuno" -> integer 51- "cinquantadue" -> integer 52- "cinquantatre" -> integer 53- "cinquantatré" -> integer 53- "cinquantaquattro" -> integer 54- "cinquantacinque" -> integer 55- "cinquantasei" -> integer 56- "cinquantasette" -> integer 57- "cinquantotto" -> integer 58- "cinquantanove" -> integer 59- "sessantuno" -> integer 61- "sessantadue" -> integer 62- "sessantatré" -> integer 63- "sessantatre" -> integer 63- "sessantaquattro" -> integer 64- "sessantacinque" -> integer 65- "sessantasei" -> integer 66- "sessantasette" -> integer 67- "sessantotto" -> integer 68- "sessantanove" -> integer 69- "settantuno" -> integer 71- "settantadue" -> integer 72- "settantatré" -> integer 73- "settantatre" -> integer 73- "settantaquattro" -> integer 74- "settantacinque" -> integer 75- "settantasei" -> integer 76- "settantasette" -> integer 77- "settantotto" -> integer 78- "settantanove" -> integer 79- "ottantuno" -> integer 81- "ottantadue" -> integer 82- "ottantatré" -> integer 83- "ottantatre" -> integer 83- "ottantaquattro" -> integer 84- "ottantacinque" -> integer 85- "ottantasei" -> integer 86- "ottantasette" -> integer 87- "ottantotto" -> integer 88- "ottantanove" -> integer 89- "novantuno" -> integer 91- "novantadue" -> integer 92- "novantatre" -> integer 93- "novantatré" -> integer 93- "novantaquattro" -> integer 94- "novantacinque" -> integer 95- "novantasei" -> integer 96- "novantasette" -> integer 97- "novantotto" -> integer 98- "novantanove" -> integer 99- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) twentyoneNinetynineMap >>= integer _ -> Nothing } @@ -288,9 +293,9 @@ , numberBetween 0 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):- Token Numeral (NumeralData {TNumeral.value = v3}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}:+ Token Numeral NumeralData{TNumeral.value = v3}: _) -> double $ v1 * v2 + v3 _ -> Nothing }@@ -303,7 +308,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -311,7 +316,6 @@ rules = [ ruleDecimalNumeral , ruleDecimalWithThousandsSeparator- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeral , ruleNumeral2
Duckling/Numeral/JA/Rules.hs view
@@ -10,21 +10,22 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.JA.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap-import qualified Data.Text as Text import Data.HashMap.Strict (HashMap)+import Data.String import Data.Text (Text) import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleInteger5 :: Rule ruleInteger5 = Rule@@ -40,26 +41,13 @@ { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|マイナス\\s?|負\\s?"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleInteger10 :: Rule ruleInteger10 = Rule { name = "integer (1000..1999)"@@ -68,7 +56,7 @@ , numberBetween 1 1000 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 1000 _ -> Nothing }@@ -81,7 +69,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -93,7 +81,7 @@ , regex "万" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 10000+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10000 _ -> Nothing } @@ -128,7 +116,7 @@ , regex "十" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 10+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10 _ -> Nothing } @@ -149,7 +137,7 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 100+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 100 _ -> Nothing } @@ -161,8 +149,8 @@ , numberBetween 1 1000 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -175,7 +163,7 @@ , regex "(k|m|g|千|万)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -195,7 +183,7 @@ , regex "百" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 100+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 100 _ -> Nothing } @@ -207,7 +195,7 @@ , numberBetween 1 10000 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 10000 _ -> Nothing }@@ -220,8 +208,8 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -234,8 +222,8 @@ , numberBetween 1 10000 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -285,8 +273,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -299,7 +287,7 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 10+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 10 _ -> Nothing } @@ -311,7 +299,7 @@ , regex "千" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 1000+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 1000 _ -> Nothing } @@ -323,7 +311,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -347,7 +335,6 @@ , ruleInteger7 , ruleInteger8 , ruleInteger9- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeral , ruleNumeralsPrefixWithNegativeOrMinus
Duckling/Numeral/KA/Rules.hs view
@@ -10,7 +10,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.KA.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap) import Data.Maybe@@ -27,20 +28,6 @@ import Duckling.Types import qualified Duckling.Numeral.Types as TNumeral -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleNumeralMap :: HashMap Text Integer ruleNumeralMap = HashMap.fromList [ ( "ნული", 0 )@@ -70,6 +57,5 @@ rules :: [Rule] rules =- [ ruleIntegerNumeric- , ruleNumeral+ [ ruleNumeral ]
Duckling/Numeral/KO/Rules.hs view
@@ -10,20 +10,33 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.KO.Rules- ( rules ) where+ ( rules+ ) where +import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral +integerForOrdinalsMap :: HashMap Text Integer+integerForOrdinalsMap = HashMap.fromList+ [ ( "한", 1 )+ , ( "첫", 1 )+ , ( "두", 2 )+ , ( "세", 3 )+ , ( "네", 4 )+ ]+ ruleIntegerForOrdinals :: Rule ruleIntegerForOrdinals = Rule { name = "integer (1..4) - for ordinals"@@ -31,26 +44,8 @@ [ regex "(한|첫|두|세|네)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "한" -> integer 1- "첫" -> integer 1- "두" -> integer 2- "세" -> integer 3- "네" -> integer 4- _ -> Nothing- _ -> Nothing- }--ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integerForOrdinalsMap >>= integer _ -> Nothing } @@ -71,7 +66,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -86,19 +81,19 @@ _ -> Nothing } -ruleFraction2 :: Rule-ruleFraction2 = Rule+ruleFraction :: Rule+ruleFraction = Rule { name = "fraction" , pattern = [ dimension Numeral- , regex "/"+ , regex "분(의|에)" , dimension Numeral ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):- _) -> double $ v1 / v2+ Token Numeral NumeralData{TNumeral.value = v2}:+ _) -> double $ v2 / v1 _ -> Nothing } @@ -132,6 +127,19 @@ , prod = \_ -> integer 0 } +integerTypeAndOrdinalsMap :: HashMap Text Integer+integerTypeAndOrdinalsMap = HashMap.fromList+ [ ( "열", 10 )+ , ( "스물", 20 )+ , ( "서른", 30 )+ , ( "마흔", 40 )+ , ( "쉰", 50 )+ , ( "예순", 60 )+ , ( "일흔", 70 )+ , ( "여든", 80 )+ , ( "아흔", 90 )+ ]+ ruleIntegerTypeAndOrdinals :: Rule ruleIntegerTypeAndOrdinals = Rule { name = "integer (20..90) - TYPE 2 and ordinals"@@ -139,20 +147,25 @@ [ regex "(열|스물|서른|마흔|쉰|예순|일흔|여든|아흔)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "열" -> integer 10- "스물" -> integer 20- "서른" -> integer 30- "마흔" -> integer 40- "쉰" -> integer 50- "예순" -> integer 60- "일흔" -> integer 70- "여든" -> integer 80- "아흔" -> integer 90- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integerTypeAndOrdinalsMap >>= integer _ -> Nothing } +integerType1Map :: HashMap Text Integer+integerType1Map = HashMap.fromList+ [ ( "영", 0 )+ , ( "일", 1 )+ , ( "이", 2 )+ , ( "삼", 3 )+ , ( "사", 4 )+ , ( "오", 5 )+ , ( "육", 6 )+ , ( "칠", 7 )+ , ( "팔", 8 )+ , ( "구", 9 )+ ]+ ruleIntegerType1 :: Rule ruleIntegerType1 = Rule { name = "integer - TYPE 1"@@ -160,21 +173,21 @@ [ regex "(영|일|이|삼|사|오|육|칠|팔|구)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "영" -> integer 0- "일" -> integer 1- "이" -> integer 2- "삼" -> integer 3- "사" -> integer 4- "오" -> integer 5- "육" -> integer 6- "칠" -> integer 7- "팔" -> integer 8- "구" -> integer 9- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integerType1Map >>= integer _ -> Nothing } +integerType1PowersOfTenMap :: HashMap Text (Double, Int)+integerType1PowersOfTenMap = HashMap.fromList+ [ ( "십", (10, 1) )+ , ( "백", (1e2, 2) )+ , ( "천", (1e3, 3) )+ , ( "만", (1e4, 4) )+ , ( "억", (1e8, 8) )+ , ( "조", (1e12, 12) )+ ]+ ruleIntegerType1PowersOfTen :: Rule ruleIntegerType1PowersOfTen = Rule { name = "integer - TYPE 1: powers of ten"@@ -182,14 +195,10 @@ [ regex "(십|백|천|만|억|조)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "십" -> double 10 >>= withGrain 1 >>= withMultipliable- "백" -> double 1e2 >>= withGrain 2 >>= withMultipliable- "천" -> double 1e3 >>= withGrain 3 >>= withMultipliable- "만" -> double 1e4 >>= withGrain 4 >>= withMultipliable- "억" -> double 1e8 >>= withGrain 8 >>= withMultipliable- "조" -> double 1e12 >>= withGrain 12 >>= withMultipliable- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ do+ (value, grain) <- HashMap.lookup match integerType1PowersOfTenMap+ double value >>= withGrain grain >>= withMultipliable _ -> Nothing } @@ -198,14 +207,13 @@ { name = "intersect 2 numbers" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ]- , prod = \tokens ->- case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):- _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2- _ -> Nothing+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2+ _ -> Nothing } ruleMultiply :: Rule@@ -213,13 +221,26 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2 _ -> Nothing } +integerType2Map :: HashMap Text Integer+integerType2Map = HashMap.fromList+ [ ( "하나", 1 )+ , ( "둘", 2 )+ , ( "셋", 3 )+ , ( "넷", 4 )+ , ( "다섯", 5 )+ , ( "여섯", 6 )+ , ( "일곱", 7 )+ , ( "여덟", 8 )+ , ( "아홉", 9 )+ ]+ ruleIntegerType2 :: Rule ruleIntegerType2 = Rule { name = "integer (1..10) - TYPE 2"@@ -227,33 +248,8 @@ [ regex "(하나|둘|셋|넷|다섯|여섯|일곱|여덟|아홉)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "하나" -> integer 1- "둘" -> integer 2- "셋" -> integer 3- "넷" -> integer 4- "다섯" -> integer 5- "여섯" -> integer 6- "일곱" -> integer 7- "여덟" -> integer 8- "아홉" -> integer 9- _ -> Nothing- _ -> Nothing- }--ruleFraction :: Rule-ruleFraction = Rule- { name = "fraction"- , pattern =- [ dimension Numeral- , regex "분(의|에)"- , dimension Numeral- ]- , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- _:- Token Numeral (NumeralData {TNumeral.value = v2}):- _) -> double $ v2 / v1+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integerType2Map >>= integer _ -> Nothing } @@ -265,7 +261,7 @@ , regex "(점|쩜)((영|일|이|삼|사|오|육|칠|팔|구)+)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: Token RegexMatch (GroupMatch (_:match:_)): _) -> do let getDigit '영' = Just "0"@@ -292,8 +288,8 @@ , oneOf [1 .. 9] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -306,7 +302,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -316,11 +312,9 @@ , ruleDecimalWithThousandsSeparator , ruleFew , ruleFraction- , ruleFraction2 , ruleHalf , ruleInteger , ruleIntegerForOrdinals- , ruleIntegerNumeric , ruleIntegerType1 , ruleIntegerType1PowersOfTen , ruleSum
Duckling/Numeral/MY/Corpus.hs view
@@ -43,6 +43,7 @@ [ "၃" , "သုံး" , "တတိယ"+ , "3" ] , examples (NumeralValue 30) [ "သုံးဆယ်"
Duckling/Numeral/MY/Rules.hs view
@@ -10,17 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.MY.Rules- ( rules ) where+ ( rules+ ) where -import Prelude+import Data.HashMap.Strict (HashMap) import Data.String-+import Data.Text (Text) import Duckling.Dimensions.Types import Duckling.Numeral.Helpers-import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral+import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Regex.Types import Duckling.Types+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text+import qualified Duckling.Numeral.Types as TNumeral ruleInteger5 :: Rule ruleInteger5 = Rule@@ -31,32 +35,36 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 * 10 _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule+integer09Map :: HashMap Text Integer+integer09Map = HashMap.fromList+ [ ( "၀", 0 )+ , ( "၁", 1 )+ , ( "၂", 2 )+ , ( "၃", 3 )+ , ( "၄", 4 )+ , ( "၅", 5 )+ , ( "၆", 6 )+ , ( "၇", 7 )+ , ( "၈", 8 )+ , ( "၉", 9 )+ ]++ruleInteger09 :: Rule+ruleInteger09 = Rule { name = "integer (0..9) - numeric" , pattern = [ regex "(၀|၁|၂|၃|၄|၅|၆|၇|၈|၉)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "၀" -> integer 0- "၁" -> integer 1- "၂" -> integer 2- "၃" -> integer 3- "၄" -> integer 4- "၅" -> integer 5- "၆" -> integer 6- "၇" -> integer 7- "၈" -> integer 8- "၉" -> integer 9- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integer09Map >>= integer _ -> Nothing } @@ -68,10 +76,17 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 10+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 10 _ -> Nothing } +integerPaliMap :: HashMap Text Integer+integerPaliMap = HashMap.fromList+ [ ( "ပထမ", 1 )+ , ( "ဒုတိယ", 2 )+ , ( "တတိယ", 3 )+ ]+ ruleIntegerPali :: Rule ruleIntegerPali = Rule { name = "integer (1..3) - pali"@@ -79,11 +94,8 @@ [ regex "(ပထမ|ဒုတိယ|တတိယ)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "ပထမ" -> integer 1- "ဒုတိယ" -> integer 2- "တတိယ" -> integer 3- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integerPaliMap >>= integer _ -> Nothing } @@ -95,7 +107,7 @@ , regex "ရာ" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 100+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 100 _ -> Nothing } @@ -107,7 +119,7 @@ , regex "ထောင်" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 1000+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 1000 _ -> Nothing } @@ -119,7 +131,7 @@ , regex "သောင်း" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 10000+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10000 _ -> Nothing } @@ -140,10 +152,24 @@ , regex "ဆယ်" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 10+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10 _ -> Nothing } +integer2Map :: HashMap Text Integer+integer2Map = HashMap.fromList+ [ ( "တစ်", 1 )+ , ( "နှစ်", 2 )+ , ( "သုံး", 3 )+ , ( "လေး", 4 )+ , ( "ငါး", 5 )+ , ( "ခြေါက်", 6 )+ , ( "ခုနှစ်", 7 )+ , ( "ရှစ်", 8 )+ , ( "ကိုး", 9 )+ , ( "တစ်ဆယ်", 10 )+ ]+ ruleInteger2 :: Rule ruleInteger2 = Rule { name = "integer (1..10)"@@ -151,18 +177,8 @@ [ regex "(တစ်|နှစ်|သုံး|လေး|ငါး|ခြေါက်|ခုနှစ်|ရှစ်|ကိုး|တစ်ဆယ်)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of- "တစ်" -> integer 1- "နှစ်" -> integer 2- "သုံး" -> integer 3- "လေး" -> integer 4- "ငါး" -> integer 5- "ခြေါက်" -> integer 6- "ခုနှစ်" -> integer 7- "ရှစ်" -> integer 8- "ကိုး" -> integer 9- "တစ်ဆယ်" -> integer 10- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup match integer2Map >>= integer _ -> Nothing } @@ -176,6 +192,6 @@ , ruleInteger6 , ruleInteger7 , ruleInteger8- , ruleIntegerNumeric+ , ruleInteger09 , ruleIntegerPali ]
Duckling/Numeral/NB/Rules.hs view
@@ -10,22 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.NB.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectWithAnd :: Rule ruleIntersectWithAnd = Rule@@ -33,12 +34,12 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "og"- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}: _:- Token Numeral (NumeralData {TNumeral.value = val2}):+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -47,27 +48,14 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|minus\\s?|negativ\\s?"- , dimension Numeral+ [ regex "-|minus|negativ"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -85,9 +73,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -97,7 +83,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -124,8 +110,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -144,11 +130,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -161,7 +147,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -249,8 +235,8 @@ _ -> Nothing } -dozensMap :: HashMap Text Integer-dozensMap = HashMap.fromList+tensMap :: HashMap Text Integer+tensMap = HashMap.fromList [ ( "tyve" , 20 ) , ( "tjue" , 20 ) , ( "tredve" , 30 )@@ -272,7 +258,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- HashMap.lookup (Text.toLower match) dozensMap >>= integer+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } @@ -298,7 +284,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -312,7 +298,6 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleIntersectWithAnd
+ Duckling/Numeral/NE/Corpus.hs view
@@ -0,0 +1,86 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Numeral.NE.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Numeral.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale NE Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (NumeralValue 0)+ [ "शुन्य"+ , "सुन्ना"+ ]+ , examples (NumeralValue 1)+ [ "एक"+ ]+ , examples (NumeralValue 2)+ [ "दुई"+ ]+ , examples (NumeralValue 3)+ [ "तीन"+ ]+ , examples (NumeralValue 4)+ [ "चार"+ ]+ , examples (NumeralValue 5)+ [ "पाँच"+ ]+ , examples (NumeralValue 6)+ [ "छ"+ ]+ , examples (NumeralValue 7)+ [ "सात"+ ]+ , examples (NumeralValue 8)+ [ "आठ"+ ]+ , examples (NumeralValue 9)+ [ "नौ"+ ]+ , examples (NumeralValue 10)+ [ "दश"+ ]+ , examples (NumeralValue 11)+ [ "एघार"+ ]+ , examples (NumeralValue 12)+ [ "बाह्र"+ ]+ , examples (NumeralValue 20)+ [ "बिस"+ ]+ , examples (NumeralValue 21)+ [ "एक्काइस"+ ]+ , examples (NumeralValue 22)+ [ "बाइस"+ ]+ , examples (NumeralValue 26)+ [ "छब्बिस"+ ]+ , examples (NumeralValue 30)+ [ "तिस"+ ]+ , examples (NumeralValue 50)+ [ "पचास"+ ]+ ]
+ Duckling/Numeral/NE/Rules.hs view
@@ -0,0 +1,125 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-}++module Duckling.Numeral.NE.Rules+ ( rules+ ) where++import Control.Applicative ((<|>))+import Data.HashMap.Strict (HashMap)+import Data.Maybe+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral++zeroToNineteenMap :: HashMap Text Integer+zeroToNineteenMap = HashMap.fromList+ [ ( "शुन्य", 0 )+ , ( "सुन्ना", 0 )+ , ( "एक", 1 )+ , ( "दुई", 2 )+ , ( "तीन", 3 )+ , ( "चार", 4 )+ , ( "पाँच", 5 )+ , ( "छ", 6 )+ , ( "सात", 7 )+ , ( "आठ", 8 )+ , ( "नौ", 9 )+ , ( "दश", 10 )+ , ( "एघार", 11 )+ , ( "बाह्र", 12 )+ , ( "तेह्र", 13 )+ , ( "चौध", 14 )+ , ( "पन्ध्र", 15 )+ , ( "सोह्र", 16 )+ , ( "सत्र", 17 )+ , ( "अठार", 18 )+ , ( "उन्नाइस", 19 )+ ]++ruleToNineteen :: Rule+ruleToNineteen = Rule+ { name = "integer (0..19)"+ , pattern =+ [ regex "(शुन्य|सुन्ना|एक|दुई|तीन|चार|पाँच|छ|सात|आठ|नौ|दश|एघार|बाह्र|तेह्र|चौध|पन्ध्र|सोह्र|सत्र|अठार|उन्नाइस)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) zeroToNineteenMap >>= integer+ _ -> Nothing+ }++twentyoneToTwentynineMap :: HashMap Text Integer+twentyoneToTwentynineMap = HashMap.fromList+ [ ( "एक्काइस", 21 )+ , ( "बाइस", 22 )+ , ( "तेइस", 23 )+ , ( "चौबिस", 24 )+ , ( "पच्चिस", 25 )+ , ( "छब्बिस", 26 )+ , ( "सत्ताइस", 27 )+ , ( "अट्ठाइस", 28 )+ , ( "उनन्तिस", 29 )+ ]++ruleTwentyoneToTwentynine :: Rule+ruleTwentyoneToTwentynine = Rule+ { name = "number (21..29)"+ , pattern =+ [ regex "(एक्काइस|बाइस|तेइस|चौबिस|पच्चिस|छब्बिस|सत्ताइस|अट्ठाइस|उनन्तिस)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) twentyoneToTwentynineMap >>= integer+ _ -> Nothing+ }++tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ( "बिस", 20 )+ , ( "तिस", 30 )+ , ( "चालिस", 40 )+ , ( "पचास", 50 )+ , ( "साठी", 60 )+ , ( "सत्तरी", 70 )+ , ( "असी", 80 )+ , ( "नब्बे", 90 )+ ]++ruleTens :: Rule+ruleTens = Rule+ { name = "integer (20..90)"+ , pattern =+ [ regex "(बिस|तिस|चालिस|पचास|साठी|सत्तरी|असी|नब्बे)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) tensMap >>= integer+ _ -> Nothing+ }+++rules :: [Rule]+rules =+ [ ruleToNineteen+ , ruleTwentyoneToTwentynine+ , ruleTens+ ]
Duckling/Numeral/NL/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.NL.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -94,5 +95,11 @@ ] , examples (NumeralValue 20000) [ "twintig duizend"+ ]+ , examples (NumeralValue 0.2)+ [ "1/5"+ , "2/10"+ , "3/15"+ , "20/100" ] ]
Duckling/Numeral/NL/Rules.hs view
@@ -7,52 +7,40 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.NL.Rules- ( rules ) where+ ( rules+ ) where -import Control.Monad (join) import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithNegativeOrMinus :: Rule ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern = [ regex "-|min|minus|negatief"- , dimension Numeral+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -79,9 +67,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -98,6 +84,7 @@ _ -> Nothing } +-- TODO: Single-word composition (#110) ruleInteger3 :: Rule ruleInteger3 = Rule { name = "integer ([2-9][1-9])"@@ -117,7 +104,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -129,11 +116,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , dimension Numeral+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -146,7 +133,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -165,9 +152,9 @@ , oneOf [20, 30 .. 90] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -288,7 +275,6 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntersect , ruleMultiply , ruleNumeralsEn
Duckling/Numeral/PL/Rules.hs view
@@ -10,19 +10,20 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.PL.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleSixteen :: Rule ruleSixteen = Rule@@ -66,12 +67,12 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "i|a"- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}: _:- Token Numeral (NumeralData {TNumeral.value = val2}):+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -80,8 +81,8 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|minus\\s?|negative\\s?"- , dimension Numeral+ [ regex "-|minus|negative"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))@@ -97,19 +98,6 @@ , prod = \_ -> integer 1 } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleTen :: Rule ruleTen = Rule { name = "ten"@@ -127,8 +115,8 @@ , numberBetween 10 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double (v1 * 100 + v2) _ -> Nothing }@@ -141,7 +129,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -341,11 +329,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -355,7 +343,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -388,7 +376,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -505,8 +493,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -542,7 +530,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -573,7 +561,6 @@ , ruleFourteen , ruleFourty , ruleInteger2- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleIntersectWithAnd
Duckling/Numeral/PT/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.PT.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Numeral.Types@@ -33,6 +34,8 @@ [ "2" , "dois" , "duas"+ , "pares de"+ , "um par de" ] , examples (NumeralValue 3) [ "3"@@ -52,6 +55,7 @@ , "doze" , "uma dúzia" , "uma duzia"+ , "uma duzias de" ] , examples (NumeralValue 14) [ "14"@@ -120,12 +124,17 @@ , examples (NumeralValue 0.77) [ "0,77" , ",77"+ , "ponto setenta e sete" ]+ , examples (NumeralValue 1000)+ [ "mil"+ ] , examples (NumeralValue 100000) [ "100.000" , "100000" , "100K" , "100k"+ , "100.000,00" ] , examples (NumeralValue 100) [ "100"@@ -150,6 +159,9 @@ [ "oitocentos e noventa e um" , "891" ]+ , examples (NumeralValue 2200)+ [ "dois mil e duzentos"+ ] , examples (NumeralValue 3000000) [ "3M" , "3000K"@@ -170,10 +182,20 @@ , "-1,2M" , "-1200K" , "-,0012G"+ , "negativo 1,2M" ] , examples (NumeralValue 1.5) [ "1 ponto cinco" , "um ponto cinco" , "1,5"+ ]+ , examples (NumeralValue 1200000.42)+ [ "1.200.000,42"+ ]+ , examples (NumeralValue 0.2)+ [ "1/5"+ , "2/10"+ , "3/15"+ , "20/100" ] ]
Duckling/Numeral/PT/Rules.hs view
@@ -8,300 +8,381 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-} module Duckling.Numeral.PT.Rules- ( rules ) where+ ( rules+ ) where +import Control.Applicative ((<|>))+import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral -ruleNumeralsPrefixWithNegativeOrMinus :: Rule-ruleNumeralsPrefixWithNegativeOrMinus = Rule- { name = "numbers prefix with -, negative or minus"+ruleDozen :: Rule+ruleDozen = Rule+ { name = "a dozen of" , pattern =- [ regex "-|menos"- , dimension Numeral+ [ regex "(uma )?d(u|ú)zias?( de)?" ]+ , prod = \_ -> integer 12 >>= withMultipliable >>= notOkForAnyTime+ }++zeroNineteenMap :: HashMap Text Integer+zeroNineteenMap = HashMap.fromList+ [ ( "zero" , 0 )+ , ( "um" , 1 )+ , ( "uma" , 1 )+ , ( "dois" , 2 )+ , ( "duas" , 2 )+ , ( "tres" , 3 )+ , ( "três" , 3 )+ , ( "quatro" , 4 )+ , ( "cinco" , 5 )+ , ( "seis" , 6 )+ , ( "sete" , 7 )+ , ( "oito" , 8 )+ , ( "nove" , 9 )+ , ( "dez" , 10 )+ , ( "onze" , 11 )+ , ( "doze" , 12 )+ , ( "treze" , 13 )+ , ( "catorze" , 14 )+ , ( "quatorze" , 14 )+ , ( "quinze" , 15 )+ , ( "dezesseis" , 16 )+ , ( "dezasseis" , 16 )+ , ( "dezessete" , 17 )+ , ( "dezassete" , 17 )+ , ( "dezoito" , 18 )+ , ( "dezenove" , 19 )+ , ( "dezanove" , 19 )+ ]++informalMap :: HashMap Text Integer+informalMap = HashMap.fromList+ [ ( "um par" , 2 )+ , ( "um par de" , 2 )+ , ( "par" , 2 )+ , ( "pares" , 2 )+ , ( "par de" , 2 )+ , ( "pares de" , 2 )+ , ( "um pouco" , 3 )+ , ( "pouco" , 3 )+ ]++ruleToNineteen :: Rule+ruleToNineteen = Rule+ { name = "integer (0..19)"+ , pattern =+ [ regex "(zero|d(oi|ua)s|(uma? )?par(es)?( de)?|tr(e|ê)s|(um )?pouco|uma?|(c|qu)atorze|quatro|quinze|cinco|dez[ea]sseis|seis|dez[ea]ssete|sete|dezoito|oito|dez[ea]nove|nove|dez|onze|doze|treze)"+ ] , prod = \tokens -> case tokens of- (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ let x = Text.toLower match in+ (HashMap.lookup x zeroNineteenMap >>= integer) <|>+ (HashMap.lookup x informalMap >>= integer >>= notOkForAnyTime) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"+tensMap :: HashMap Text Integer+tensMap = HashMap.fromList+ [ ( "vinte" , 20 )+ , ( "trinta" , 30 )+ , ( "quarenta" , 40 )+ , ( "cincoenta" , 50 )+ , ( "cinquenta" , 50 )+ , ( "cinqüenta" , 50 )+ , ( "sessenta" , 60 )+ , ( "setenta" , 70 )+ , ( "oitenta" , 80 )+ , ( "noventa" , 90 )+ ]++ruleTens :: Rule+ruleTens = Rule+ { name = "tens (20..90)" , pattern =- [ regex "(\\d{1,18})"+ [ regex "(vinte|trinta|quarenta|cin(co|q[uü])enta|sessenta|setenta|oitenta|noventa)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } -ruleDecimalWithThousandsSeparator :: Rule-ruleDecimalWithThousandsSeparator = Rule- { name = "decimal with thousands separator"+centsMap :: HashMap Text Integer+centsMap = HashMap.fromList+ [ ( "cem" , 100 )+ , ( "cento" , 100 )+ , ( "duzentos" , 200 )+ , ( "trezentos" , 300 )+ , ( "quatrocentos" , 400 )+ , ( "quinhetos" , 500 )+ , ( "seiscentos" , 600 )+ , ( "setecentos" , 700 )+ , ( "oitocentos" , 800 )+ , ( "novecentos" , 900 )+ ]++ruleCent :: Rule+ruleCent = Rule+ { name = "hundreds (100..900)" , pattern =- [ regex "(\\d+(\\.\\d\\d\\d)+,\\d+)"+ [ regex "(cem|cento|duzentos|trezentos|quatrocentos|quinhetos|seiscentos|setecentos|oitocentos|novecentos)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match- in parseDouble fmt >>= double+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ HashMap.lookup (Text.toLower match) centsMap >>= integer _ -> Nothing } -ruleDecimalNumeral :: Rule-ruleDecimalNumeral = Rule- { name = "decimal number"+rulePowersOfTen :: Rule+rulePowersOfTen = Rule+ { name = "powers of tens" , pattern =- [ regex "(\\d*,\\d+)"+ [ regex "(milhao|milhão|milhões|milhoes|bilhao|bilhão|bilhões|bilhoes|mil)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> parseDecimal False match+ (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of+ "mil" -> double 1e3 >>= withGrain 3 >>= withMultipliable+ "milhao" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "milhão" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "milhões" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "milhoes" -> double 1e6 >>= withGrain 6 >>= withMultipliable+ "bilhao" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ "bilhão" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ "bilhões" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ "bilhoes" -> double 1e9 >>= withGrain 9 >>= withMultipliable+ _ -> Nothing _ -> Nothing } -ruleNumeral2 :: Rule-ruleNumeral2 = Rule- { name = "number (20..90)"+ruleCompositeTens :: Rule+ruleCompositeTens = Rule+ { name = "integer 21..99" , pattern =- [ regex "(vinte|trinta|quarenta|cincoenta|cinq(ü)enta|cinquenta|sessenta|setenta|oitenta|noventa)"+ [ oneOf [20,30..90]+ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "vinte" -> integer 20- "trinta" -> integer 30- "quarenta" -> integer 40- "cinq\252enta" -> integer 50- "cincoenta" -> integer 50- "cinquenta" -> integer 50- "sessenta" -> integer 60- "setenta" -> integer 70- "oitenta" -> integer 80- "noventa" -> integer 90- _ -> Nothing+ (Token Numeral NumeralData{TNumeral.value = tens}:+ Token Numeral NumeralData{TNumeral.value = units}:+ _) -> double $ tens + units _ -> Nothing } -ruleNumeral :: Rule-ruleNumeral = Rule- { name = "number (0..15)"+ruleDecsAnd :: Rule+ruleDecsAnd = Rule+ { name = "number (21..29 31..39 .. 91..99)" , pattern =- [ regex "(zero|uma?|d(oi|ua)s|tr(ê|e)s|quatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|(ca|qua)torze|quinze)"+ [ oneOf [20, 30..90]+ , regex "e"+ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "zero" -> integer 0- "uma" -> integer 1- "um" -> integer 1- "dois" -> integer 2- "duas" -> integer 2- "três" -> integer 3- "tres" -> integer 3- "quatro" -> integer 4- "cinco" -> integer 5- "seis" -> integer 6- "sete" -> integer 7- "oito" -> integer 8- "nove" -> integer 9- "dez" -> integer 10- "onze" -> integer 11- "doze" -> integer 12- "treze" -> integer 13- "catorze" -> integer 14- "quatorze" -> integer 14- "quinze" -> integer 15- _ -> Nothing+ (Token Numeral NumeralData{TNumeral.value = v1}:+ _:+ Token Numeral NumeralData{TNumeral.value = v2}:+ _) -> double $ v1 + v2 _ -> Nothing } -ruleNumeral5 :: Rule-ruleNumeral5 = Rule- { name = "number (16..19)"+ruleCompositeCents :: Rule+ruleCompositeCents = Rule+ { name = "integer 101..999" , pattern =- [ regex "(dez[ea]sseis|dez[ea]ssete|dezoito|dez[ea]nove)"+ [ oneOf [100, 200..900]+ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "dezesseis" -> integer 16- "dezasseis" -> integer 16- "dezessete" -> integer 17- "dezassete" -> integer 17- "dezoito" -> integer 18- "dezenove" -> integer 19- "dezanove" -> integer 19- _ -> Nothing+ (Token Numeral NumeralData{TNumeral.value = hundreds}:+ Token Numeral NumeralData{TNumeral.value = units}:+ _) -> double $ hundreds + units _ -> Nothing } -ruleNumeral3 :: Rule-ruleNumeral3 = Rule- { name = "number (16..19)"+ruleCentsAnd :: Rule+ruleCentsAnd = Rule+ { name = "number (101..199 201..299 .. 901..999)" , pattern =- [ numberWith TNumeral.value (== 10)+ [ oneOf [100, 200..900] , regex "e"- , numberBetween 6 10+ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ 10 + v+ (Token Numeral NumeralData{TNumeral.value = v1}:+ _:+ Token Numeral NumeralData{TNumeral.value = v2}:+ _) -> double $ v1 + v2 _ -> Nothing } -ruleNumeralsSuffixesKMG :: Rule-ruleNumeralsSuffixesKMG = Rule- { name = "numbers suffixes (K, M, G)"+ruleSkipHundreds :: Rule+ruleSkipHundreds = Rule+ { name = "one twenty two" , pattern =+ [ numberBetween 1 10+ , numberBetween 10 100+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = hundreds}:+ Token Numeral NumeralData{TNumeral.value = rest}:+ _) -> double $ hundreds*100 + rest+ _ -> Nothing+ }++ruleDotSpelledOut :: Rule+ruleDotSpelledOut = Rule+ { name = "one point 2"+ , pattern = [ dimension Numeral- , regex "([kmg])(?=[\\W\\$€]|$)"+ , regex "ponto"+ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):- Token RegexMatch (GroupMatch (match:_)):- _) -> case Text.toLower match of- "k" -> double $ v * 1e3- "m" -> double $ v * 1e6- "g" -> double $ v * 1e9- _ -> Nothing+ (Token Numeral nd1:_:Token Numeral nd2:_) ->+ double $ TNumeral.value nd1 + decimalsToDouble (TNumeral.value nd2) _ -> Nothing } -ruleNumeral6 :: Rule-ruleNumeral6 = Rule- { name = "number 100..1000 "+ruleLeadingDotSpelledOut :: Rule+ruleLeadingDotSpelledOut = Rule+ { name = "point 77" , pattern =- [- regex "(cem|cento|duzentos|trezentos|quatrocentos|quinhentos|seiscentos|setecentos|oitocentos|novecentos|mil)"+ [ regex "ponto"+ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "cento" -> integer 100- "cem" -> integer 100- "duzentos" -> integer 200- "trezentos" -> integer 300- "quatrocentos" -> integer 400- "quinhentos" -> integer 500- "seiscentos" -> integer 600- "setecentos" -> integer 700- "oitocentos" -> integer 800- "novecentos" -> integer 900- "mil" -> integer 1000- _ -> Nothing+ (_:Token Numeral nd:_) -> double . decimalsToDouble $ TNumeral.value nd _ -> Nothing } -ruleNumeral4 :: Rule-ruleNumeral4 = Rule- { name = "number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)"+ruleDecimals :: Rule+ruleDecimals = Rule+ { name = "decimal number" , pattern =- [ oneOf [70, 20, 60, 50, 40, 90, 30, 80]- , regex "e"- , numberBetween 1 10+ [ regex "(\\d*\\,\\d+)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- _:- Token Numeral (NumeralData {TNumeral.value = v2}):- _) -> double $ v1 + v2+ (Token RegexMatch (GroupMatch (match:_)):_) -> parseDecimal False match _ -> Nothing } -ruleDozen :: Rule-ruleDozen = Rule- { name = "dozen"+ruleCommas :: Rule+ruleCommas = Rule+ { name = "dot-separated numbers" , pattern =- [ regex "d(ú|u)zias?"+ [ regex "(\\d+(\\.\\d\\d\\d)+(\\,\\d+)?)" ]- , prod = \_ -> integer 12 >>= withGrain 1 >>= withMultipliable+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ parseDecimal False $ Text.replace "." Text.empty match+ _ -> Nothing } -ruleNumeralDozen :: Rule-ruleNumeralDozen = Rule- { name = "number dozen"+ruleSuffixes :: Rule+ruleSuffixes = Rule+ { name = "suffixes (K,M,G))" , pattern =- [ numberBetween 1 11- , dimension Numeral+ [ dimension Numeral+ , regex "(k|m|g)(?=[\\W$€¢£]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2, TNumeral.grain = Just g}):- _) -> double (v1 * v2) >>= withGrain g+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "k" -> double $ v * 1e3+ "m" -> double $ v * 1e6+ "g" -> double $ v * 1e9+ _ -> Nothing _ -> Nothing } -ruleNumerals :: Rule-ruleNumerals = Rule- { name = "numbers (100..999)"+ruleNegative :: Rule+ruleNegative = Rule+ { name = "negative numbers" , pattern =- [ numberBetween 100 1000- , regex "e"- , numberBetween 0 100+ [ regex "(-|menos|negativo)(?!\\s*\\-)"+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- _:- Token Numeral (NumeralData {TNumeral.value = v2}):- _) -> double $ v1 + v2+ (_:Token Numeral nd:_) -> double $ TNumeral.value nd * (-1) _ -> Nothing } -ruleNumeralDotNumeral :: Rule-ruleNumeralDotNumeral = Rule- { name = "number dot number"+ruleSum :: Rule+ruleSum = Rule+ { name = "intersect 2 numbers" , pattern =- [ dimension Numeral- , regex "ponto"- , numberWith TNumeral.grain isNothing+ [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral nd1:_:Token Numeral nd2:_) ->- double $ TNumeral.value nd1 + decimalsToDouble (TNumeral.value nd2)+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing } -ruleIntegerWithThousandsSeparator :: Rule-ruleIntegerWithThousandsSeparator = Rule- { name = "integer with thousands separator ."+ruleSumAnd :: Rule+ruleSumAnd = Rule+ { name = "intersect 2 numbers (with and)" , pattern =- [ regex "(\\d{1,3}(\\.\\d\\d\\d){1,5})"+ [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)+ , regex "e"+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton '.') Text.empty match- in parseDouble fmt >>= double+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ _:+ Token Numeral NumeralData{TNumeral.value = val2}:+ _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing } +ruleMultiply :: Rule+ruleMultiply = Rule+ { name = "compose by multiplication"+ , pattern =+ [ dimension Numeral+ , Predicate isMultipliable+ ]+ , prod = \tokens -> case tokens of+ (token1:token2:_) -> multiply token1 token2+ _ -> Nothing+ }+ rules :: [Rule] rules =- [ ruleDecimalNumeral- , ruleDecimalWithThousandsSeparator+ [ ruleToNineteen+ , ruleTens+ , ruleCent+ , rulePowersOfTen+ , ruleCompositeTens+ , ruleCompositeCents+ , ruleSkipHundreds+ , ruleDotSpelledOut+ , ruleLeadingDotSpelledOut+ , ruleDecimals+ , ruleCommas+ , ruleSuffixes+ , ruleNegative+ , ruleSum+ , ruleDecsAnd+ , ruleCentsAnd+ , ruleSumAnd+ , ruleMultiply , ruleDozen- , ruleIntegerNumeric- , ruleIntegerWithThousandsSeparator- , ruleNumeral- , ruleNumeral2- , ruleNumeral3- , ruleNumeral4- , ruleNumeral5- , ruleNumeral6- , ruleNumeralDotNumeral- , ruleNumeralDozen- , ruleNumerals- , ruleNumeralsPrefixWithNegativeOrMinus- , ruleNumeralsSuffixesKMG ]
Duckling/Numeral/RO/Rules.hs view
@@ -10,48 +10,36 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.RO.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralsPrefixWithOrMinus :: Rule ruleNumeralsPrefixWithOrMinus = Rule { name = "numbers prefix with - or minus" , pattern =- [ regex "-|minus\\s?"- , dimension Numeral+ [ regex "-|minus"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v- _ -> Nothing- }- ruleSpecialCompositionForMissingHundredsLikeInOneTwentyTwo :: Rule ruleSpecialCompositionForMissingHundredsLikeInOneTwentyTwo = Rule { name = "special composition for missing hundreds like in one twenty two"@@ -60,8 +48,8 @@ , numberBetween 11 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = hundreds}):- Token Numeral (NumeralData {TNumeral.value = rest}):+ (Token Numeral NumeralData{TNumeral.value = hundreds}:+ Token Numeral NumeralData{TNumeral.value = rest}: _) -> double $ hundreds * 100 + rest _ -> Nothing }@@ -74,9 +62,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -101,8 +87,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -112,7 +98,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -124,11 +110,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , dimension Numeral+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -139,12 +125,12 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "(s|ș)i"- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}: _:- Token Numeral (NumeralData {TNumeral.value = val2}):+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -153,11 +139,11 @@ ruleNumeralsSuffixesWithNegativ = Rule { name = "numbers suffixes with (negativ)" , pattern =- [ dimension Numeral- , regex "(negativ|neg)"+ [ Predicate isPositive+ , regex "neg(ativ)?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ v * (-1) _ -> Nothing }@@ -291,7 +277,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton '.') Text.empty match+ _) -> let fmt = Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -305,7 +291,6 @@ , ruleInteger2 , ruleInteger3 , ruleIntegerCuSeparatorDeMiiDot- , ruleIntegerNumeric , ruleIntersect , ruleIntersectCuI , ruleMultiply
Duckling/Numeral/RU/Corpus.hs view
@@ -27,6 +27,7 @@ [ examples (NumeralValue 0) [ "0" , "ноль"+ , "нисколько" ] , examples (NumeralValue 1) [ "1"@@ -57,6 +58,10 @@ , "тридцать три" , "0033" ]+ , examples (NumeralValue 11)+ [ "11"+ , "одиннадцать"+ ] , examples (NumeralValue 14) [ "14" , "четырнадцать"@@ -73,9 +78,26 @@ [ "18" , "восемнадцать" ]+ , examples (NumeralValue 312)+ [ "триста двенадцать"+ , "312"+ ]+ , examples (NumeralValue 444)+ [ "четыреста сорок четыре"+ , "444"+ ] , examples (NumeralValue 525) [ "пятьсот двадцать пять" , "525"+ ]+ , examples (NumeralValue 1.5)+ [ "1.5"+ , "полторы"+ , "один с половиной"+ ]+ , examples (NumeralValue 3.5)+ [ "3.5"+ , "три с половиной" ] , examples (NumeralValue 1.1) [ "1.1"
Duckling/Numeral/RU/Rules.hs view
@@ -10,25 +10,26 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.RU.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text+import Data.String import Data.Text (Text) import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral -dozensMap :: HashMap Text Integer-dozensMap = HashMap.fromList+tensMap :: HashMap Text Integer+tensMap = HashMap.fromList [ ( "двадцать", 20) , ( "тридцать", 30) , ( "сорок", 40)@@ -47,20 +48,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- HashMap.lookup (Text.toLower match) dozensMap >>= integer- _ -> Nothing- }--ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- toInteger <$> parseInt match- integer v+ HashMap.lookup (Text.toLower match) tensMap >>= integer _ -> Nothing } @@ -72,7 +60,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -96,12 +84,33 @@ , prod = \_ -> integer 2 } +ruleDecimalOneAndAHalf :: Rule+ruleDecimalOneAndAHalf = Rule+ { name = "decimal one and a half"+ , pattern =+ [ regex "(полтора|полторы|полутора)"+ ]+ , prod = \_ -> double 1.5+ }++ruleIntegerAndAHalf :: Rule+ruleIntegerAndAHalf = Rule+ { name = "<integer> and a half"+ , pattern =+ [ Predicate isNatural+ , regex "с половиной"+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 0.5+ _ -> Nothing+ }+ hundredsMap :: HashMap Text Integer hundredsMap = HashMap.fromList [ ( "сто", 100) , ( "двести", 200)- , ( "тристо", 300)- , ( "четыресто", 400)+ , ( "триста", 300)+ , ( "четыреста", 400) , ( "пятьсот", 500) , ( "шестьсот", 600) , ( "семьсот", 700)@@ -113,7 +122,7 @@ ruleInteger6 = Rule { name = "integer (100..900)" , pattern =- [ regex "(сто|двести|тристо|четыресто|пятьсот|шестьсот|семьсот|восемьсот|девятьсот)"+ [ regex "(сто|двести|триста|четыреста|пятьсот|шестьсот|семьсот|восемьсот|девятьсот)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->@@ -125,8 +134,8 @@ ruleNumeralsPrefixWithMinus = Rule { name = "numbers prefix with -, minus" , pattern =- [ regex "-|минус\\s?"- , dimension Numeral+ [ regex "-|минус"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))@@ -141,7 +150,7 @@ , regex "((к|м|г)|(К|М|Г))(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "к" -> double $ v * 1e3@@ -162,8 +171,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -176,8 +185,8 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -186,7 +195,7 @@ ruleInteger = Rule { name = "integer 0" , pattern =- [ regex "(ноль)"+ [ regex "(ноль|нуля|нисколько)" ] , prod = \_ -> integer 0 }@@ -201,7 +210,7 @@ , ( "восемь", 8) , ( "девять", 9) , ( "десять", 10)- , ( "одинадцать", 11)+ , ( "одиннадцать", 11) , ( "двенадцать", 12) , ( "тринадцать", 13) , ( "четырнадцать", 14)@@ -216,7 +225,7 @@ ruleInteger4 = Rule { name = "integer (3..19)" , pattern =- [ regex "(три|четырнадцать|четыре|пятнадцать|пять|шестнадцать|шесть|семнадцать|семь|восемнадцать|восемь|девятнадцать|девять|десять|одинадцать|двенадцать|тринадцать)"+ [ regex "(три|четырнадцать|четыре|пятнадцать|пять|шестнадцать|шесть|семнадцать|семь|восемнадцать|восемь|девятнадцать|девять|десять|одиннадцать|двенадцать|тринадцать)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->@@ -255,7 +264,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -271,7 +280,8 @@ , ruleInteger6 , ruleInteger7 , ruleInteger8- , ruleIntegerNumeric+ , ruleIntegerAndAHalf+ , ruleDecimalOneAndAHalf , ruleIntegerWithThousandsSeparator , ruleNumeralDotNumeral , ruleNumeralsPrefixWithMinus
+ Duckling/Numeral/Rules.hs view
@@ -0,0 +1,54 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-}++module Duckling.Numeral.Rules+ ( rules+ ) where++import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Regex.Types+import Duckling.Types++ruleIntegerNumeric :: Rule+ruleIntegerNumeric = Rule+ { name = "integer (numeric)"+ , pattern =+ [ regex "(\\d{1,18})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ toInteger <$> parseInt match >>= integer+ _ -> Nothing+ }++ruleFractions :: Rule+ruleFractions = Rule+ { name = "fractional number"+ , pattern =+ [ regex "(\\d+)/(\\d+)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (numerator:denominator:_)):_) -> do+ n <- parseDecimal False numerator+ d <- parseDecimal False denominator+ divide n d >>= notOkForAnyTime+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleIntegerNumeric+ , ruleFractions+ ]
Duckling/Numeral/SV/Rules.hs view
@@ -10,22 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.SV.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleIntersectWithAnd :: Rule ruleIntersectWithAnd = Rule@@ -33,12 +34,12 @@ , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1) , regex "och"- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}: _:- Token Numeral (NumeralData {TNumeral.value = val2}):+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -47,30 +48,16 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|minus\\s?|negativ\\s?"- , dimension Numeral+ [ regex "-|minus|negativ"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:- Token Numeral (NumeralData {TNumeral.value = v}):+ Token Numeral NumeralData{TNumeral.value = v}: _) -> double $ v * (-1) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):- _) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleFew :: Rule ruleFew = Rule { name = "few"@@ -87,10 +74,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -115,8 +100,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -135,11 +120,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -149,7 +134,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -164,7 +149,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -295,7 +280,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton '.') Text.empty match+ _) -> let fmt = Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -310,7 +295,6 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleIntersectWithAnd
Duckling/Numeral/TR/Rules.hs view
@@ -10,22 +10,23 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.TR.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.HashMap.Strict (HashMap) import Data.Maybe-import qualified Data.Text as Text+import Data.String import Data.Text (Text) import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral hundredsMap :: HashMap Text Integer hundredsMap = HashMap.fromList@@ -57,28 +58,15 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|eksi\\s?|negatif\\s?"- , dimension Numeral+ [ regex "-|eksi|negatif"+ , Predicate isPositive ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double (v * (- 1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleACoupleOf :: Rule ruleACoupleOf = Rule { name = "a couple (of)"@@ -113,10 +101,8 @@ [ regex "(\\d+(\\.\\d\\d\\d)+,\\d+)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- let dot = Text.singleton '.'- comma = Text.singleton ','- fmt = Text.replace comma dot $ Text.replace dot Text.empty match+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> let fmt = Text.replace "," "." $ Text.replace "." Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -126,11 +112,11 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1}):- Token Numeral (NumeralData {TNumeral.value = val2, TNumeral.grain = g2}):+ (Token Numeral NumeralData{TNumeral.value = val1}:+ Token Numeral NumeralData{TNumeral.value = val2, TNumeral.grain = g2}: _) | isNothing g2 || (isJust g2 && val2 > val1) -> case g2 of Nothing -> double $ val1 * val2 Just g -> double (val1 * val2) >>= withGrain g@@ -320,11 +306,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -337,7 +323,7 @@ , regex "([kmgb])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -612,7 +598,7 @@ , regex "(buçuk)(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 0.5+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 0.5 _ -> Nothing } @@ -624,8 +610,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -683,9 +669,9 @@ , numberWith TNumeral.grain isNothing ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):+ (Token Numeral NumeralData{TNumeral.value = v1}: _:- Token Numeral (NumeralData {TNumeral.value = v2}):+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + decimalsToDouble v2 _ -> Nothing }@@ -698,7 +684,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton '.') Text.empty match) >>= double+ parseDouble (Text.replace "." Text.empty match) >>= double _ -> Nothing } @@ -720,7 +706,6 @@ , ruleInteger7 , ruleInteger8 , ruleInteger9- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect , ruleNumeralDotNumeral
Duckling/Numeral/Types.hs view
@@ -58,9 +58,6 @@ isInteger :: Double -> Bool isInteger = isJust . getIntValue -isNatural :: Double -> Bool-isNatural x = isInteger x && x > 0- isIntegerBetween :: Double -> Int -> Int -> Bool isIntegerBetween x low high = case getIntValue x of Just int -> low <= int && int <= high
Duckling/Numeral/UK/Rules.hs view
@@ -10,33 +10,34 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.UK.Rules- ( rules ) where+ ( rules+ ) where import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HashMap import Data.Maybe+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral twentyNinetyMap :: HashMap Text Integer twentyNinetyMap = HashMap.fromList- [ ( "двадцять" , 20 )- , ( "тридцять" , 30 )- , ( "сорок" , 40 )- , ( "п‘ятдесят" , 50 )- , ( "шістдесят" , 60 )- , ( "сімдесят" , 70 )- , ( "дев‘яносто" , 90 )- , ( "вісімдесят" , 80 )+ [ ( "двадцять" , 20 )+ , ( "тридцять" , 30 )+ , ( "сорок" , 40 )+ , ( "п‘ятдесят" , 50 )+ , ( "шістдесят" , 60 )+ , ( "сімдесят" , 70 )+ , ( "дев‘яносто", 90 )+ , ( "вісімдесят", 80 ) ] ruleInteger5 :: Rule@@ -51,19 +52,6 @@ _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleDecimalWithThousandsSeparator :: Rule ruleDecimalWithThousandsSeparator = Rule { name = "decimal with thousands separator"@@ -72,7 +60,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -140,7 +128,7 @@ , regex "((к|м|г)|(К|М|Г))(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "к" -> double $ v * 1e3@@ -161,8 +149,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -175,8 +163,8 @@ , numberBetween 1 100 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -253,7 +241,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton ',') Text.empty match+ _) -> let fmt = Text.replace "," Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -270,7 +258,6 @@ , ruleInteger6 , ruleInteger7 , ruleInteger8- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeralDotNumeral , ruleNumeralsPrefixWithMinus
Duckling/Numeral/VI/Rules.hs view
@@ -10,20 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.VI.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral powersOfTenMap :: HashMap.HashMap Text.Text (Double, Int) powersOfTenMap = HashMap.fromList@@ -33,7 +34,7 @@ , ( "nghìn", (1e3, 3) ) , ( "triệ", (1e6, 6) ) , ( "triệu", (1e6, 6) )- , ( "t", (1e9, 9) )+ , ( "t", (1e9, 9) ) , ( "tỷ", (1e9, 9) ) ] @@ -44,39 +45,9 @@ [ regex "(trăm?|nghìn?|triệu?|tỷ?)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) ->- do- (value, grain) <- HashMap.lookup (Text.toLower match) powersOfTenMap- double value >>= withGrain grain >>= withMultipliable- _ -> Nothing- }--ruleIntersectWithAnd :: Rule-ruleIntersectWithAnd = Rule- { name = "intersect (with and)"- , pattern =- [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , regex "and"- , numberWith TNumeral.multipliable not- ]- , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- _:- Token Numeral (NumeralData {TNumeral.value = val2}):- _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2- _ -> Nothing- }--ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v+ (value, grain) <- HashMap.lookup (Text.toLower match) powersOfTenMap+ double value >>= withGrain grain >>= withMultipliable _ -> Nothing } @@ -84,8 +55,8 @@ ruleNumeralsPrefixWithM = Rule { name = "numbers prefix with -, âm" , pattern =- [ regex "-|âm\\s?"- , dimension Numeral+ [ regex "\\-|âm"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1))@@ -100,7 +71,7 @@ , regex "lăm" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 5+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 5 _ -> Nothing } @@ -112,7 +83,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -135,8 +106,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -160,11 +131,11 @@ { name = "intersect" , pattern = [ numberWith (fromMaybe 0 . TNumeral.grain) (>1)- , numberWith TNumeral.multipliable not+ , Predicate $ and . sequence [not . isMultipliable, isPositive] ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = val1, TNumeral.grain = Just g}):- Token Numeral (NumeralData {TNumeral.value = val2}):+ (Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:+ Token Numeral NumeralData{TNumeral.value = val2}: _) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2 _ -> Nothing }@@ -174,7 +145,7 @@ { name = "compose by multiplication" , pattern = [ dimension Numeral- , numberWith TNumeral.multipliable id+ , Predicate isMultipliable ] , prod = \tokens -> case tokens of (token1:token2:_) -> multiply token1 token2@@ -189,7 +160,7 @@ , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -199,61 +170,47 @@ _ -> Nothing } -ruleNumeralNghn :: Rule-ruleNumeralNghn = Rule- { name = "number nghìn"- , pattern =- [ numberBetween 1 1000- , numberWith TNumeral.value (== 1000)- ]- , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2, TNumeral.grain = Just g}):- _) -> double (v1 * v2) >>= withGrain g- _ -> Nothing- }- integerMap :: HashMap.HashMap Text.Text Integer integerMap = HashMap.fromList- [ ("không", 0)- , ("một", 1)- , ("linh một", 1)- , ("lẻ một", 1)- , ("hai", 2)- , ("lẻ hai", 2)- , ("linh hai", 2)- , ("ba", 3)- , ("lẻ", 3)- , ("linh ba", 3)- , ("lẻ bốn", 4)- , ("linh bốn", 4)- , ("bốn", 4)- , ("năm", 5)- , ("lẻ năm", 5)- , ("linh năm", 5)- , ("linh sáu", 6)- , ("sáu", 6)- , ("lẻ sáu", 6)- , ("linh bảy", 7)- , ("lẻ bảy", 7)- , ("bảy", 7)- , ("lẻ tám", 8)- , ("linh tám", 8)- , ("tám", 8)- , ("lẻ chín", 9)- , ("chín", 9)- , ("linh chín", 9)- , ("linh mười", 10)- , ("mười", 10)- , ("lẻ mười", 10)- , ("mười một", 11)- , ("mười hai", 12)- , ("mười ba", 13)- , ("mười bốn", 14)- , ("mười lăm", 15)- , ("mười sáu", 16)- , ("mười bảy", 17)- , ("mười tám", 18)+ [ ("không", 0)+ , ("một", 1)+ , ("linh một", 1)+ , ("lẻ một", 1)+ , ("hai", 2)+ , ("lẻ hai", 2)+ , ("linh hai", 2)+ , ("ba", 3)+ , ("lẻ", 3)+ , ("linh ba", 3)+ , ("lẻ bốn", 4)+ , ("linh bốn", 4)+ , ("bốn", 4)+ , ("năm", 5)+ , ("lẻ năm", 5)+ , ("linh năm", 5)+ , ("linh sáu", 6)+ , ("sáu", 6)+ , ("lẻ sáu", 6)+ , ("linh bảy", 7)+ , ("lẻ bảy", 7)+ , ("bảy", 7)+ , ("lẻ tám", 8)+ , ("linh tám", 8)+ , ("tám", 8)+ , ("lẻ chín", 9)+ , ("chín", 9)+ , ("linh chín", 9)+ , ("linh mười", 10)+ , ("mười", 10)+ , ("lẻ mười", 10)+ , ("mười một", 11)+ , ("mười hai", 12)+ , ("mười ba", 13)+ , ("mười bốn", 14)+ , ("mười lăm", 15)+ , ("mười sáu", 16)+ , ("mười bảy", 17)+ , ("mười tám", 18) , ("mười chín", 19) ] @@ -271,13 +228,13 @@ tensMap :: HashMap.HashMap Text.Text Integer tensMap = HashMap.fromList- [ ("hai mươi", 20)- , ("ba mươi", 30)- , ("bốn mươi", 40)- , ("năm mươi", 50)- , ("sáu mươi", 60)- , ("bảy mươi", 70)- , ("tám mươi", 80)+ [ ("hai mươi", 20)+ , ("ba mươi", 30)+ , ("bốn mươi", 40)+ , ("năm mươi", 50)+ , ("sáu mươi", 60)+ , ("bảy mươi", 70)+ , ("tám mươi", 80) , ("chín mươi", 90) ] @@ -301,7 +258,7 @@ , regex "mốt" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v + 1+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v + 1 _ -> Nothing } @@ -322,7 +279,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton ',') Text.empty match+ _) -> let fmt = Text.replace "," Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -334,13 +291,10 @@ , ruleInteger , ruleInteger2 , ruleInteger3- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleIntersect- , ruleIntersectWithAnd , ruleMultiply , ruleNumeralDot- , ruleNumeralNghn , ruleNumerals , ruleNumerals2 , ruleNumeralsPrefixWithM
Duckling/Numeral/ZH/Rules.hs view
@@ -10,20 +10,21 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.ZH.Rules- ( rules ) where+ ( rules+ ) where -import qualified Data.HashMap.Strict as HashMap import Data.Maybe-import qualified Data.Text as Text-import Prelude import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers import Duckling.Numeral.Types (NumeralData (..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Regex.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral ruleInteger5 :: Rule ruleInteger5 = Rule@@ -60,27 +61,14 @@ ruleNumeralsPrefixWithNegativeOrMinus = Rule { name = "numbers prefix with -, negative or minus" , pattern =- [ regex "-|负\\s?|負\\s?"- , dimension Numeral+ [ regex "-|负|負"+ , Predicate isPositive ] , prod = \tokens -> case tokens of (_:Token Numeral nd:_) -> double (TNumeral.value nd * (-1)) _ -> Nothing } -ruleIntegerNumeric :: Rule-ruleIntegerNumeric = Rule- { name = "integer (numeric)"- , pattern =- [ regex "(\\d{1,18})"- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- v <- parseInt match- integer $ toInteger v- _ -> Nothing- }- ruleDecimalWithThousandsSeparator :: Rule ruleDecimalWithThousandsSeparator = Rule { name = "decimal with thousands separator"@@ -89,7 +77,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) ->- parseDouble (Text.replace (Text.singleton ',') Text.empty match) >>= double+ parseDouble (Text.replace "," Text.empty match) >>= double _ -> Nothing } @@ -124,7 +112,7 @@ , regex "十" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ v * 10+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10 _ -> Nothing } @@ -136,7 +124,7 @@ , regex "([kmg])" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):+ (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3@@ -154,8 +142,8 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v1}):- Token Numeral (NumeralData {TNumeral.value = v2}):+ (Token Numeral NumeralData{TNumeral.value = v1}:+ Token Numeral NumeralData{TNumeral.value = v2}: _) -> double $ v1 + v2 _ -> Nothing }@@ -168,7 +156,7 @@ , numberBetween 1 10 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) -> double $ 10 + v+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ 10 + v _ -> Nothing } @@ -180,7 +168,7 @@ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):- _) -> let fmt = Text.replace (Text.singleton ',') Text.empty match+ _) -> let fmt = Text.replace "," Text.empty match in parseDouble fmt >>= double _ -> Nothing }@@ -193,7 +181,6 @@ , ruleInteger3 , ruleInteger4 , ruleInteger5- , ruleIntegerNumeric , ruleIntegerWithThousandsSeparator , ruleNumeral , ruleNumeralsPrefixWithNegativeOrMinus
Duckling/Ordinal/AR/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Ordinal.AR.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Locale import Duckling.Ordinal.Types@@ -23,7 +24,61 @@ corpus = (testContext {locale = makeLocale AR Nothing}, allExamples) allExamples :: [Example]-allExamples =- examples (OrdinalData 2)- [ "الثاني"- ]+allExamples = concat+ [ examples (OrdinalData 1)+ [ "الاول"+ , "الأول"+ , "اول"+ ]+ , examples (OrdinalData 2)+ [ "الثاني"+ , "الثان"+ , "ثاني"+ ]+ , examples (OrdinalData 3)+ [ "الثالث"+ , "ثالث"+ ]+ , examples (OrdinalData 4)+ [ "الرابع"+ , "رابع"+ ]+ , examples (OrdinalData 8)+ [ "الثامن"+ , "ثامن"+ ]+ , examples (OrdinalData 11)+ [ "الأحد عشر"+ , "الإحدى عشرة"+ , "الحادي عشرة"+ ]+ , examples (OrdinalData 12)+ [ "الثاني عشرة"+ , "الثان عشر"+ , "الاثنى عشر"+ ]+ , examples (OrdinalData 13)+ [ "الثالث عشر"+ , "الثالثة عشرة"+ ]+ , examples (OrdinalData 21)+ [ "الحادي والعشرين"+ , "الواحد و العشرون"+ ]+ , examples (OrdinalData 25)+ [ "الخامس والعشرين"+ , "الخامس و العشرون"+ ]+ , examples (OrdinalData 31)+ [ "الواحد والثلاثون"+ , "الواحد والثلاثين"+ ]+ , examples (OrdinalData 72)+ [ "الثان والسبعون"+ , "الثاني والسبعين"+ ]+ , examples (OrdinalData 90)+ [ "التسعون"+ , "التسعين"+ ]+ ]
Duckling/Ordinal/AR/Rules.hs view
@@ -8,116 +8,132 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-} module Duckling.Ordinal.AR.Rules- ( rules ) where+ ( rules+ ) where -import Prelude+import Data.HashMap.Strict (HashMap) import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.Text as Text+import qualified Data.HashMap.Strict as HashMap +import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt) import Duckling.Ordinal.Helpers+import Duckling.Regex.Types import Duckling.Types -ruleOrdinalsTh :: Rule-ruleOrdinalsTh = Rule- { name = "ordinals 7th"- , pattern =- [ regex "(سابع | سابعة | السابع | السابعة)"- ]- , prod = \_ -> Just $ ordinal 7- }--ruleOrdinalsSecond :: Rule-ruleOrdinalsSecond = Rule- { name = "ordinals second"- , pattern =- [ regex "(ثاني|ثانية|الثاني|الثانية)"- ]- , prod = \_ -> Just $ ordinal 2- }--ruleOrdinalsFirst :: Rule-ruleOrdinalsFirst = Rule- { name = "ordinals first"- , pattern =- [ regex "(أول|الأول|أولى|الأولى)"- ]- , prod = \_ -> Just $ ordinal 1- }+ordinalsMap :: HashMap Text Int+ordinalsMap = HashMap.fromList+ [ ( "اول", 1 )+ , ( "أول", 1 )+ , ( "حاد", 1 )+ , ( "حادي", 1 )+ , ( "واحد", 1 )+ , ( "ثان", 2 )+ , ( "ثاني", 2 )+ , ( "ثالث", 3 )+ , ( "رابع", 4 )+ , ( "خامس", 5 )+ , ( "سادس", 6 )+ , ( "سابع", 7 )+ , ( "ثامن", 8 )+ , ( "تاسع", 9 )+ , ( "عاشر", 10 )+ ] -ruleOrdinalsFirst5 :: Rule-ruleOrdinalsFirst5 = Rule- { name = "ordinals first"- , pattern =- [ regex "(سادس | سادسة | السادس | السادسة)"- ]- , prod = \_ -> Just $ ordinal 6- }+-- حذفنا ون،ين للتوحيد بين المذكر والمؤنث+cardinalsMap :: HashMap Text Int+cardinalsMap = HashMap.fromList+ [ ( "عشر", 20 )+ , ( "ثلاث", 30 )+ , ( "اربع", 40 )+ , ( "خمس", 50 )+ , ( "ست", 60 )+ , ( "سبع", 70 )+ , ( "ثمان", 80 )+ , ( "تسع", 90 )+ ] -ruleOrdinalsTh2 :: Rule-ruleOrdinalsTh2 = Rule- { name = "ordinals 8th"+ruleCompositeOrdinals :: Rule+ruleCompositeOrdinals = Rule+ { name = "ordinals (composite, e.g., eighty-seven)" , pattern =- [ regex "(ثامن | ثامنة | الثامن | الثامنة)"+ [ regex "ال(واحد|حادي?|ثاني?|ثالث|رابع|خامس|سادس|سابع|ثامن|تاسع|عاشر) و ?ال(عشر|ثلاث|اربع|خمس|ست|سبع|ثمان|تسع)(ون|ين)" ]- , prod = \_ -> Just $ ordinal 8+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (tens:units:_)):_) -> do+ tt <- HashMap.lookup (Text.toLower tens) ordinalsMap+ uu <- HashMap.lookup (Text.toLower units) cardinalsMap+ Just . ordinal $ tt + uu+ _ -> Nothing } -ruleOrdinalsFirst2 :: Rule-ruleOrdinalsFirst2 = Rule- { name = "ordinals first"+ruleOrdinals1To10 :: Rule+ruleOrdinals1To10 = Rule+ { name = "ordinals (first..tenth)" , pattern =- [ regex "(ثالث|ثالثة|الثالث|الثالثة)"+ [ regex "(?:ال)?([أا]ول|ثاني?|ثالث|رابع|خامس|سادس|سابع|ثامن|تاسع|عاشر)[ةهى]?" ]- , prod = \_ -> Just $ ordinal 3+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) ordinalsMap+ _ -> Nothing } -ruleOrdinalsTh4 :: Rule-ruleOrdinalsTh4 = Rule- { name = "ordinals 10th"+ruleOrdinals11 :: Rule+ruleOrdinals11 = Rule+ { name = "ordinals (eleventh)" , pattern =- [ regex "(عاشر | عاشرة | العاشر | العاشرة)"+ [ regex "ال([اأإ]حد[يى]?|حاد(ي[ةه]?)?) ?عشر[ةه]?" ]- , prod = \_ -> Just $ ordinal 10+ , prod = \_ -> Just $ ordinal 11 } -ruleOrdinalsTh3 :: Rule-ruleOrdinalsTh3 = Rule- { name = "ordinals 9th"+ruleOrdinals12 :: Rule+ruleOrdinals12 = Rule+ { name = "ordinals (twelveth)" , pattern =- [ regex "(تاسع | تاسعة | التاسع | التاسعة)"+ [ regex "ال([اأإ]ثن[يى]?|ثان(ي[ةه]?)?) ?عشر[ةه]?" ]- , prod = \_ -> Just $ ordinal 9+ , prod = \_ -> Just $ ordinal 12 } -ruleOrdinalsFirst4 :: Rule-ruleOrdinalsFirst4 = Rule- { name = "ordinals first"+ruleOrdinals13To19 :: Rule+ruleOrdinals13To19 = Rule+ { name = "ordinals (thirtieth..nineteenth)" , pattern =- [ regex "(خامس | الخامس | خامسة | الخامسة)"+ [ regex "ال(ثالث|رابع|خامس|سادس|سابع|ثامن|تاسع)[ةه]? ?عشرة?" ]- , prod = \_ -> Just $ ordinal 5+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ uu <- HashMap.lookup (Text.toLower match) ordinalsMap+ Just . ordinal $ 10 + uu+ _ -> Nothing } -ruleOrdinalsFirst3 :: Rule-ruleOrdinalsFirst3 = Rule- { name = "ordinals first"+ruleOrdinals3 :: Rule+ruleOrdinals3 = Rule+ { name = "ordinals (twenty, thirty..ninety)" , pattern =- [ regex "(رابع|رابعة | الرابع|الرابعة)"+ [ regex "ال(عشر|ثلاث|اربع|خمس|ست|سبع|ثمان|تسع)(ون|ين)" ]- , prod = \_ -> Just $ ordinal 4+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) cardinalsMap+ _ -> Nothing } rules :: [Rule] rules =- [ ruleOrdinalsFirst- , ruleOrdinalsFirst2- , ruleOrdinalsFirst3- , ruleOrdinalsFirst4- , ruleOrdinalsFirst5- , ruleOrdinalsSecond- , ruleOrdinalsTh- , ruleOrdinalsTh2- , ruleOrdinalsTh3- , ruleOrdinalsTh4+ [ ruleCompositeOrdinals+ , ruleOrdinals1To10+ , ruleOrdinals11+ , ruleOrdinals12+ , ruleOrdinals13To19+ , ruleOrdinals3 ]
+ Duckling/Ordinal/EL/Corpus.hs view
@@ -0,0 +1,72 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Ordinal.EL.Corpus+ ( corpus ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Ordinal.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale EL Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (OrdinalData 1)+ [ "πρώτος"+ , "1ος"+ , "1ου"+ , "πρώτων"+ ]+ , examples (OrdinalData 2)+ [ "δεύτερος"+ , "2ου"+ , "δευτέρου"+ ]+ , examples (OrdinalData 3)+ [ "τρίτος"+ , "3ης"+ ]+ , examples (OrdinalData 4)+ [ "τέταρτος"+ , "4ος"+ ]+ , examples (OrdinalData 8)+ [ "όγδοος"+ , "ογδόου"+ , "8ος"+ ]+ , examples (OrdinalData 25)+ [ "εικοστός πέμπτος"+ , "25ος"+ , "εικοστού πέμπτου"+ ]+ , examples (OrdinalData 31)+ [ "τριακοστός πρώτος"+ , "31ος"+ ]+ , examples (OrdinalData 42)+ [ "τεσσαρακοστός δεύτερος"+ , "42 ος"+ ]+ , examples (OrdinalData 77)+ [ "εβδομηκοστού εβδόμου"+ , "77ου"+ ]+ , examples (OrdinalData 90)+ [ "ενενηκοστός"+ , "90ος"+ ]+ ]
+ Duckling/Ordinal/EL/Rules.hs view
@@ -0,0 +1,108 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Ordinal.EL.Rules+ ( rules ) where++import Data.HashMap.Strict ( HashMap)+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Ordinal.Helpers+import Duckling.Ordinal.Types (OrdinalData (..), isBetween)+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Ordinal.Types as TOrdinal++ordinalsMap :: HashMap Text Int+ordinalsMap = HashMap.fromList+ [ ( "πρώτ" , 1 )+ , ( "δεύτερ" , 2 )+ , ( "δευτέρ" , 2 )+ , ( "τρίτ" , 3 )+ , ( "τέταρτ" , 4 )+ , ( "τετάρτ" , 4 )+ , ( "πέμπτ" , 5 )+ , ( "έκτ" , 6 )+ , ( "έβδομ" , 7 )+ , ( "εβδόμ" , 7 )+ , ( "όγδο" , 8 )+ , ( "ογδό" , 8 )+ , ( "ένατ" , 9 )+ , ( "ενάτ" , 9 )+ , ( "δέκατ" , 10 )+ , ( "δεκάτ" , 10 )+ , ( "ενδέκατ" , 11 )+ , ( "ενδεκάτ" , 11 )+ , ( "δωδέκατ" , 12 )+ , ( "δωδεκάτ" , 12 )+ , ( "εικοστ" , 20 )+ , ( "τριακοστ" , 30 )+ , ( "τεσσαρακοστ" , 40 )+ , ( "πεντηκοστ" , 50 )+ , ( "εξηκοστ" , 60 )+ , ( "εβδομηκοστ" , 70 )+ , ( "ογδοηκοστ" , 80 )+ , ( "ενενηκοστ" , 90 )+ ]++ruleOrdinals :: Rule+ruleOrdinals = Rule+ { name = "ordinals (1st..12th, 20th, 30th..90th)"+ , pattern =+ [ regex $ "(πρώτ|δε[υύ]τ[εέ]ρ|τρίτ|τ[εέ]τ[αά]ρτ|πέμπτ|"+ ++ "έκτ|[εέ]βδ[οό]μ(ηκοστ)?|[οό]γδ[οό](ηκοστ)?|[εέ]ν[αά]τ|δ[εέ]κ[αά]τ|"+ ++ "εν[δτ][εέ]κ[αά]τ|δωδ[εέ]κ[αά]τ|"+ ++ "εικοστ|τριακοστ|τεσσαρακοστ|πεντηκοστ|"+ ++ "εξηκοστ|ενενηκοστ)"+ ++ "([οό][υύιί]?ς?|[ηή]ς?|[εέ]ς|ων)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) ordinalsMap+ _ -> Nothing+ }++ruleCompositeOrdinals :: Rule+ruleCompositeOrdinals = Rule+ { name = "ordinals (composite: 11th..19th, 21st..29th, ..., 91st..99th)"+ , pattern =+ [ oneOf [10..90]+ , oneOf [1..9]+ ]+ , prod = \tokens -> case tokens of+ ( Token Ordinal OrdinalData{TOrdinal.value = t} :+ Token Ordinal OrdinalData{TOrdinal.value = u} : _ )+ -> Just $ ordinal $ t + u+ _ -> Nothing+ }++ruleOrdinalDigits :: Rule+ruleOrdinalDigits = Rule+ { name = "ordinal (digits)"+ , pattern = [regex "0*(\\d+) ?(ο[ςυι]?|ης?|ες)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> ordinal <$> parseInt match+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleOrdinals+ , ruleCompositeOrdinals+ , ruleOrdinalDigits+ ]
Duckling/Ordinal/EN/Corpus.hs view
@@ -44,19 +44,31 @@ ] , examples (OrdinalData 25) [ "twenty-fifth"+ , "twenty—fifth"+ , "twenty fifth"+ , "twentyfifth" , "25th" ] , examples (OrdinalData 31) [ "thirty-first"+ , "thirty—first"+ , "thirty first"+ , "thirtyfirst" , "31st" ] , examples (OrdinalData 42) [ "forty-second"+ , "forty—second"+ , "forty second"+ , "fortysecond" , "42nd" ]- , examples (OrdinalData 77)- [ "seventy-seventh"- , "77th"+ , examples (OrdinalData 73)+ [ "seventy-third"+ , "seventy—third"+ , "seventy third"+ , "seventythird"+ , "73rd" ] , examples (OrdinalData 90) [ "ninetieth"
Duckling/Ordinal/EN/Rules.hs view
@@ -8,17 +8,18 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-} module Duckling.Ordinal.EN.Rules- ( rules ) where+ ( rules+ ) where -import Control.Monad (join)-import Data.HashMap.Strict ( HashMap)-import qualified Data.HashMap.Strict as HashMap+import Data.HashMap.Strict (HashMap)+import Data.String import Data.Text (Text)-import qualified Data.Text as Text import Prelude-import Data.String+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers (parseInt)@@ -82,8 +83,8 @@ ruleCompositeOrdinals :: Rule ruleCompositeOrdinals = Rule- { name = "ordinals (composite, e.g., eighty-seven)"- , pattern = [regex "(twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety)\\-(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth)"]+ { name = "ordinals (composite, e.g. eighty-seven, forty—seventh, twenty ninth, thirtythird)"+ , pattern = [regex "(twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety)[\\s\\-\\—]?(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth)"] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (tens:units:_)):_) -> do tt <- HashMap.lookup (Text.toLower tens) cardinalsMap
Duckling/Ordinal/ET/Rules.hs view
@@ -12,9 +12,12 @@ module Duckling.Ordinal.ET.Rules ( rules ) where -import qualified Data.Text as Text-import Prelude+import Data.HashMap.Strict (HashMap) import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.Helpers (parseInt)@@ -22,6 +25,29 @@ import Duckling.Regex.Types import Duckling.Types +ordinalsMap :: HashMap Text Int+ordinalsMap = HashMap.fromList+ [ ("esimene", 1)+ , ("teine", 2)+ , ("kolmas", 3)+ , ("neljas", 4)+ , ("viies", 5)+ , ("kuues", 6)+ , ("seitsmes", 7)+ , ("kaheksas", 8)+ , ("üheksas", 9)+ , ("kümnes", 10)+ , ("üheteistkümnes", 11)+ , ("kaheteistkümnes", 12)+ , ("kolmeteistkümnes", 13)+ , ("neljateistkümnes", 14)+ , ("viieteistkümnes", 15)+ , ("kuueteistkümnes", 16)+ , ("seitsmeteistkümnes", 17)+ , ("kaheksateistkümnes", 18)+ , ("üheksateistkümnes", 19)+ ]+ ruleOrdinalsFirstth :: Rule ruleOrdinalsFirstth = Rule { name = "ordinals (first..19th)"@@ -29,27 +55,8 @@ [ regex "(esimene|teine|kolmas|neljas|viies|kuues|seitsmes|kaheksas|üheksas|kümnes|üheteistkümnes|kaheteistkümnes|kolmeteistkümnes|neljateistkümnes|viieteistkümnes|kuueteistkümnes|seitsmeteistkümnes|kaheksateistkümnes|üheksateistkümnes)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of- "esimene" -> Just $ ordinal 1- "teine" -> Just $ ordinal 2- "kolmas" -> Just $ ordinal 3- "neljas" -> Just $ ordinal 4- "viies" -> Just $ ordinal 5- "kuues" -> Just $ ordinal 6- "seitsmes" -> Just $ ordinal 7- "kaheksas" -> Just $ ordinal 8- "üheksas" -> Just $ ordinal 9- "kümnes" -> Just $ ordinal 10- "üheteistkümnes" -> Just $ ordinal 11- "kaheteistkümnes" -> Just $ ordinal 12- "kolmeteistkümnes" -> Just $ ordinal 13- "neljateistkümnes" -> Just $ ordinal 14- "viieteistkümnes" -> Just $ ordinal 15- "kuueteistkümnes" -> Just $ ordinal 16- "seitsmeteistkümnes" -> Just $ ordinal 17- "kaheksateistkümnes" -> Just $ ordinal 18- "üheksateistkümnes" -> Just $ ordinal 19- _ -> Nothing+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) ordinalsMap _ -> Nothing }
Duckling/Ordinal/HE/Rules.hs view
@@ -236,9 +236,9 @@ , dimension Ordinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v1}):+ (Token Ordinal OrdinalData{TOrdinal.value = v1}: _:- Token Ordinal (OrdinalData {TOrdinal.value = v2}):+ Token Ordinal OrdinalData{TOrdinal.value = v2}: _) -> Just . ordinal $ v1 + v2 _ -> Nothing }
+ Duckling/Ordinal/HI/Corpus.hs view
@@ -0,0 +1,106 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Ordinal.HI.Corpus+ ( corpus ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Ordinal.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale HI Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [examples (OrdinalData 0)+ [ "शून्य"+ ]+ , examples (OrdinalData 1)+ [ "प्रथम"+ , "पहला"+ , "पहली"+ , "पहले"+ ]+ , examples (OrdinalData 2)+ [ "द्वितीय"+ , "दूसरा"+ , "दूसरी"+ , "दूसरे"+ ]+ , examples (OrdinalData 3)+ [ "तृतीय"+ , "तीसरा"+ , "तीसरी"+ , "तीसरे"+ ]+ , examples (OrdinalData 4)+ [ "चौथा"+ , "चौथी"+ , "चौथे"+ ]+ , examples (OrdinalData 5)+ [ "पाँचवा"+ , "पाँचवी"+ , "पाँचवे"+ , "5वा"+ , "5वी"+ , "5वे"+ ]+ , examples (OrdinalData 6)+ [ "छठा"+ , "छठी"+ , "छठे"+ ]+ , examples (OrdinalData 10)+ [ "दसवा"+ , "दसवी"+ , "दसवे"+ , "10वा"+ , "10वी"+ , "10वे"+ ]+ , examples (OrdinalData 18)+ [ "अठारहवा"+ , "अठारहवी"+ , "अठारहवे"+ , "18वा"+ , "18वी"+ , "18वे"+ ]+ , examples (OrdinalData 25)+ [ "पच्चीसवा"+ , "पच्चीसवी"+ , "पच्चीसवे"+ , "25वा"+ , "25वी"+ , "25वे"+ ]+ , examples (OrdinalData 50)+ [ "पचासवा"+ , "पचासवी"+ , "पचासवे"+ , "50वा"+ , "50वी"+ , "50वे"+ ]+ , examples (OrdinalData 90)+ [ "नब्बेवा"+ , "नब्बेवी"+ , "नब्बेवे"+ , "90वा"+ , "90वी"+ , "90वे"+ ]+ ]
+ Duckling/Ordinal/HI/Rules.hs view
@@ -0,0 +1,123 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-}++module Duckling.Ordinal.HI.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Ordinal.Helpers+import Duckling.Regex.Types+import Duckling.Types++ordinalsMap :: HashMap Text Int+ordinalsMap = HashMap.fromList+ [ ( "शून्य" , 0 )+ , ( "प्रथम" , 1 )+ , ( "पहला" , 1 )+ , ( "पहली" , 1 )+ , ( "पहले" , 1 )+ , ( "द्वितीय" , 2 )+ , ( "दूसरा" , 2 )+ , ( "दूसरी" , 2 )+ , ( "दूसरे" , 2 )+ , ( "तृतीय" , 3 )+ , ( "तीसरा" , 3 )+ , ( "तीसरी" , 3 )+ , ( "तीसरे" , 3 )+ , ( "चौथा" , 4 )+ , ( "चौथी" , 4 )+ , ( "चौथे" , 4 )+ , ( "छठा" , 6 )+ , ( "छठी" , 6 )+ , ( "छठे" , 6 )+ ]++cardinalsMap :: HashMap Text Int+cardinalsMap = HashMap.fromList+ [ ( "पाँच", 5 )+ , ( "सात", 7 )+ , ( "आठ", 8 )+ , ( "नौ" , 9 )+ , ( "दस", 10 )+ , ( "ग्यारह", 11 )+ , ( "बारह", 12 )+ , ( "तेरह", 13 )+ , ( "चौदह", 14 )+ , ( "पन्द्रह", 15 )+ , ( "सोलह", 16 )+ , ( "सत्रह", 17 )+ , ( "अठारह", 18 )+ , ( "उन्नीस", 19 )+ , ( "बीस", 20 )+ , ( "इक्कीस", 21 )+ , ( "बाईस", 22 )+ , ( "तेईस", 23 )+ , ( "चौबीस", 24 )+ , ( "पच्चीस", 25 )+ , ( "छब्बीस", 26 )+ , ( "सत्ताईस", 27 )+ , ( "अट्ठाईस", 28 )+ , ( "उनतीस", 29 )+ , ( "तीस", 30 )+ , ( "चालीस", 40 )+ , ( "पचास", 50 )+ , ( "साठ", 60 )+ , ( "सत्तर", 70 )+ , ( "अस्सी", 80 )+ , ( "नब्बे", 90 )+ ]++ruleOrdinals :: Rule+ruleOrdinals = Rule+ { name = "ordinals (first..fourth, sixth)"+ , pattern = [regex "(शून्य|प्रथम|पहला|पहली|पहले|द्वितीय|दूसरा|दूसरी|दूसरे|तृतीय|तीसरा|तीसरी|तीसरे|चौथा|चौथी|चौथे|छठा|छठी|छठे)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) ordinalsMap+ _ -> Nothing+ }++ruleOtherOrdinals :: Rule+ruleOtherOrdinals = Rule+ { name = "ordinals (fifth, seventh ...)"+ , pattern = [regex "(पाँच|सात|आठ|नौ|दस|ग्यारह|बारह|तेरह|चौदह|पन्द्रह|सोलह|सत्रह|अठारह|उन्नीस|बीस|इक्कीस|बाईस|तेईस|चौबीस|पच्चीस|छब्बीस|सत्ताईस|अट्ठाईस|उनतीस|तीस|चालीस|पचास|साठ|सत्तर|अस्सी|नब्बे)(वा|वी|वे)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) ->+ ordinal <$> HashMap.lookup (Text.toLower match) cardinalsMap+ _ -> Nothing+ }+++ruleOrdinalDigits :: Rule+ruleOrdinalDigits = Rule+ { name = "ordinal (digits)"+ , pattern = [regex "0*(\\d+) ?(वा|वी|वे)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> ordinal <$> parseInt match+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleOrdinals+ , ruleOtherOrdinals+ , ruleOrdinalDigits+ ]
Duckling/Ordinal/Helpers.hs view
@@ -6,8 +6,11 @@ -- of patent rights can be found in the PATENTS file in the same directory. +{-# LANGUAGE GADTs #-}+ module Duckling.Ordinal.Helpers ( ordinal+ , oneOf ) where import Prelude@@ -25,3 +28,9 @@ ordinal :: Int -> Token ordinal x = Token Ordinal OrdinalData {TOrdinal.value = x}++oneOf :: [Int] -> PatternItem+oneOf vs = Predicate $ \x ->+ case x of+ (Token Ordinal OrdinalData {TOrdinal.value = v}) -> elem v vs+ _ -> False
Duckling/Ordinal/JA/Rules.hs view
@@ -29,7 +29,7 @@ , dimension Numeral ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . ordinal $ floor v _ -> Nothing }
Duckling/Ordinal/KO/Rules.hs view
@@ -29,7 +29,7 @@ , regex "번째|째(번)?" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> Just . ordinal $ floor v _ -> Nothing }
Duckling/Ordinal/PL/Rules.hs view
@@ -40,7 +40,7 @@ , dimension Ordinal ] , prod = \tokens -> case tokens of- (_:Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> Just . ordinal $ 30 + v _ -> Nothing }@@ -190,7 +190,7 @@ , dimension Ordinal ] , prod = \tokens -> case tokens of- (_:Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> Just . ordinal $ 20 + v _ -> Nothing }
Duckling/Ordinal/RU/Corpus.hs view
@@ -26,25 +26,61 @@ allExamples = concat [ examples (OrdinalData 1) [ "первый"+ , "Первая" , "первая" , "первое"+ , "первой"+ , "первого" , "1ая" , "1-ая" , "1ый" , "1-ый" , "1ое" , "1-ое"+ , "1й"+ , "1-й"+ , "1го"+ , "1-го" ]+ , examples (OrdinalData 3)+ [ "третий"+ , "третья"+ , "третье"+ , "третьей"+ , "третьего"+ , "3й"+ , "3ий"+ , "3я"+ , "3ья"+ , "3е"+ , "3ье"+ , "3го"+ , "3-й"+ , "3-ий"+ , "3-я"+ , "3-ья"+ , "3-е"+ , "3-ье"+ , "3-го"+ ] , examples (OrdinalData 4) [ "четвертый" , "четвертая" , "четвертое"+ , "четвертой"+ , "четвертого"+ , "4й" , "4ый" , "4ая" , "4ое"+ , "4ой"+ , "4го"+ , "4-й" , "4-ый" , "4-ая" , "4-ое"+ , "4-ой"+ , "4-го" ] , examples (OrdinalData 15) [ "пятнадцатый"@@ -54,7 +90,16 @@ , examples (OrdinalData 21) [ "21й" , "21-й"+ , "21-го"+ , "Двадцать первый" , "двадцать первый"+ , "двадцать первого"+ ]+ , examples (OrdinalData 23)+ [ "23й"+ , "23-й"+ , "двадцать третий"+ , "двадцать третьего" ] , examples (OrdinalData 31) [ "31ый"
Duckling/Ordinal/RU/Rules.hs view
@@ -27,10 +27,10 @@ ruleOrdinalsFirstth = Rule { name = "ordinals (first..19th)" , pattern =- [ regex "(перв|втор|трет|четверт|пят|шест|седьм|восьм|девят|десят|одинадцат|двенадцат|тринадцат|четырнадцат|пятнадцат|шестнадцат|семнадцат|восемнадцат|девятнадцат|двадцат)(ый|ой|ий|ая|ое)"+ [ regex "(перв|втор|трет|четверт|пят|шест|седьм|восьм|девят|десят|одинадцат|двенадцат|тринадцат|четырнадцат|пятнадцат|шестнадцат|семнадцат|восемнадцат|девятнадцат|двадцат)(ье(го|й)?|ого|ый|ой|ий|ая|ое|ья)" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> case match of+ (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of "перв" -> Just $ ordinal 1 "втор" -> Just $ ordinal 2 "трет" -> Just $ ordinal 3@@ -60,7 +60,7 @@ { name = "ordinal 21..99" , pattern = [ regex "(двадцать|тридцать|сорок|пятьдесят|шестьдесят|семьдесят|восемьдесят|девяносто)"- , regex "(перв|втор|трет|четверт|пят|шест|седьм|восьм|девят)(ый|ой|ий|ая|ое)"+ , regex "(перв|втор|трет|четверт|пят|шест|седьм|восьм|девят)(ье(го|й)?|ого|ый|ой|ий|ая|ое|ья)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (m1:_)):@@ -95,7 +95,7 @@ ruleOrdinalDigits = Rule { name = "ordinal (digits)" , pattern =- [ regex "0*(\\d+)-?((ы|о|и)?й|ая|ое)"+ [ regex "0*(\\d+)-?((ы|о|и|а|e|ь)?(ее|й|я|е|го))" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> ordinal <$> parseInt match
Duckling/Ordinal/ZH/Rules.hs view
@@ -29,7 +29,7 @@ , dimension Numeral ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = x}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = x}:_) -> Just . ordinal $ floor x _ -> Nothing }
+ Duckling/Quantity/AR/Corpus.hs view
@@ -0,0 +1,68 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Quantity.AR.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Quantity.Types+import Duckling.Resolve+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale AR Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (simple Ounce 3 (Just "الذهب"))+ [ "ثلاثة اونصات من الذهب"+ ]+ , examples (simple Gram 2 Nothing)+ [ "2 غرام"+ , "2 جرام"+ , "0.002 كيلوغرام"+ , "0.002 كيلوجرام"+ , "2/1000 كغ"+ , "2000 ملغ"+ , "2000 ملج"+ ]+ , examples (simple Gram 1000 Nothing)+ [ "كغ"+ , "كيلوغرام"+ , "كيلوجرام"+ ]+ , examples (simple Ounce 2 Nothing)+ [ "2 اونصة"+ , "أونصتان"+ , "اونصتين"+ ]+ , examples (simple Cup 3 (Just "السكر"))+ [ "3 اكواب من السكر"+ ]+ , examples (simple Cup 0.75 Nothing)+ [ "3/4 كوب"+ , "0.75 كوب"+ , ".75 كوب"+ ]+ , examples (simple Gram 500 (Just "الفراولة"))+ [ "500 غرام من الفراولة"+ , "500 غم من الفراولة"+ , "500 جرام من الفراولة"+ , "500 جم من الفراولة"+ , "0.5 كيلوجرام من الفراولة"+ , "0.5 كيلوغرام من الفراولة"+ , "0.5 كغ من الفراولة"+ , "500000 ملغ من الفراولة"+ ]+ ]
+ Duckling/Quantity/AR/Rules.hs view
@@ -0,0 +1,150 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Quantity.AR.Rules+ ( rules+ ) where++import Data.HashMap.Strict (HashMap)+import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Quantity.Helpers+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.Quantity.Types as TQuantity++quantities :: [(Text, String, TQuantity.Unit)]+quantities =+ [ ("<quantity> cups", "(كوب(ان|ين)?|[أا]كواب)", TQuantity.Cup)+ , ("<quantity> grams", "(((كيلو|مي?لي?) ?)?((غ|ج)رام(ات|ين|ان)?)|ك(غ|ج)م?|مل(غ|ج)|(غ|ج)م)", TQuantity.Gram)+ , ("<quantity> lb", "(باوند(ان|ين)?)", TQuantity.Pound)+ , ("<quantity> oz", "([أا]ونص([ةه]|تان|تين|ات))", TQuantity.Ounce)+ ]++opsMap :: HashMap Text (Double -> Double)+opsMap = HashMap.fromList+ [ ( "غرامان", (* 2))+ , ( "غرامين", (* 2))+ , ( "كوبان", (* 2))+ , ( "كوبين", (* 2))+ , ( "باوندان", (* 2))+ , ( "باوندين", (* 2))+ , ( "اونصتان", (* 2))+ , ( "اونصتين", (* 2))+ , ( "أونصتان", (* 2))+ , ( "أونصتين", (* 2))+ , ( "جرامان", (* 2))+ , ( "جرامين", (* 2))+ , ( "ميلي غرامان", (/ 500))+ , ( "ميليغرامان", (/ 500))+ , ( "ميلغرامان", (/ 500))+ , ( "ميلي غرامين", (/ 500))+ , ( "ميليغرامين", (/ 500))+ , ( "ميلغرامين", (/ 500))+ , ( "ميلي جرامان", (/ 500))+ , ( "ميليجرامان", (/ 500))+ , ( "ميلجرامان", (/ 500))+ , ( "ميلي جرامين", (/ 500))+ , ( "ميليجرامين", (/ 500))+ , ( "ميلجرامين", (/ 500))+ , ( "ميلي غرام", (/ 1000))+ , ( "ميليغرام", (/ 1000))+ , ( "ميلغرام", (/ 1000))+ , ( "كيلوغرام", (* 1000))+ , ( "كيلو غرام", (* 1000))+ , ( "ميلي غرامات", (/ 1000))+ , ( "ميليغرامات", (/ 1000))+ , ( "ميلغرامات", (/ 1000))+ , ( "ملغ", (/ 1000))+ , ( "كغ", (* 1000))+ , ( "كغم", (* 1000))+ , ( "ميلي جرام", (/ 1000))+ , ( "ميليجرام", (/ 1000))+ , ( "ميلجرام", (/ 1000))+ , ( "ميلي جرامات", (/ 1000))+ , ( "ميليجرامات", (/ 1000))+ , ( "ميلجرامات", (/ 1000))+ , ( "كيلوغرامات", (* 1000))+ , ( "كيلو غرامات", (* 1000))+ , ( "ملج", (/ 1000))+ , ( "كيلوجرام", (* 1000))+ , ( "كيلو جرام", (* 1000))+ , ( "كيلوجرامات", (* 1000))+ , ( "كيلو جرامات", (* 1000))+ , ( "كج", (* 1000))+ , ( "كجم", (* 1000))+ , ( "كيلوغرامان", (* 2000))+ , ( "كيلوغرامين", (* 2000))+ , ( "كيلو غرامان", (* 2000))+ , ( "كيلو غرامين", (* 2000))+ , ( "كيلوجرامان", (* 2000))+ , ( "كيلوجرامين", (* 2000))+ , ( "كيلو جرامان", (* 2000))+ , ( "كيلو جرامين", (* 2000))+ ]++getValue :: Text -> Double -> Double+getValue match = HashMap.lookupDefault id (Text.toLower match) opsMap++ruleNumeralQuantities :: [Rule]+ruleNumeralQuantities = map go quantities+ where+ go :: (Text, String, TQuantity.Unit) -> Rule+ go (name, regexPattern, u) = Rule+ { name = name+ , pattern = [ numberWith TNumeral.value (> 0), regex regexPattern ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> Just . Token Quantity $ quantity u value+ where value = getValue match $ TNumeral.value nd+ _ -> Nothing+ }++ruleAQuantity :: [Rule]+ruleAQuantity = map go quantities+ where+ go :: (Text, String, TQuantity.Unit) -> Rule+ go (name, regexPattern, u) = Rule+ { name = name+ , pattern = [ regex regexPattern ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ _) -> Just . Token Quantity $ quantity u $ getValue match 1+ _ -> Nothing+ }++ruleQuantityOfProduct :: Rule+ruleQuantityOfProduct = Rule+ { name = "<quantity> of product"+ , pattern =+ [ dimension Quantity+ , regex "من ([ء-ي]+)"+ ]+ , prod = \tokens -> case tokens of+ (Token Quantity qd:Token RegexMatch (GroupMatch (product:_)):_) ->+ Just . Token Quantity $ withProduct product qd+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleQuantityOfProduct+ ]+ ++ ruleNumeralQuantities+ ++ ruleAQuantity
Duckling/Quantity/EN/Corpus.hs view
@@ -22,41 +22,73 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData Pound 2 (Just "meat"))+ [ examples (simple Pound 2 (Just "meat")) [ "two pounds of meat" ]- , examples (QuantityData Gram 2 Nothing)+ , examples (simple Gram 2 Nothing) [ "2 grams" , "0.002 kg" , "2/1000 kilograms" , "2000 milligrams" ]- , examples (QuantityData Gram 1000 Nothing)+ , examples (simple Gram 1000 Nothing) [ "a kilogram" , "a kg" ]- , examples (QuantityData Pound 1 Nothing)+ , examples (simple Pound 1 Nothing) [ "a Pound" , "1 lb" , "a lb" ]- , examples (QuantityData Ounce 2 Nothing)+ , examples (simple Ounce 2 Nothing) [ "2 ounces" , "2oz" ]- , examples (QuantityData Cup 3 (Just "sugar"))+ , examples (simple Cup 3 (Just "sugar")) [ "3 Cups of sugar" ]- , examples (QuantityData Cup 0.75 Nothing)+ , examples (simple Cup 0.75 Nothing) [ "3/4 cup" , "0.75 cup" , ".75 cups" ]- , examples (QuantityData Gram 500 (Just "strawberries"))+ , examples (simple Gram 500 (Just "strawberries")) [ "500 grams of strawberries" , "500g of strawberries" , "0.5 kilograms of strawberries" , "0.5 kg of strawberries" , "500000mg of strawberries" ]+ , examples (between Gram (100,1000) (Just "strawberries"))+ [ "100-1000 gram of strawberries"+ , "between 100 and 1000 grams of strawberries"+ , "from 100 to 1000 g of strawberries"+ , "100 - 1000 g of strawberries"+ ]+ , examples (between Gram (2,7) Nothing)+ [ "around 2 -7 g"+ , "~2-7 grams"+ , "from 2 to 7 g"+ , "between 2.0 g and about 7.0 g"+ , "between 0.002 kg and about 0.007 kg"+ , "2 - ~7 grams"+ ]+ , examples (under Pound 6 (Just "meat"))+ [ "less than six pounds of meat"+ , "no more than 6 lbs of meat"+ , "below 6.0 pounds of meat"+ , "at most six pounds of meat"+ ]+ , examples (above Cup 2 Nothing)+ [ "exceeding 2 Cups"+ , "at least two Cups"+ , "over 2 Cups"+ , "more than 2 Cups"+ ]+ , examples (above Ounce 4 (Just "chocolate"))+ [ "exceeding 4 oz of chocolate"+ , "at least 4.0 oz of chocolate"+ , "over four ounces of chocolate"+ , "more than four ounces of chocolate"+ ] ]
Duckling/Quantity/EN/Rules.hs view
@@ -8,13 +8,17 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE LambdaCase #-} module Duckling.Quantity.EN.Rules- ( rules ) where+ ( rules+ ) where +import Data.HashMap.Strict (HashMap) import Data.String import Data.Text (Text) import Prelude+import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Duckling.Dimensions.Types@@ -22,6 +26,8 @@ import Duckling.Quantity.Helpers import Duckling.Regex.Types import Duckling.Types+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Quantity.Types (QuantityData(..)) import qualified Duckling.Numeral.Types as TNumeral import qualified Duckling.Quantity.Types as TQuantity @@ -33,17 +39,20 @@ , ("<quantity> oz", "((ounces?)|oz)", TQuantity.Ounce) ] +opsMap :: HashMap Text (Double -> Double)+opsMap = HashMap.fromList+ [ ( "milligram" , (/ 1000))+ , ( "milligrams", (/ 1000))+ , ( "mg" , (/ 1000))+ , ( "mgs" , (/ 1000))+ , ( "kilogram" , (* 1000))+ , ( "kilograms" , (* 1000))+ , ( "kg" , (* 1000))+ , ( "kgs" , (* 1000))+ ]+ getValue :: Text -> Double -> Double-getValue match value = case Text.toLower match of- "milligram" -> value / 1000- "milligrams" -> value / 1000- "mg" -> value / 1000- "mgs" -> value / 1000- "kilogram" -> value * 1000- "kilograms" -> value * 1000- "kg" -> value * 1000- "kgs" -> value * 1000- _ -> value+getValue match = HashMap.lookupDefault id (Text.toLower match) opsMap ruleNumeralQuantities :: [Rule] ruleNumeralQuantities = map go quantities@@ -51,8 +60,8 @@ go :: (Text, String, TQuantity.Unit) -> Rule go (name, regexPattern, u) = Rule { name = name- , pattern = [ numberWith TNumeral.value (> 0), regex regexPattern ]- , prod = \tokens -> case tokens of+ , pattern = [Predicate isPositive, regex regexPattern]+ , prod = \case (Token Numeral nd: Token RegexMatch (GroupMatch (match:_)): _) -> Just . Token Quantity $ quantity u value@@ -67,7 +76,7 @@ go (name, regexPattern, u) = Rule { name = name , pattern = [ regex ("an? " ++ regexPattern) ]- , prod = \tokens -> case tokens of+ , prod = \case (Token RegexMatch (GroupMatch (match:_)): _) -> Just . Token Quantity $ quantity u $ getValue match 1 _ -> Nothing@@ -80,15 +89,151 @@ [ dimension Quantity , regex "of (\\w+)" ]- , prod = \tokens -> case tokens of+ , prod = \case (Token Quantity qd:Token RegexMatch (GroupMatch (product:_)):_) -> Just . Token Quantity $ withProduct product qd _ -> Nothing } +rulePrecision :: Rule+rulePrecision = Rule+ { name = "about|exactly <quantity>"+ , pattern =+ [ regex "\\~|exactly|precisely|about|approx(\\.|imately)?|close to|near( to)?|around|almost"+ , dimension Quantity+ ]+ , prod = \case+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleIntervalBetweenNumeral :: Rule+ruleIntervalBetweenNumeral = Rule+ { name = "between|from <numeral> and|to <quantity>"+ , pattern =+ [ regex "between|from"+ , Predicate isPositive+ , regex "to|and"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (_:+ Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token Quantity QuantityData{TQuantity.value = Just to+ , TQuantity.unit = Just u+ , TQuantity.aproduct = Nothing}:+ _) | from < to ->+ Just . Token Quantity . withInterval (from, to) $ unitOnly u+ _ -> Nothing+ }++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between|from <quantity> to|and <quantity>"+ , pattern =+ [ regex "between|from"+ , Predicate isSimpleQuantity+ , regex "and|to"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (_:+ Token Quantity QuantityData{TQuantity.value = Just from+ , TQuantity.unit = Just u1+ , TQuantity.aproduct = Nothing}:+ _:+ Token Quantity QuantityData{TQuantity.value = Just to+ , TQuantity.unit = Just u2+ , TQuantity.aproduct = Nothing}:+ _) | from < to && u1 == u2 ->+ Just . Token Quantity . withInterval (from, to) $ unitOnly u1+ _ -> Nothing+ }++ruleIntervalNumeralDash :: Rule+ruleIntervalNumeralDash = Rule+ { name = "<numeral> - <quantity>"+ , pattern =+ [ Predicate isPositive+ , regex "\\-"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (Token Numeral NumeralData{TNumeral.value = from}:+ _:+ Token Quantity QuantityData{TQuantity.value = Just to+ , TQuantity.unit = Just u+ , TQuantity.aproduct = Nothing}:+ _) | from < to ->+ Just . Token Quantity . withInterval (from, to) $ unitOnly u+ _ -> Nothing+ }++ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<quantity> - <quantity>"+ , pattern =+ [ Predicate isSimpleQuantity+ , regex "\\-"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (Token Quantity QuantityData{TQuantity.value = Just from+ , TQuantity.unit = Just u1+ , TQuantity.aproduct = Nothing}:+ _:+ Token Quantity QuantityData{TQuantity.value = Just to+ , TQuantity.unit = Just u2+ , TQuantity.aproduct = Nothing}:+ _) | from < to && u1 == u2 ->+ Just . Token Quantity . withInterval (from, to) $ unitOnly u1+ _ -> Nothing+ }++++ruleIntervalMax :: Rule+ruleIntervalMax = Rule+ { name = "under/below/less/lower/at most/no more than <dist>"+ , pattern =+ [ regex "under|below|at most|(less|lower|not? more) than"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (_:+ Token Quantity QuantityData{TQuantity.value = Just to+ , TQuantity.unit = Just u+ , TQuantity.aproduct = Nothing}:+ _) -> Just . Token Quantity . withMax to $ unitOnly u+ _ -> Nothing+ }++ruleIntervalMin :: Rule+ruleIntervalMin = Rule+ { name = "over/above/exceeding/beyond/at least/more than <quantity>"+ , pattern =+ [ regex "over|above|exceeding|beyond|at least|(more|larger|bigger|heavier) than"+ , Predicate isSimpleQuantity+ ]+ , prod = \case+ (_:+ Token Quantity QuantityData{TQuantity.value = Just from+ , TQuantity.unit = Just u+ , TQuantity.aproduct = Nothing}:+ _) -> Just . Token Quantity . withMin from $ unitOnly u+ _ -> Nothing+ } rules :: [Rule] rules = [ ruleQuantityOfProduct+ , ruleIntervalMin+ , ruleIntervalMax+ , ruleIntervalBetweenNumeral+ , ruleIntervalBetween+ , ruleIntervalNumeralDash+ , ruleIntervalDash+ , rulePrecision ] ++ ruleNumeralQuantities ++ ruleAQuantity
Duckling/Quantity/FR/Corpus.hs view
@@ -24,13 +24,13 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData Cup 2 (Just "café"))+ [ examples (simple Cup 2 (Just "café")) [ "2 tasses de café" ]- , examples (QuantityData Cup 1 Nothing)+ , examples (simple Cup 1 Nothing) [ "une Tasse" ]- , examples (QuantityData Tablespoon 3 (Just "sucre"))+ , examples (simple Tablespoon 3 (Just "sucre")) [ "3 Cuillères à soupe de sucre" ] ]
Duckling/Quantity/HR/Corpus.hs view
@@ -23,11 +23,11 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData Gram 2000 (Just "meso"))+ [ examples (simple Gram 2000 (Just "meso")) [ "dvije kile mesa" , "dva kilograma mesa" ]- , examples (QuantityData Gram 1000 Nothing)+ , examples (simple Gram 1000 Nothing) [ "1 kilograma" ] ]
Duckling/Quantity/Helpers.hs view
@@ -5,27 +5,68 @@ -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. +{-# LANGUAGE GADTs #-} + module Duckling.Quantity.Helpers- ( quantity+ ( isSimpleQuantity+ , quantity+ , unitOnly , withProduct+ , withUnit+ , withValue+ , withInterval+ , withMin+ , withMax ) where import Data.Text (Text) import Prelude +import Duckling.Dimensions.Types import Duckling.Quantity.Types (QuantityData(..))+import Duckling.Types import qualified Duckling.Quantity.Types as TQuantity + -- ----------------------------------------------------------------- -- Patterns-+isSimpleQuantity :: Predicate+isSimpleQuantity (Token Quantity QuantityData {TQuantity.unit = Just _+ , TQuantity.value = Just _})+ = True+isSimpleQuantity _ = False -- ----------------------------------------------------------------- -- Production quantity :: TQuantity.Unit -> Double -> QuantityData-quantity u x = QuantityData- {TQuantity.unit = u, TQuantity.value = x, TQuantity.product = Nothing}+quantity u v = QuantityData {TQuantity.unit = Just u+ , TQuantity.value = Just v+ , TQuantity.aproduct = Nothing+ , TQuantity.minValue = Nothing+ , TQuantity.maxValue = Nothing} +unitOnly :: TQuantity.Unit -> QuantityData+unitOnly u = QuantityData {TQuantity.unit = Just u+ , TQuantity.value = Nothing+ , TQuantity.aproduct = Nothing+ , TQuantity.minValue = Nothing+ , TQuantity.maxValue = Nothing}+ withProduct :: Text -> QuantityData -> QuantityData-withProduct value qd = qd {TQuantity.product = Just value}+withProduct p qd = qd {TQuantity.aproduct = Just p}++withUnit :: TQuantity.Unit -> QuantityData -> QuantityData+withUnit u qd = qd {TQuantity.unit = Just u}++withValue :: Double -> QuantityData -> QuantityData+withValue value qd = qd {TQuantity.value = Just value}++withInterval :: (Double, Double) -> QuantityData -> QuantityData+withInterval (from, to) qd = qd {minValue = Just from, maxValue = Just to}++withMin :: Double -> QuantityData -> QuantityData+withMin from qd = qd {minValue = Just from}++withMax :: Double -> QuantityData -> QuantityData+withMax to qd = qd {maxValue = Just to}
Duckling/Quantity/KO/Corpus.hs view
@@ -24,16 +24,16 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData (Custom "근") 2 (Just "삼겹살"))+ [ examples (simple (Custom "근") 2 (Just "삼겹살")) [ "삼겹살 두근" ]- , examples (QuantityData (Custom "근") 1 Nothing)+ , examples (simple (Custom "근") 1 Nothing) [ "한근" ]- , examples (QuantityData Gram 600 Nothing)+ , examples (simple Gram 600 Nothing) [ "육백그람" ]- , examples (QuantityData Cup 3 (Just "콜라"))+ , examples (simple Cup 3 (Just "콜라")) [ "콜라 세컵" ] ]
Duckling/Quantity/PT/Corpus.hs view
@@ -24,13 +24,13 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData Cup 2 (Just "café"))+ [ examples (simple Cup 2 (Just "café")) [ "2 copos de café" ]- , examples (QuantityData Cup 1 Nothing)+ , examples (simple Cup 1 Nothing) [ "um Copo" ]- , examples (QuantityData Pound 100 (Just "acucar"))+ , examples (simple Pound 100 (Just "acucar")) [ "100 Libras de acucar" ] ]
Duckling/Quantity/RO/Corpus.hs view
@@ -24,13 +24,13 @@ allExamples :: [Example] allExamples = concat- [ examples (QuantityData Pound 2 (Just "carne"))+ [ examples (simple Pound 2 (Just "carne")) [ "doua livre de carne" ]- , examples (QuantityData Pound 1 Nothing)+ , examples (simple Pound 1 Nothing) [ "o livră" ]- , examples (QuantityData Pound 500 (Just "zahăr"))+ , examples (simple Pound 500 (Just "zahăr")) [ "cinci sute livre de zahăr" ] ]
+ Duckling/Quantity/RU/Corpus.hs view
@@ -0,0 +1,60 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Quantity.RU.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Quantity.Types+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale RU Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (simple Pound 2 Nothing)+ [ "2 фунта"+ ]+ , examples (simple Gram 2 Nothing)+ [ "2 грамма"+ , "два грамма"+ , "0.002 кг"+ , "2000 миллиграмм"+ , "2000 мг"+ ]+ , examples (simple Gram 1000 Nothing)+ [ "килограмм"+ , "кг"+ ]+ , examples (simple Gram 2000 Nothing)+ [ "2 килограмма"+ , "2 кг"+ ]+ , examples (simple Pound 1 Nothing)+ [ "фунт"+ , "1 фунт"+ ]+ , examples (simple Ounce 2 Nothing)+ [ "2 унции"+ ]+ , examples (simple Gram 500 Nothing)+ [ "500 грамм"+ , "500г"+ , "500 г"+ , "0.5 кг"+ , "пятьсот грамм"+ ]+ ]
+ Duckling/Quantity/RU/Rules.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Quantity.RU.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers+import Duckling.Quantity.Helpers+import Duckling.Regex.Types+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.Quantity.Types as TQuantity++quantities :: [(Text, String, TQuantity.Unit, Double -> Double)]+quantities =+ [ ("<quantity> milligrams", "(мг|миллиграмма?)", TQuantity.Gram, (/ 1000))+ , ("<quantity> grams", "г(рамма?)?", TQuantity.Gram, id)+ , ("<quantity> kilograms", "(кг|килограмма?)", TQuantity.Gram, (* 1000))+ , ("<quantity> lb", "фунт(а|ов)?", TQuantity.Pound, id)+ , ("<quantity> oz", "унц(ия|ии|ий)", TQuantity.Ounce, id)+ ]++ruleNumeralQuantities :: [Rule]+ruleNumeralQuantities = map go quantities+ where+ go :: (Text, String, TQuantity.Unit, Double -> Double) -> Rule+ go (name, regexPattern, u, convert) = Rule+ { name = name+ , pattern =+ [ numberWith TNumeral.value (> 0)+ , regex regexPattern+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral nd:_) ->+ Just . Token Quantity . quantity u . convert $ TNumeral.value nd+ _ -> Nothing+ }++ruleAQuantity :: [Rule]+ruleAQuantity = map go quantities+ where+ go :: (Text, String, TQuantity.Unit, Double -> Double) -> Rule+ go (name, regexPattern, u, convert) = Rule+ { name = name+ , pattern = [ regex regexPattern ]+ , prod = \_ -> Just . Token Quantity . quantity u $ convert 1+ }++rules :: [Rule]+rules = ruleNumeralQuantities ++ ruleAQuantity
Duckling/Quantity/Types.hs view
@@ -18,11 +18,11 @@ import Data.Aeson import Data.Hashable import Data.Text (Text)-import qualified Data.Text as Text import GHC.Generics import Prelude- import Duckling.Resolve (Resolve(..))+import qualified Data.HashMap.Strict as H+import qualified Data.Text as Text data Unit = Bowl@@ -44,19 +44,107 @@ toJSON x = String . Text.toLower . Text.pack $ show x data QuantityData = QuantityData- { unit :: Unit- , value :: Double- , product :: Maybe Text+ { unit :: Maybe Unit+ , value :: Maybe Double+ , aproduct :: Maybe Text+ , minValue :: Maybe Double+ , maxValue :: Maybe Double } deriving (Eq, Generic, Hashable, Ord, Show, NFData) -instance ToJSON QuantityData where- toJSON (QuantityData unit value product) = object $- [ "type" .= ("value" :: Text)- , "value" .= value- , "unit" .= unit- ]- ++ [ "product" .= p | Just p <- [product] ] instance Resolve QuantityData where- type ResolvedValue QuantityData = QuantityData- resolve _ x = Just x+ type ResolvedValue QuantityData = QuantityValue++ resolve _ QuantityData {value = Just value+ , unit = Just unit+ , aproduct = aproduct}+ = Just $ simple unit value aproduct++ resolve _ QuantityData {value = Nothing+ , unit = Just unit+ , aproduct = aproduct+ , minValue = Just from+ , maxValue = Just to}+ = Just $ between unit (from, to) aproduct++ resolve _ QuantityData {value = Nothing+ , unit = Just unit+ , aproduct = aproduct+ , minValue = Just from+ , maxValue = Nothing}+ = Just $ above unit from aproduct++ resolve _ QuantityData {value = Nothing+ , unit = Just unit+ , aproduct = aproduct+ , minValue = Nothing+ , maxValue = Just to}+ = Just $ under unit to aproduct++ resolve _ _ = Nothing++data IntervalDirection = Above | Under+ deriving (Eq, Generic, Hashable, Ord, Show, NFData)++data SingleValue = SingleValue+ { vUnit :: Unit+ , vValue :: Double+ , vProduct :: Maybe Text+ }+ deriving (Eq, Generic, Hashable, Ord, Show, NFData)++instance ToJSON SingleValue where+ toJSON (SingleValue unit value aproduct) = object $+ [ "value" .= value+ , "unit" .= unit+ ]+ ++ [ "product" .= p | Just p <- [aproduct] ]+++data QuantityValue+ = SimpleValue SingleValue+ | IntervalValue (SingleValue, SingleValue)+ | OpenIntervalValue (SingleValue, IntervalDirection)+ deriving (Eq, Ord, Show)++instance ToJSON QuantityValue where+ toJSON (SimpleValue value) = case toJSON value of+ Object o -> Object $ H.insert "type" (toJSON ("value" :: Text)) o+ _ -> Object H.empty+ toJSON (IntervalValue (from, to)) = object+ [ "type" .= ("interval" :: Text)+ , "from" .= toJSON from+ , "to" .= toJSON to+ ]+ toJSON (OpenIntervalValue (from, Above)) = object+ [ "type" .= ("interval" :: Text)+ , "from" .= toJSON from+ ]+ toJSON (OpenIntervalValue (to, Under)) = object+ [ "type" .= ("interval" :: Text)+ , "to" .= toJSON to+ ]+-- -----------------------------------------------------------------+-- Value helpers++simple :: Unit -> Double -> Maybe Text -> QuantityValue+simple u v p = SimpleValue $ single u v p++between :: Unit -> (Double, Double) -> Maybe Text -> QuantityValue+between u (from,to) p = IntervalValue (single u from p, single u to p)++above :: Unit -> Double -> Maybe Text -> QuantityValue+above = openInterval Above++under :: Unit -> Double -> Maybe Text -> QuantityValue+under = openInterval Under++openInterval :: IntervalDirection+ -> Unit+ -> Double+ -> Maybe Text+ -> QuantityValue+openInterval direction u v p = OpenIntervalValue (single u v p, direction)++single :: Unit -> Double -> Maybe Text -> SingleValue+single u v p = SingleValue {vUnit = u, vValue = v, vProduct = p}
Duckling/Ranking/Classifiers.hs view
@@ -19,6 +19,7 @@ import qualified Duckling.Ranking.Classifiers.CS_XX as CS_XXClassifiers import qualified Duckling.Ranking.Classifiers.DA_XX as DA_XXClassifiers import qualified Duckling.Ranking.Classifiers.DE_XX as DE_XXClassifiers+import qualified Duckling.Ranking.Classifiers.EL_XX as EL_XXClassifiers import qualified Duckling.Ranking.Classifiers.EN_GB as EN_GBClassifiers import qualified Duckling.Ranking.Classifiers.EN_US as EN_USClassifiers import qualified Duckling.Ranking.Classifiers.EN_XX as EN_XXClassifiers@@ -27,6 +28,7 @@ import qualified Duckling.Ranking.Classifiers.FR_XX as FR_XXClassifiers import qualified Duckling.Ranking.Classifiers.GA_XX as GA_XXClassifiers import qualified Duckling.Ranking.Classifiers.HE_XX as HE_XXClassifiers+import qualified Duckling.Ranking.Classifiers.HI_XX as HI_XXClassifiers import qualified Duckling.Ranking.Classifiers.HR_XX as HR_XXClassifiers import qualified Duckling.Ranking.Classifiers.HU_XX as HU_XXClassifiers import qualified Duckling.Ranking.Classifiers.ID_XX as ID_XXClassifiers@@ -36,6 +38,7 @@ import qualified Duckling.Ranking.Classifiers.KO_XX as KO_XXClassifiers import qualified Duckling.Ranking.Classifiers.MY_XX as MY_XXClassifiers import qualified Duckling.Ranking.Classifiers.NB_XX as NB_XXClassifiers+import qualified Duckling.Ranking.Classifiers.NE_XX as NE_XXClassifiers import qualified Duckling.Ranking.Classifiers.NL_XX as NL_XXClassifiers import qualified Duckling.Ranking.Classifiers.PL_XX as PL_XXClassifiers import qualified Duckling.Ranking.Classifiers.PT_XX as PT_XXClassifiers@@ -53,6 +56,7 @@ classifiers (Locale CS _) = CS_XXClassifiers.classifiers classifiers (Locale DA _) = DA_XXClassifiers.classifiers classifiers (Locale DE _) = DE_XXClassifiers.classifiers+classifiers (Locale EL _) = EL_XXClassifiers.classifiers classifiers (Locale EN (Just GB)) = EN_GBClassifiers.classifiers classifiers (Locale EN (Just US)) = EN_USClassifiers.classifiers classifiers (Locale EN _) = EN_XXClassifiers.classifiers@@ -61,6 +65,7 @@ classifiers (Locale FR _) = FR_XXClassifiers.classifiers classifiers (Locale GA _) = GA_XXClassifiers.classifiers classifiers (Locale HE _) = HE_XXClassifiers.classifiers+classifiers (Locale HI _) = HI_XXClassifiers.classifiers classifiers (Locale HR _) = HR_XXClassifiers.classifiers classifiers (Locale HU _) = HU_XXClassifiers.classifiers classifiers (Locale ID _) = ID_XXClassifiers.classifiers@@ -70,6 +75,7 @@ classifiers (Locale KO _) = KO_XXClassifiers.classifiers classifiers (Locale MY _) = MY_XXClassifiers.classifiers classifiers (Locale NB _) = NB_XXClassifiers.classifiers+classifiers (Locale NE _) = NE_XXClassifiers.classifiers classifiers (Locale NL _) = NL_XXClassifiers.classifiers classifiers (Locale PL _) = PL_XXClassifiers.classifiers classifiers (Locale PT _) = PT_XXClassifiers.classifiers
Duckling/Ranking/Classifiers/AR_XX.hs view
@@ -19,4 +19,1923 @@ import Duckling.Ranking.Types classifiers :: Classifiers-classifiers = HashMap.fromList []+classifiers+ = HashMap.fromList+ [("<time> timezone",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.3462762367178338, unseen = -4.0943445622221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 58},+ koData =+ ClassData{prior = -1.2286654169163076, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24}}),+ ("ordinals (twelveth)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-week> next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("day", -0.8109302162163288),+ ("about|exactly <time-of-day>", -1.5040773967762742),+ ("Tuesday", -1.0986122886681098)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("noon|midnight|EOD|end of day",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("<hour-of-day> third",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.252762968495368),+ ("hour", -0.8472978603872037),+ ("time-of-day integer (latent)", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.5040773967762742),+ ("dayday", -1.0986122886681098),+ ("day (grain)yesterday", -1.5040773967762742)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("minute (grain)part of days", -1.252762968495368),+ ("minutehour", -1.252762968495368)],+ n = 1}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = -0.5108256237659907,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -0.916290731874155, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("mm/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -0.3101549283038396,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..tenth)February", -2.70805020110221),+ ("integer (numeric)in <named-month>", -2.70805020110221),+ ("integer (numeric)April", -2.70805020110221),+ ("integer (numeric)August", -2.70805020110221),+ ("integer (numeric)February", -1.791759469228055),+ ("month", -0.916290731874155),+ ("integer (numeric)July", -2.3025850929940455),+ ("integer (numeric)March", -2.70805020110221)],+ n = 11},+ koData =+ ClassData{prior = -1.3217558399823195, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)in <named-month>", -2.0794415416798357),+ ("integer (numeric)August", -2.0794415416798357),+ ("month", -1.1631508098056809),+ ("integer (numeric)July", -1.6739764335716716)],+ n = 4}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -0.41616039722491244,+ unseen = -5.488937726156687,+ likelihoods =+ HashMap.fromList+ [("intersect by \",\", \"of\", \"from\", \"'s\"part of days",+ -4.386184644822546),+ ("<hour-of-day> till thirdafter part of days",+ -4.386184644822546),+ ("time-of-day integer (latent)after part of days",+ -4.386184644822546),+ ("at <time-of-day>before part of days", -4.098502572370764),+ ("hh:mmbefore part of days", -4.791649752930709),+ ("<datetime> - <datetime> (interval)part of days",+ -4.098502572370764),+ ("<time-of-day> - <time-of-day> (interval)part of days",+ -4.386184644822546),+ ("time-of-day ordinal (latent)part of days",+ -4.098502572370764),+ ("<hour-of-day> halfpart of days", -4.386184644822546),+ ("time-of-day integer (latent)part of days",+ -3.5388867844353418),+ ("<hour-of-day> till quarterthis <part-of-day>",+ -4.386184644822546),+ ("hourhour", -1.8738790208464304),+ ("hh:mmpart of days", -3.8753590210565547),+ ("<hour-of-day> and integer minutespart of days",+ -2.651583589434439),+ ("<hour-of-day> quarterafter part of days", -4.791649752930709),+ ("minutehour", -1.4243539229442357),+ ("at <time-of-day>part of days", -2.393754480132339),+ ("intersectpart of days", -4.791649752930709),+ ("from <datetime> - <datetime> (interval)part of days",+ -4.386184644822546),+ ("<hour-of-day> and integer minutesafter part of days",+ -4.386184644822546),+ ("at <time-of-day>after part of days", -3.6930374642626003),+ ("<hour-of-day> quarterpart of days", -4.386184644822546),+ ("<hour-of-day> thirdpart of days", -4.386184644822546),+ ("from <datetime> - <datetime> (interval)after part of days",+ -4.791649752930709),+ ("time-of-day ordinal (latent)tonight", -4.791649752930709),+ ("<datetime> - <datetime> (interval)after part of days",+ -4.791649752930709),+ ("<hour-of-day> till quarterbefore part of days",+ -4.386184644822546),+ ("<time-of-day> - <time-of-day> (interval)after part of days",+ -4.791649752930709),+ ("at <time-of-day>this <part-of-day>", -4.791649752930709),+ ("<hour-of-day> till thirdbefore part of days",+ -4.386184644822546)],+ n = 93},+ koData =+ ClassData{prior = -1.0775588794702773,+ unseen = -5.0238805208462765,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal)part of days", -3.2255203675868693),+ ("time-of-day integer (latent)after part of days",+ -4.324132656254979),+ ("dayhour", -3.2255203675868693),+ ("<hour-of-day> till thirdafter <time-of-day>",+ -3.9186675481468147),+ ("time-of-day integer (latent)after <time-of-day>",+ -3.9186675481468147),+ ("yearhour", -3.2255203675868693),+ ("at <time-of-day>until <time-of-day>", -3.9186675481468147),+ ("hh:mmafter part of days", -4.324132656254979),+ ("past year (latent)part of days", -4.324132656254979),+ ("hh:mmuntil <time-of-day>", -4.324132656254979),+ ("<time-of-day> - <time-of-day> (interval)part of days",+ -4.324132656254979),+ ("until <time-of-day>after part of days", -4.324132656254979),+ ("time-of-day ordinal (latent)part of days",+ -3.9186675481468147),+ ("<time-of-day> - <time-of-day> (interval)after <time-of-day>",+ -4.324132656254979),+ ("by <time>part of days", -4.324132656254979),+ ("<datetime> - <datetime> (interval)after <time-of-day>",+ -4.324132656254979),+ ("time-of-day integer (latent)part of days",+ -4.324132656254979),+ ("<hour-of-day> till quarterthis <part-of-day>",+ -4.324132656254979),+ ("hourhour", -2.0215475632609334),+ ("past year (latent)after part of days", -4.324132656254979),+ ("<hour-of-day> and integer minutespart of days",+ -3.6309854756950335),+ ("until <time-of-day>after <time-of-day>", -4.324132656254979),+ ("minutehour", -2.072840857648484),+ ("at <time-of-day>part of days", -3.9186675481468147),+ ("until <time-of-day>part of days", -3.9186675481468147),+ ("hh:mmafter <time-of-day>", -4.324132656254979),+ ("at <time-of-day>after part of days", -4.324132656254979),+ ("past year (latent)after <time-of-day>", -4.324132656254979),+ ("secondhour", -4.324132656254979),+ ("from <datetime> - <datetime> (interval)after <time-of-day>",+ -4.324132656254979),+ ("<hour-of-day> till quarteruntil <time-of-day>",+ -3.9186675481468147),+ ("past year (latent)until <time-of-day>", -4.324132656254979),+ ("past year (latent)before part of days", -4.324132656254979),+ ("at <time-of-day>after <time-of-day>", -3.2255203675868693),+ ("<hour-of-day> and integer minutesafter <time-of-day>",+ -3.9186675481468147)],+ n = 48}}),+ ("dd/mm",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("numbers prefix with -, minus",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3}}),+ ("today",+ Classifier{okData =+ ClassData{prior = -1.8718021769015913,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.1670540846631662,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -8.269171584511341e-2,+ unseen = -4.852030263919617,+ likelihoods =+ HashMap.fromList+ [("<hour-of-day> third", -4.151039905898646),+ ("<hour-of-day> and integer minutes", -2.5416019934645457),+ ("<hour-of-day> quarter", -4.151039905898646),+ ("<hour-of-day> till quarter", -3.7455747977904816),+ ("time-of-day ordinal (latent)", -1.8997481072921507),+ ("<hour-of-day> half", -4.151039905898646),+ ("hh:mm", -3.2347491740244907), ("hour", -1.180625440328945),+ ("minute", -1.7996646487351682),+ ("<hour-of-day> till third", -3.7455747977904816),+ ("time-of-day integer (latent)", -1.7996646487351682)],+ n = 58},+ koData =+ ClassData{prior = -2.5336968139574325,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("time-of-day ordinal (latent)", -1.9459101490553135),+ ("hour", -1.252762968495368),+ ("time-of-day integer (latent)", -1.6582280766035324)],+ n = 5}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("Wednesday", -0.6931471805599453),+ ("day", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.6539264674066639, unseen = -3.784189633918261,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal or number) <named-month>",+ -2.662587827025453),+ ("September", -3.068052935133617),+ ("<day-of-month> (ordinal or number) of <named-month>",+ -3.068052935133617),+ ("day", -1.363304842895192), ("year", -2.662587827025453),+ ("part of <named-month>", -2.151762203259462),+ ("month", -3.068052935133617),+ ("year (integer)", -2.662587827025453),+ ("this|last the <cycle>", -3.068052935133617),+ ("day of <named-month>", -3.068052935133617),+ ("this <time>", -3.068052935133617)],+ n = 13},+ koData =+ ClassData{prior = -0.7339691750802004,+ unseen = -3.7376696182833684,+ likelihoods =+ HashMap.fromList+ [("September", -3.0204248861443626),+ ("October", -3.0204248861443626),+ ("intersect", -2.1041341542702074),+ ("Saturday", -3.0204248861443626),+ ("<time> for <duration>", -2.6149597780361984),+ ("day", -3.0204248861443626),+ ("month (ordinal)", -3.0204248861443626),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.6149597780361984),+ ("month", -1.2286654169163076)],+ n = 12}}),+ ("<hour-of-day> and integer minutes",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -3.912023005428146,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (13..19)", -2.505525936990736),+ ("at <time-of-day>integer 21..99", -2.793208009442517),+ ("time-of-day integer (latent)integer (numeric)",+ -2.793208009442517),+ ("at <time-of-day>integer (20..90)", -3.1986731175506815),+ ("time-of-day integer (latent)integer (13..19)",+ -3.1986731175506815),+ ("hour", -0.9473813189441862),+ ("time-of-day ordinal (latent)integer (20..90)",+ -3.1986731175506815),+ ("time-of-day ordinal (latent)integer (numeric)",+ -3.1986731175506815),+ ("at <time-of-day>integer (numeric)", -2.505525936990736),+ ("time-of-day ordinal (latent)integer 21..99",+ -2.793208009442517),+ ("time-of-day ordinal (latent)integer (13..19)",+ -2.793208009442517)],+ n = 18},+ koData =+ ClassData{prior = -1.9459101490553135, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("time-of-day integer (latent)integer 21..99",+ -2.2512917986064953),+ ("time-of-day integer (latent)integer (20..90)",+ -1.845826690498331),+ ("hour", -1.55814461804655)],+ n = 3}}),+ ("this|last <cycle>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("week", -1.791759469228055),+ ("month (grain)", -1.791759469228055),+ ("week (grain)", -1.791759469228055),+ ("day", -1.791759469228055), ("month", -1.791759469228055),+ ("day (grain)", -1.791759469228055)],+ n = 3}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = -2.0149030205422647, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -0.1431008436406733, unseen = -3.332204510175204,+ likelihoods = HashMap.fromList [("", 0.0)], n = 26}}),+ ("in|within|after <duration>",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("week", -1.0986122886681098),+ ("dual <unit-of-duration>", -1.0986122886681098)],+ n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("week", -1.6094379124341003), ("year", -1.2039728043259361),+ ("single <unit-of-duration>", -0.916290731874155)],+ n = 3}}),+ ("Wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.713572066704308,+ likelihoods = HashMap.fromList [("", 0.0)], n = 39}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.6074917359814515, unseen = -5.455321115357702,+ likelihoods =+ HashMap.fromList+ [("Tuesdayon <date>", -4.757891273005756),+ ("in <named-month>year", -4.757891273005756),+ ("<hour-of-day> till thirdafter part of days",+ -4.352426164897591),+ ("dayhour", -3.8416005411316), ("daymonth", -4.757891273005756),+ ("in <named-month>on <date>", -4.757891273005756),+ ("monthyear", -3.253813876229481),+ ("Mondayon <date>", -4.757891273005756),+ ("Christmasyear", -4.757891273005756),+ ("Monday<day-of-month> (ordinal or number) <named-month>",+ -4.757891273005756),+ ("month (integer)year (integer)", -4.352426164897591),+ ("<day-of-week> the last of <time><cycle> this|last|next",+ -4.757891273005756),+ ("at <time-of-day>before part of days", -4.06474409244581),+ ("hh:mmbefore part of days", -4.757891273005756),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.757891273005756),+ ("intersect<time> <part-of-day>", -4.352426164897591),+ ("month (ordinal)year (integer)", -4.757891273005756),+ ("dd/mm<time> <part-of-day>", -4.757891273005756),+ ("Thursday<time> timezone", -4.352426164897591),+ ("<hour-of-day> till quarterthis <part-of-day>",+ -4.352426164897591),+ ("dayday", -2.9661318037777002),+ ("absorption of , after named day<day-of-month> (ordinal or number) <named-month>",+ -4.757891273005756),+ ("hourhour", -3.6592789843376456),+ ("month (integer)year", -4.757891273005756),+ ("Thursday<day-of-month> (ordinal or number) <named-month>",+ -4.757891273005756),+ ("dayyear", -3.505128304510387),+ ("Thursday<time> <part-of-day>", -4.757891273005756),+ ("<cycle> last of <time>year (integer)", -4.352426164897591),+ ("last <cycle> of <time>year (integer)", -4.757891273005756),+ ("<hour-of-day> quarterafter part of days", -4.757891273005756),+ ("minutehour", -2.4553061800117097),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.757891273005756),+ ("Monday<cycle> this|last|next", -4.757891273005756),+ ("<day-of-month> (ordinal or number) of <named-month>year",+ -4.757891273005756),+ ("<cycle> <ordinal> day? of <time>year", -4.757891273005756),+ ("on a <named-day>dd/mm", -4.757891273005756),+ ("on a <named-day>on <date>", -4.757891273005756),+ ("on a <named-day><day-of-month> (ordinal or number) <named-month>",+ -4.757891273005756),+ ("Tuesday<cycle> this|last|next", -4.757891273005756),+ ("dayminute", -3.505128304510387),+ ("dd/mmintersect", -4.757891273005756),+ ("in <named-month><cycle> this|last|next", -4.757891273005756),+ ("<hour-of-day> and integer minutesafter part of days",+ -4.352426164897591),+ ("Saturdaydd/mm", -4.757891273005756),+ ("the <cycle> the <ordinal> of <time>year", -4.757891273005756),+ ("at <time-of-day>after part of days", -3.6592789843376456),+ ("<ordinal> <cycle> of <time>year", -4.757891273005756),+ ("Sunday<cycle> this|last|next", -4.757891273005756),+ ("Tuesday<day-of-month> (ordinal or number) of <named-month>",+ -4.352426164897591),+ ("Septemberon <date>", -4.757891273005756),+ ("from <datetime> - <datetime> (interval)after part of days",+ -4.757891273005756),+ ("intersectintersect", -4.352426164897591),+ ("dayweek", -4.06474409244581), ("weekyear", -3.8416005411316),+ ("<datetime> - <datetime> (interval)after part of days",+ -4.757891273005756),+ ("Friday<day-of-month> (ordinal or number) <named-month>",+ -4.757891273005756),+ ("<hour-of-day> till quarterbefore part of days",+ -4.352426164897591),+ ("<time-of-day> - <time-of-day> (interval)after part of days",+ -4.757891273005756),+ ("at <time-of-day>this <part-of-day>", -4.757891273005756),+ ("<hour-of-day> till thirdbefore part of days",+ -4.352426164897591)],+ n = 67},+ koData =+ ClassData{prior = -0.7868326646372683, unseen = -5.356586274672012,+ likelihoods =+ HashMap.fromList+ [("Tuesdayon <date>", -4.658710952916121),+ ("dayhour", -3.154633556139847),+ ("daymonth", -3.5600986642480117),+ ("monthday", -4.658710952916121),+ ("monthyear", -2.78690877601453),+ ("hh:mmafter part of days", -4.658710952916121),+ ("houryear", -4.253245844807957),+ ("intersectat <time-of-day>", -3.742420221041966),+ ("intersect<time> <part-of-day>", -4.253245844807957),+ ("Octoberon <date>", -4.658710952916121),+ ("until <time-of-day>after part of days", -4.658710952916121),+ ("this|last <cycle>on <date>", -4.658710952916121),+ ("Tuesdayafter <time-of-day>", -4.658710952916121),+ ("Wednesdayon <date>", -4.253245844807957),+ ("dd/mm<time> <part-of-day>", -4.658710952916121),+ ("yearyear", -4.253245844807957),+ ("<hour-of-day> till quarterthis <part-of-day>",+ -4.658710952916121),+ ("dayday", -3.965563772356176),+ ("dd/mmat <time-of-day>", -4.253245844807957),+ ("hourhour", -4.253245844807957),+ ("dayyear", -3.405947984420753),+ ("Thursdayat <time-of-day>", -4.253245844807957),+ ("Februaryyear", -4.658710952916121),+ ("minutemonth", -4.658710952916121),+ ("minutehour", -4.253245844807957),+ ("for <duration> from <time>on <date>", -4.658710952916121),+ ("<day-of-month> (ordinal or number) of <named-month>year",+ -4.253245844807957),+ ("March<cycle> this|last|next", -4.658710952916121),+ ("nth <time> of <time>year", -4.658710952916121),+ ("Wednesday<day-of-month> (ordinal or number) of <named-month>",+ -4.658710952916121),+ ("secondyear", -4.253245844807957),+ ("Wednesdayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.658710952916121),+ ("on <date>year (integer)", -4.658710952916121),+ ("<time> for <duration>year", -3.5600986642480117),+ ("<duration> after|before|from <time>on <date>",+ -4.658710952916121),+ ("dayminute", -3.154633556139847),+ ("Julyuntil <time-of-day>", -4.658710952916121),+ ("intersecton <date>", -4.658710952916121),+ ("at <time-of-day>after part of days", -4.658710952916121),+ ("Octoberyear", -4.658710952916121),+ ("in|within|after <duration>year", -4.253245844807957),+ ("Tuesday<day-of-month> (ordinal or number) of <named-month>",+ -4.658710952916121),+ ("on a <named-day>intersect", -4.253245844807957),+ ("Saturdayintersect", -4.253245844807957),+ ("at <time-of-day>year", -4.658710952916121),+ ("on <date>year", -4.253245844807957),+ ("on <date>on <date>", -4.658710952916121),+ ("weekday", -4.658710952916121),+ ("Tuesdaynth <time> of <time>", -4.658710952916121),+ ("weekyear", -4.658710952916121),+ ("Tuesdayintersect", -4.658710952916121),+ ("after <time-of-day>year", -4.658710952916121),+ ("in <number> (implicit minutes)February", -4.658710952916121),+ ("last <cycle> of <time>year", -4.658710952916121),+ ("<day-of-month> (ordinal or number) of <named-month>on <date>",+ -4.658710952916121)],+ n = 56}}),+ ("the <cycle> the <ordinal> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("day (grain)ordinals (first..tenth)October",+ -2.0794415416798357),+ ("daymonth", -1.3862943611198906),+ ("week (grain)ordinals (first..tenth)month (integer)",+ -2.0794415416798357),+ ("weekmonth", -1.6739764335716716),+ ("week (grain)ordinals (first..tenth)intersect",+ -2.0794415416798357),+ ("day (grain)ordinals (first..tenth)month (integer)",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <number> (implicit minutes)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.7047480922384253),+ ("ordinals (first..tenth)week (grain)in <named-month>",+ -1.7047480922384253),+ ("weekmonth", -1.2992829841302609),+ ("ordinals (first..tenth)week (grain)intersect",+ -1.7047480922384253),+ ("ordinals (first..tenth)day (grain)month (integer)",+ -1.7047480922384253)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("dayday", -1.791759469228055),+ ("at <time-of-day>at <time-of-day>", -1.0986122886681098),+ ("hourhour", -1.0986122886681098),+ ("<day-of-month> (ordinal or number) <named-month><day-of-month> (ordinal or number) <named-month>",+ -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> last",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("day", -0.8754687373538999), ("Sunday", -1.791759469228055),+ ("on a <named-day>", -1.791759469228055),+ ("Tuesday", -1.3862943611198906)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Saturday",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer 5integer (20..90)", -0.6931471805599453),+ ("integer 3integer (20..90)", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("Monday", -0.6931471805599453), ("day", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (13..19)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("integer 5integer 10", -0.916290731874155),+ ("integer 8integer 10", -0.5108256237659907)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> for <duration>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.1780538303479458,+ likelihoods =+ HashMap.fromList+ [("intersectsingle <unit-of-duration>", -2.4423470353692043),+ ("monthyear", -1.5260563034950494),+ ("nth <time> of <time>single <unit-of-duration>",+ -2.4423470353692043),+ ("dayyear", -2.03688192726104),+ ("last <cycle> of <time>single <unit-of-duration>",+ -2.4423470353692043),+ ("weekyear", -2.4423470353692043),+ ("Octobersingle <unit-of-duration>", -2.4423470353692043),+ ("Septembersingle <unit-of-duration>", -2.4423470353692043),+ ("on <date>single <unit-of-duration>", -2.03688192726104)],+ n = 7}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) in <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)month (ordinal)",+ -1.252762968495368),+ ("month", -0.8472978603872037),+ ("ordinals (composite, e.g., eighty-seven)ordinals (composite, e.g., eighty-seven)in <named-month>",+ -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (first..tenth)",+ Classifier{okData =+ ClassData{prior = -0.21825356602001794,+ unseen = -3.7612001156935624,+ likelihoods = HashMap.fromList [("", 0.0)], n = 41},+ koData =+ ClassData{prior = -1.62924053973028, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10}}),+ ("Monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = -0.1823215567939546,+ unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -1.791759469228055, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (twenty, thirty..ninety)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("<hour-of-day> <integer>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer 10", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2}}),+ ("<time> nth of <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0296194171811581),+ ("Wednesdayordinals (first..tenth)intersect",+ -1.9459101490553135),+ ("Tuesdayordinals (first..tenth)intersect by \",\", \"of\", \"from\", \"'s\"",+ -1.9459101490553135),+ ("Tuesdayordinals (first..tenth)in <named-month>",+ -1.9459101490553135),+ ("Tuesdayordinals (first..tenth)October", -1.9459101490553135)],+ n = 4},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.2039728043259361),+ ("Tuesdayordinals (first..tenth)in <named-month>",+ -1.6094379124341003),+ ("Wednesdayordinals (first..tenth)in <named-month>",+ -1.6094379124341003)],+ n = 2}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.6739764335716716),+ ("ordinals (first..tenth)intersect by \",\", \"of\", \"from\", \"'s\"year (integer)",+ -2.367123614131617),+ ("ordinals (first..tenth)on a <named-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.772588722239781),+ ("dayyear", -2.0794415416798357),+ ("ordinals (first..tenth)Tuesdaymonth (integer)",+ -2.772588722239781),+ ("ordinals (first..tenth)Wednesdayintersect by \",\", \"of\", \"from\", \"'s\"",+ -2.367123614131617),+ ("ordinals (first..tenth)intersectyear (integer)",+ -2.772588722239781),+ ("ordinals (first..tenth)Tuesdayintersect",+ -2.772588722239781)],+ n = 8},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..tenth)TuesdaySeptember", -2.772588722239781),+ ("ordinals (first..tenth)time-of-day integer (latent)intersect",+ -2.772588722239781),+ ("daymonth", -1.8562979903656263),+ ("ordinals (first..tenth)time-of-day integer (latent)February",+ -2.367123614131617),+ ("hourmonth", -1.8562979903656263),+ ("ordinals (first..tenth)WednesdayOctober", -2.772588722239781),+ ("ordinals (first..tenth)on a <named-day>September",+ -2.772588722239781),+ ("ordinals (first..tenth)time-of-day integer (latent)this|last the <cycle>",+ -2.772588722239781),+ ("ordinals (first..tenth)Wednesdayin <named-month>",+ -2.772588722239781)],+ n = 8}}),+ ("<hour-of-day> quarter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.5040773967762742),+ ("time-of-day ordinal (latent)", -1.0986122886681098),+ ("hour", -0.8109302162163288)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> till quarter",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.3862943611198906),+ ("time-of-day ordinal (latent)", -1.791759469228055),+ ("hour", -0.8754687373538999),+ ("time-of-day integer (latent)", -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hour", -1.0986122886681098),+ ("time-of-day integer (latent)", -1.0986122886681098)],+ n = 1}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.0910424533583156,+ likelihoods = HashMap.fromList [("", 0.0)], n = 20},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("past year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3}}),+ ("integer 8",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.6131044728864089,+ unseen = -3.7376696182833684,+ likelihoods =+ HashMap.fromList+ [("ordinals (thirtieth..nineteenth)February",+ -2.6149597780361984),+ ("ordinals (first..tenth)October", -2.6149597780361984),+ ("ordinals (first..tenth)April", -2.6149597780361984),+ ("ordinals (first..tenth)February", -3.0204248861443626),+ ("ordinals (first..tenth)month (integer)", -2.6149597780361984),+ ("ordinals (first..tenth)March", -2.6149597780361984),+ ("month", -1.074514737089049),+ ("ordinals (first..tenth)in <named-month>",+ -2.6149597780361984)],+ n = 13},+ koData =+ ClassData{prior = -0.7801585575495751,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("integer 2in <named-month>", -2.917770732084279),+ ("integer 10February", -2.512305623976115),+ ("integer (numeric)month (ordinal)", -2.917770732084279),+ ("ordinals (first..tenth)month (integer)", -2.917770732084279),+ ("integer (20..90)in <named-month>", -2.917770732084279),+ ("ordinals (composite, e.g., eighty-seven)in <named-month>",+ -2.917770732084279),+ ("ordinals (twenty, thirty..ninety)in <named-month>",+ -2.917770732084279),+ ("month", -1.126011262856224),+ ("ordinals (first..tenth)in <named-month>", -2.512305623976115),+ ("ordinals (first..tenth)August", -2.917770732084279)],+ n = 11}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 2}}),+ ("<cycle> <ordinal> day? of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("day (grain)ordinals (first..tenth)October",+ -2.0794415416798357),+ ("daymonth", -1.3862943611198906),+ ("week (grain)ordinals (first..tenth)month (integer)",+ -2.0794415416798357),+ ("weekmonth", -1.6739764335716716),+ ("week (grain)ordinals (first..tenth)intersect",+ -2.0794415416798357),+ ("day (grain)ordinals (first..tenth)month (integer)",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("powers of tens",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("Friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> this|last|next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.970291913552122,+ likelihoods =+ HashMap.fromList+ [("week", -1.3862943611198906),+ ("month (grain)", -2.5649493574615367),+ ("year (grain)", -2.341805806147327),+ ("week (grain)", -1.3862943611198906),+ ("day", -2.5649493574615367), ("year", -2.341805806147327),+ ("month", -2.5649493574615367),+ ("day (grain)", -2.5649493574615367)],+ n = 22},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("time-of-day ordinal (latent)",+ Classifier{okData =+ ClassData{prior = -0.13976194237515874,+ unseen = -3.1780538303479458,+ likelihoods =+ HashMap.fromList+ [("ordinals (twelveth)", -2.03688192726104),+ ("ordinals (first..tenth)", -0.3022808718729337),+ ("ordinals (eleventh)", -2.03688192726104)],+ n = 20},+ koData =+ ClassData{prior = -2.03688192726104, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..tenth)", -0.40546510810816444)],+ n = 3}}),+ ("ordinals (eleventh)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer 2",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),+ ("by <time>",+ Classifier{okData =+ ClassData{prior = -1.252762968495368, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.2992829841302609),+ ("hour", -1.7047480922384253), ("minute", -1.7047480922384253)],+ n = 2},+ koData =+ ClassData{prior = -0.3364722366212129, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.1400661634962708),+ ("<day-of-month> (ordinal or number) of <named-month>",+ -2.1400661634962708),+ ("time-of-day ordinal (latent)", -2.1400661634962708),+ ("day", -1.4469189829363254),+ ("<day-of-month> (ordinal)", -1.7346010553881064),+ ("hour", -1.7346010553881064)],+ n = 5}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("Sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),+ ("<hour-of-day> half",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.3862943611198906),+ ("time-of-day ordinal (latent)", -1.3862943611198906),+ ("hour", -0.9808292530117262)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hour", -1.0986122886681098),+ ("time-of-day integer (latent)", -1.0986122886681098)],+ n = 1}}),+ ("month (integer)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.8718021769015913),+ ("integer 10", -0.6190392084062235),+ ("integer 3", -1.1786549963416462)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -1.4469189829363254,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList [("integer (numeric)", -0.1823215567939546)],+ n = 4},+ koData =+ ClassData{prior = -0.2682639865946794, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.2231435513142097),+ ("powers of tens", -1.6094379124341003)],+ n = 13}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.8472978603872037),+ ("Monday<cycle> this|last|next", -1.252762968495368),+ ("Mondayin <named-month>", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.8501476017100584,+ likelihoods =+ HashMap.fromList+ [("integer 10minute (grain)", -2.4423470353692043),+ ("year", -2.7300291078209855),+ ("integer 10year (grain)", -2.7300291078209855),+ ("integer (20..90)minute (grain)", -2.4423470353692043),+ ("month", -2.7300291078209855),+ ("integer (numeric)minute (grain)", -2.4423470353692043),+ ("integer (numeric)month (grain)", -2.7300291078209855),+ ("minute", -1.120591195386885),+ ("integer 21..99minute (grain)", -2.7300291078209855),+ ("integer (13..19)minute (grain)", -2.4423470353692043)],+ n = 18}}),+ ("dual <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("week", -0.6931471805599453),+ ("week (grain)", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer 10",+ Classifier{okData =+ ClassData{prior = -0.8472978603872037,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -0.5596157879354228, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)July", -1.252762968495368),+ ("month", -0.8472978603872037),+ ("integer (numeric)integer (numeric)in <named-month>",+ -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("March", -1.2992829841302609), ("month", -0.7884573603642702),+ ("in <named-month>", -1.2992829841302609)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -0.10536051565782628,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -2.3025850929940455,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<hour-of-day> and integer",+ Classifier{okData =+ ClassData{prior = -1.3217558399823195, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (13..19)", -2.1400661634962708),+ ("at <time-of-day>integer 21..99", -1.7346010553881064),+ ("hour", -1.2237754316221157),+ ("at <time-of-day>integer (numeric)", -2.1400661634962708)],+ n = 4},+ koData =+ ClassData{prior = -0.3101549283038396,+ unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer 5", -2.3353749158170367),+ ("at <time-of-day>integer (13..19)", -2.3353749158170367),+ ("at <time-of-day>integer 3", -2.740840023925201),+ ("at <time-of-day>integer 4", -2.740840023925201),+ ("at <time-of-day>integer (20..90)", -2.740840023925201),+ ("at <time-of-day>integer 8", -2.3353749158170367),+ ("hour", -0.9490805546971459),+ ("at <time-of-day>integer (numeric)", -2.3353749158170367)],+ n = 11}}),+ ("month (ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("ordinals (first..tenth)", 0.0)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer 4",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("the <cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.2992829841302609),+ ("dayday", -0.7884573603642702),+ ("day (grain)yesterday", -1.2992829841302609)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("<day-of-week> next", -1.8718021769015913),+ ("at <time-of-day>", -1.466337068793427),+ ("day", -1.466337068793427), ("hour", -1.466337068793427),+ ("Tuesday", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ Classifier{okData =+ ClassData{prior = -0.5533852381847867, unseen = -4.430816798843313,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.627081138568543),+ ("daymonth", -2.472930458741285),+ ("monthyear", -2.627081138568543),+ ("Wednesdayintersect", -3.7256934272366524),+ ("<named-month>|<named-day> <day-of-month> (ordinal)October",+ -3.7256934272366524),+ ("Wednesday<day-of-month> (ordinal or number) <named-month>",+ -3.7256934272366524),+ ("dayday", -2.8094026953624978),+ ("Thursday<day-of-month> (ordinal or number) <named-month>",+ -3.7256934272366524),+ ("in <named-month>year (integer)", -3.3202283191284883),+ ("Thursdayat <time-of-day>", -3.7256934272366524),+ ("Thursday<time> <part-of-day>", -3.3202283191284883),+ ("<named-month>|<named-day> <day-of-month> (ordinal)this|last the <cycle>",+ -3.7256934272366524),+ ("last <cycle> of <time>year (integer)", -3.7256934272366524),+ ("Tuesdaymonth (integer)", -3.7256934272366524),+ ("Wednesday<day-of-month> (ordinal or number) of <named-month>",+ -3.7256934272366524),+ ("Thursday<datetime> - <datetime> (interval)",+ -3.7256934272366524),+ ("Septemberyear (integer)", -3.3202283191284883),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.7256934272366524),+ ("on a <named-day>September", -3.7256934272366524),+ ("Octoberyear (integer)", -3.7256934272366524),+ ("Sunday<cycle> this|last|next", -3.7256934272366524),+ ("dayweek", -3.3202283191284883),+ ("weekyear", -3.7256934272366524),+ ("Mondaythis|last the <cycle>", -3.7256934272366524),+ ("<named-month>|<named-day> <day-of-month> (ordinal)in <named-month>",+ -3.7256934272366524),+ ("Wednesdayin <named-month>", -3.7256934272366524)],+ n = 23},+ koData =+ ClassData{prior = -0.8556661100577202, unseen = -4.276666119016055,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.065455299705096),+ ("TuesdaySeptember", -3.56953269648137),+ ("monthyear", -2.653241964607215),+ ("on a <named-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -3.56953269648137),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year (integer)",+ -2.8763855159214247),+ ("dayyear", -2.4709204078132605),+ ("Monday<cycle> this|last|next", -3.56953269648137),+ ("Wednesdayintersect by \",\", \"of\", \"from\", \"'s\"",+ -3.56953269648137),+ ("Septemberyear (integer)", -3.56953269648137),+ ("on <date>year (integer)", -3.164067588373206),+ ("Octoberyear (integer)", -3.56953269648137),+ ("intersectyear (integer)", -3.56953269648137),+ ("Mondayin <named-month>", -3.56953269648137),+ ("<day-of-month> (ordinal or number) of <named-month>year (integer)",+ -3.56953269648137),+ ("Tuesdayintersect by \",\", \"of\", \"from\", \"'s\"",+ -3.56953269648137),+ ("<named-month>|<named-day> <day-of-month> (ordinal)in <named-month>",+ -3.164067588373206)],+ n = 17}}),+ ("integer 3",+ Classifier{okData =+ ClassData{prior = -1.0560526742493137,+ unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -0.4274440148269396, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("Monday", -1.845826690498331),+ ("<day-of-month> (ordinal or number) of <named-month>",+ -2.2512917986064953),+ ("day", -1.3350010667323402),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.2512917986064953),+ ("March", -2.2512917986064953), ("month", -1.845826690498331),+ ("in <named-month>", -2.2512917986064953)],+ n = 6}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("Sundayordinals (thirtieth..nineteenth)", -2.1972245773362196),+ ("Tuesdayordinals (first..tenth)", -1.791759469228055),+ ("Tuesdayordinals (thirtieth..nineteenth)",+ -2.1972245773362196),+ ("day", -1.0986122886681098),+ ("Saturdayordinals (thirtieth..nineteenth)",+ -2.1972245773362196)],+ n = 5},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("Wednesdayordinals (first..tenth)", -2.1972245773362196),+ ("Tuesdayordinals (first..tenth)", -1.791759469228055),+ ("Sundayordinals (first..tenth)", -2.1972245773362196),+ ("day", -1.0986122886681098),+ ("Saturdayordinals (first..tenth)", -2.1972245773362196)],+ n = 5}}),+ ("after part of days",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..tenth)", -0.5108256237659907),+ ("ordinals (eleventh)", -1.6094379124341003),+ ("ordinals (composite, e.g., eighty-seven)",+ -1.6094379124341003)],+ n = 7}}),+ ("Christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal or number) <named-month>",+ -2.5455312716044354),+ ("<time> <part-of-day>", -2.322387720290225),+ ("at <time-of-day>", -2.1400661634962708),+ ("intersect", -3.2386784521643803),+ ("yesterday", -2.5455312716044354),+ ("<day-of-month> (ordinal or number) of <named-month>",+ -3.2386784521643803),+ ("day", -1.8523840910444898), ("hour", -1.3668762752627892),+ ("<time-of-day> - <time-of-day> (interval)",+ -3.2386784521643803),+ ("minute", -3.2386784521643803),+ ("part of days", -2.833213344056216)],+ n = 20}}),+ ("on a <named-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("Saturday", -2.0149030205422647),+ ("Monday", -2.0149030205422647),+ ("Friday", -2.0149030205422647), ("day", -0.916290731874155),+ ("Tuesday", -1.6094379124341003)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after|before|from <time>",+ Classifier{okData =+ ClassData{prior = -1.252762968495368, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("dayday", -1.6094379124341003),+ ("single <unit-of-duration>yesterday", -2.0149030205422647),+ ("single <unit-of-duration>tomorrow", -2.0149030205422647)],+ n = 2},+ koData =+ ClassData{prior = -0.3364722366212129,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("single <unit-of-duration>intersect", -2.3513752571634776),+ ("daymonth", -2.3513752571634776),+ ("single <unit-of-duration>in <named-month>",+ -2.3513752571634776),+ ("single <unit-of-duration>part of days", -2.3513752571634776),+ ("minutehour", -1.9459101490553135),+ ("single <unit-of-duration>month (integer)",+ -2.3513752571634776),+ ("secondmonth", -1.9459101490553135),+ ("<integer> <unit-of-duration>part of days",+ -2.3513752571634776)],+ n = 5}}),+ ("before part of days",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (thirtieth..nineteenth)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (integer)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> n next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("week", -0.6931471805599453),+ ("week (grain)integer 3", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer 5",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.1823215567939546, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("dayday", -2.1400661634962708),+ ("at <time-of-day>at <time-of-day>", -1.4469189829363254),+ ("hourhour", -1.2237754316221157),+ ("<day-of-month> (ordinal or number) <named-month><day-of-month> (ordinal or number) <named-month>",+ -2.1400661634962708),+ ("intersect by \",\", \"of\", \"from\", \"'s\"at <time-of-day>",+ -2.1400661634962708)],+ n = 5},+ koData =+ ClassData{prior = -1.791759469228055, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("monthday", -1.5040773967762742),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -1.5040773967762742)],+ n = 1}}),+ ("Tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last the <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("week", -1.791759469228055),+ ("month (grain)", -2.1972245773362196),+ ("year (grain)", -2.1972245773362196),+ ("week (grain)", -1.791759469228055),+ ("day", -2.1972245773362196), ("year", -2.1972245773362196),+ ("month", -2.1972245773362196),+ ("day (grain)", -2.1972245773362196)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("September", -2.3978952727983707),+ ("October", -1.7047480922384253),+ ("February", -2.3978952727983707),+ ("March", -1.7047480922384253), ("month", -0.7884573603642702)],+ n = 14},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>at <time-of-day>", -0.916290731874155),+ ("hourhour", -0.916290731874155)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("hourhour", -0.916290731874155),+ ("at <time-of-day>time-of-day integer (latent)",+ -1.2039728043259361),+ ("until <time-of-day>time-of-day integer (latent)",+ -1.6094379124341003)],+ n = 3}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..tenth)Tuesdayintersect",+ -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..tenth)TuesdayChristmas",+ -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -1.5040773967762742),+ ("month", -0.8109302162163288),+ ("Julyinteger (numeric)", -1.0986122886681098)],+ n = 3}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.791759469228055),+ ("week (grain)intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.1972245773362196),+ ("day (grain)intersect", -2.1972245773362196),+ ("weekmonth", -1.791759469228055),+ ("week (grain)September", -2.1972245773362196),+ ("day (grain)month (integer)", -2.1972245773362196)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("week (grain)<time> for <duration>", -2.0794415416798357),+ ("weekmonth", -1.6739764335716716),+ ("weekday", -2.0794415416798357),+ ("week (grain)intersect", -2.0794415416798357),+ ("week (grain)Saturday", -2.0794415416798357)],+ n = 3}}),+ ("ordinals (composite, e.g., eighty-seven)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> last of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("week (grain)month (ordinal)", -1.9459101490553135),+ ("daymonth", -1.540445040947149),+ ("day (grain)intersect", -1.9459101490553135),+ ("weekmonth", -1.540445040947149),+ ("week (grain)intersect", -1.9459101490553135),+ ("day (grain)month (integer)", -1.9459101490553135)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.295836866004329,+ likelihoods =+ HashMap.fromList+ [("intersect", -2.5649493574615367),+ ("tomorrow", -1.8718021769015913), ("day", -1.466337068793427),+ ("Christmas", -2.5649493574615367),+ ("hour", -1.466337068793427),+ ("part of days", -1.466337068793427)],+ n = 10}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = -0.3629054936893685, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -1.1895840668738362,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("right now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("single <unit-of-duration>intersect", -1.252762968495368),+ ("single <unit-of-duration>in <named-month>",+ -1.252762968495368),+ ("secondmonth", -0.8472978603872037)],+ n = 2}}),+ ("<day-of-week> the last of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("Tuesdayin <named-month>", -1.6094379124341003),+ ("Mondaymonth (integer)", -1.6094379124341003),+ ("Tuesdayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("day of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("month (integer)", -1.3862943611198906),+ ("March", -1.791759469228055), ("month", -0.8754687373538999),+ ("in <named-month>", -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -1.3862943611198906), ("month", -0.9808292530117262),+ ("in <named-month>", -1.3862943611198906)],+ n = 2}}),+ ("<day-of-week> last",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("day", -0.8754687373538999), ("Sunday", -1.791759469228055),+ ("on a <named-day>", -1.791759469228055),+ ("Tuesday", -1.3862943611198906)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("compose by multiplication",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods =+ HashMap.fromList [("integer (numeric)powers of tens", 0.0)],+ n = 1}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.0986122886681098),+ ("month", -0.8109302162163288),+ ("Augustinteger (numeric)integer (numeric)",+ -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of days",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -3.367295829986474,+ likelihoods = HashMap.fromList [("", 0.0)], n = 27},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),+ ("<hour-of-day> till third",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.3862943611198906),+ ("time-of-day ordinal (latent)", -1.791759469228055),+ ("hour", -0.8754687373538999),+ ("time-of-day integer (latent)", -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("time-of-day integer (latent)",+ Classifier{okData =+ ClassData{prior = -0.5306282510621704,+ unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.3448404862917295),+ ("integer 3", -1.791759469228055),+ ("integer 5", -2.4849066497880004)],+ n = 20},+ koData =+ ClassData{prior = -0.8873031950009028,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.0986122886681098),+ ("integer 10", -0.8109302162163288),+ ("integer 3", -2.1972245773362196),+ ("integer 5", -2.1972245773362196)],+ n = 14}}),+ ("single <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -4.248495242049359, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("day", -1.791759469228055),+ ("day (grain)", -1.791759469228055)],+ n = 2},+ koData =+ ClassData{prior = -1.4388737452099556e-2,+ unseen = -5.673323267171493,+ likelihoods =+ HashMap.fromList+ [("week", -2.6253584852570966),+ ("month (grain)", -2.2358937184953733),+ ("hour (grain)", -1.9810014688665833),+ ("year (grain)", -2.8972922007407385),+ ("second", -4.060443010546419),+ ("week (grain)", -2.6253584852570966),+ ("day", -2.578838469622204),+ ("minute (grain)", -3.367295829986474),+ ("year", -2.8972922007407385),+ ("second (grain) ", -4.060443010546419),+ ("hour", -1.9810014688665833), ("month", -2.2358937184953733),+ ("minute", -3.367295829986474),+ ("day (grain)", -2.578838469622204)],+ n = 138}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)July", -1.0986122886681098),+ ("month", -0.8109302162163288),+ ("integer (numeric)integer (numeric)in <named-month>",+ -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("today", -1.252762968495368), ("Monday", -1.252762968495368),+ ("day", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("August",+ Classifier{okData =+ ClassData{prior = -2.0794415416798357,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.13353139262452263,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}})]
Duckling/Ranking/Classifiers/DA_XX.hs view
@@ -23,30 +23,30 @@ = HashMap.fromList [("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.044522437723423,+ ClassData{prior = 0.0, unseen = -3.4339872044851463, likelihoods = HashMap.fromList- [("at <time-of-day>", -1.2039728043259361),- ("hh:mm", -1.6094379124341003), ("hour", -1.6094379124341003),- ("minute", -1.2039728043259361)],- n = 8},+ [("at <time-of-day>", -1.3217558399823195),+ ("hh:mm", -1.455287232606842), ("hour", -2.0149030205422647),+ ("minute", -1.0033021088637848)],+ n = 13}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("Thursday", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.778087857209029, unseen = -4.962844630259907,+ ClassData{prior = -0.7974433001619848, unseen = -4.962844630259907, likelihoods = HashMap.fromList [("", 0.0)], n = 141}, koData =- ClassData{prior = -0.6148599592306538, unseen = -5.123963979403259,- likelihoods = HashMap.fromList [("", 0.0)], n = 166}}),+ ClassData{prior = -0.5987087137267001, unseen = -5.159055299214529,+ likelihoods = HashMap.fromList [("", 0.0)], n = 172}}), ("the day before yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -100,25 +100,25 @@ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("at <time-of-day>", Classifier{okData =- ClassData{prior = -0.25593337413720063,- unseen = -4.6443908991413725,+ ClassData{prior = -0.2682639865946794, unseen = -4.718498871295094, likelihoods = HashMap.fromList- [("<time> timezone", -3.536116699561526),- ("time-of-day (latent)", -1.2007417837444896),+ [("<time> timezone", -3.100092288878234),+ ("time-of-day (latent)", -1.2755429968271879), ("relative minutes after|past <integer> (hour-of-day)",- -3.536116699561526),- ("hh:mm", -2.069779630768099),- ("<time-of-day> sharp", -3.536116699561526),- ("hour", -1.1382214267631554), ("minute", -1.8015156441734197)],- n = 48},+ -3.6109179126442243),+ ("hh:mm", -2.001480000210124),+ ("<time-of-day> sharp", -3.6109179126442243),+ ("hour", -1.213022639845854), ("minute", -1.6650077635889111)],+ n = 52}, koData =- ClassData{prior = -1.488077055429833, unseen = -3.58351893845611,+ ClassData{prior = -1.4469189829363254,+ unseen = -3.6888794541139363, likelihoods = HashMap.fromList- [("time-of-day (latent)", -0.8472978603872037),- ("hour", -0.8472978603872037)],- n = 14}}),+ [("time-of-day (latent)", -0.8303483020734304),+ ("hour", -0.8303483020734304)],+ n = 16}}), ("absorption of , after named day", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1354942159291497,@@ -287,142 +287,141 @@ n = 2}}), ("intersect", Classifier{okData =- ClassData{prior = -0.43117346481837143,- unseen = -5.820082930352362,+ ClassData{prior = -0.44236966504361536,+ unseen = -5.849324779946859, likelihoods = HashMap.fromList [("<datetime> - <datetime> (interval)on <date>",- -4.02535169073515),+ -4.054679305829669), ("Wednesday<named-month> <day-of-month> (non ordinal)",- -5.123963979403259),+ -5.153291594497779), ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.02535169073515),- ("hourday", -5.123963979403259),- ("dayhour", -2.872672180796764),- ("daymonth", -3.332204510175204),- ("monthyear", -3.044522437723423),- ("Mondayon <date>", -5.123963979403259),- ("intersecthh:mm", -5.123963979403259),- ("Wednesdaynext <cycle>", -5.123963979403259),- ("Marchyear", -4.718498871295094),+ -4.054679305829669),+ ("hourday", -5.153291594497779),+ ("dayhour", -2.901999795891284),+ ("daymonth", -3.361532125269724),+ ("monthyear", -3.073850052817943),+ ("Mondayon <date>", -5.153291594497779),+ ("intersecthh:mm", -5.153291594497779),+ ("Wednesdaynext <cycle>", -5.153291594497779),+ ("Marchyear", -4.747826486389615), ("intersect by \"of\", \"from\", \"'s\"year",- -4.718498871295094),- ("Mondayintersect", -5.123963979403259),- ("last <day-of-week> of <time>year", -4.718498871295094),- ("todayat <time-of-day>", -4.718498871295094),- ("Thursday<time> timezone", -4.430816798843313),- ("dayday", -3.044522437723423),- ("dd/mmat <time-of-day>", -4.207673247529104),- ("the <day-of-month> (ordinal)February", -4.718498871295094),- ("intersect by \",\"hh:mm", -4.207673247529104),- ("Mondaythe <day-of-month> (non ordinal)", -5.123963979403259),+ -4.747826486389615),+ ("Mondayintersect", -5.153291594497779),+ ("last <day-of-week> of <time>year", -4.747826486389615),+ ("todayat <time-of-day>", -4.747826486389615),+ ("Thursday<time> timezone", -3.900528626002411),+ ("dayday", -3.073850052817943),+ ("dd/mmat <time-of-day>", -4.237000862623624),+ ("the <day-of-month> (ordinal)February", -4.747826486389615),+ ("intersect by \",\"hh:mm", -4.237000862623624),+ ("Mondaythe <day-of-month> (non ordinal)", -5.153291594497779), ("Thursdaybetween <time-of-day> and <time-of-day> (interval)",- -5.123963979403259),- ("dayyear", -3.2521618025016674),+ -5.153291594497779),+ ("dayyear", -3.2814894175961875), ("Thursdaybetween <datetime> and <datetime> (interval)",- -5.123963979403259),- ("Thursdayat <time-of-day>", -4.718498871295094),- ("tomorrow<time-of-day> sharp", -4.718498871295094),+ -5.153291594497779),+ ("Thursdayat <time-of-day>", -4.237000862623624),+ ("tomorrow<time-of-day> sharp", -4.747826486389615), ("<day-of-month>(ordinal) <named-month>year",- -4.718498871295094),+ -4.747826486389615), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -4.02535169073515),+ -4.054679305829669), ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.718498871295094),+ -4.747826486389615), ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.718498871295094),- ("tomorrowuntil <time-of-day>", -4.718498871295094),+ -4.747826486389615),+ ("tomorrowuntil <time-of-day>", -4.747826486389615), ("absorption of , after named day<day-of-month> (non ordinal) <named-month>",- -4.430816798843313),- ("the <day-of-month> (ordinal)March", -4.207673247529104),- ("after <time-of-day>at <time-of-day>", -4.718498871295094),+ -4.460144413937834),+ ("the <day-of-month> (ordinal)March", -4.237000862623624),+ ("after <time-of-day>at <time-of-day>", -4.747826486389615), ("intersect by \",\"<day-of-month> (non ordinal) <named-month>",- -4.718498871295094),- ("Mondaythe <day-of-month> (ordinal)", -5.123963979403259),- ("tomorrowafter <time-of-day>", -4.718498871295094),+ -4.747826486389615),+ ("Mondaythe <day-of-month> (ordinal)", -5.153291594497779),+ ("tomorrowafter <time-of-day>", -4.747826486389615), ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.207673247529104),+ -4.237000862623624), ("Sunday<day-of-month> (non ordinal) <named-month>",- -5.123963979403259),- ("dayminute", -2.772588722239781),- ("Tuesdaythis <time>", -4.430816798843313),+ -5.153291594497779),+ ("dayminute", -2.588342237036242),+ ("Tuesdaythis <time>", -4.460144413937834), ("from <datetime> - <datetime> (interval)on <date>",- -4.430816798843313),- ("<ordinal> <cycle> of <time>year", -4.718498871295094),- ("minuteday", -2.521274293958875),+ -4.460144413937834),+ ("<ordinal> <cycle> of <time>year", -4.747826486389615),+ ("minuteday", -2.550601909053395), ("absorption of , after named dayintersect",- -5.123963979403259),- ("Octoberyear", -3.5145260669691587),- ("yearhh:mm", -5.123963979403259),+ -5.153291594497779),+ ("Octoberyear", -3.543853682063679),+ ("yearhh:mm", -5.153291594497779), ("absorption of , after named dayintersect by \",\"",- -4.718498871295094),- ("dd/mmyear", -4.718498871295094),- ("Septemberyear", -4.207673247529104),- ("at <time-of-day>on <date>", -5.123963979403259),+ -4.747826486389615),+ ("dd/mmyear", -4.747826486389615),+ ("Septemberyear", -4.237000862623624),+ ("at <time-of-day>on <date>", -5.153291594497779), ("between <time-of-day> and <time-of-day> (interval)on <date>",- -5.123963979403259),+ -5.153291594497779), ("between <datetime> and <datetime> (interval)on <date>",- -5.123963979403259),- ("dayweek", -4.02535169073515),- ("weekyear", -4.207673247529104),- ("hh:mmtomorrow", -4.430816798843313),- ("Wednesdaythis <time>", -4.207673247529104),- ("tomorrowat <time-of-day>", -3.871201010907891),- ("at <time-of-day>tomorrow", -4.718498871295094),- ("intersectFebruary", -5.123963979403259),- ("last <cycle> of <time>year", -4.207673247529104),- ("Mondaythis <time>", -5.123963979403259),+ -5.153291594497779),+ ("dayweek", -4.054679305829669),+ ("weekyear", -4.237000862623624),+ ("hh:mmtomorrow", -4.460144413937834),+ ("Wednesdaythis <time>", -4.237000862623624),+ ("tomorrowat <time-of-day>", -3.900528626002411),+ ("at <time-of-day>tomorrow", -4.747826486389615),+ ("intersectFebruary", -5.153291594497779),+ ("last <cycle> of <time>year", -4.237000862623624),+ ("Mondaythis <time>", -5.153291594497779), ("<day-of-month> (non ordinal) <named-month>year",- -4.718498871295094),- ("yearminute", -5.123963979403259)],- n = 128},+ -4.747826486389615),+ ("yearminute", -5.153291594497779)],+ n = 133}, koData =- ClassData{prior = -1.049097224140729, unseen = -5.389071729816501,+ ClassData{prior = -1.0286537000611993, unseen = -5.43372200355424, likelihoods = HashMap.fromList- [("dayhour", -3.305053521109253),- ("daymonth", -2.0886581967847597),- ("monthday", -3.775057150354989),- ("monthyear", -3.775057150354989),- ("Marchyear", -3.9982007016691985),+ [("dayhour", -3.126760535960395),+ ("daymonth", -2.133508762950112),+ ("monthday", -3.8199077165203406),+ ("monthyear", -3.8199077165203406),+ ("Marchyear", -4.04305126783455), ("intersect by \"of\", \"from\", \"'s\"year",- -3.438584913733776),- ("Sundaythis <time>", -3.775057150354989),- ("absorption of , after named dayJuly", -4.285882774120979),- ("dd/mmat <time-of-day>", -3.775057150354989),- ("hourhour", -3.438584913733776),+ -3.4834354798991276),+ ("Sundaythis <time>", -3.8199077165203406),+ ("absorption of , after named dayJuly", -4.330733340286331),+ ("dd/mmat <time-of-day>", -3.8199077165203406),+ ("hourhour", -3.4834354798991276), ("Thursdaybetween <time-of-day> and <time-of-day> (interval)",- -4.6913478822291435),- ("dayyear", -3.305053521109253),+ -4.736198448394496),+ ("dayyear", -3.349904087274605), ("Thursdaybetween <datetime> and <datetime> (interval)",- -4.6913478822291435),- ("Thursdayat <time-of-day>", -3.775057150354989),- ("Thursdayhh:mm", -4.6913478822291435),- ("WednesdayFebruary", -4.6913478822291435),+ -4.736198448394496),+ ("Thursdayat <time-of-day>", -3.2321210516182215),+ ("Thursdayhh:mm", -4.330733340286331),+ ("WednesdayFebruary", -4.736198448394496), ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.285882774120979),+ -4.330733340286331), ("in|during the <part-of-day>until <time-of-day>",- -4.285882774120979),+ -4.330733340286331), ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.6913478822291435),- ("Aprilyear", -4.6913478822291435),+ -4.736198448394496),+ ("Aprilyear", -4.736198448394496), ("<named-month> <day-of-month> (non ordinal)August",- -3.775057150354989),- ("until <time-of-day>on <date>", -4.6913478822291435),+ -3.8199077165203406),+ ("until <time-of-day>on <date>", -4.736198448394496), ("August<day-of-month> (non ordinal) <named-month>",- -3.775057150354989),- ("dayminute", -3.305053521109253),- ("Tuesdaythis <time>", -3.775057150354989),- ("minuteday", -3.1872704854528697),- ("hh:mmon <date>", -3.305053521109253),- ("Wednesdaythis <time>", -3.438584913733776),- ("absorption of , after named dayFebruary",- -3.9982007016691985),- ("this <part-of-day>until <time-of-day>", -4.285882774120979),- ("tomorrownoon", -4.6913478822291435),- ("this <time>until <time-of-day>", -4.285882774120979),- ("Mondaythis <time>", -4.285882774120979)],- n = 69}}),+ -3.8199077165203406),+ ("dayminute", -3.0314503561560704),+ ("Tuesdaythis <time>", -3.8199077165203406),+ ("minuteday", -3.2321210516182215),+ ("hh:mmon <date>", -3.349904087274605),+ ("Wednesdaythis <time>", -3.4834354798991276),+ ("absorption of , after named dayFebruary", -4.04305126783455),+ ("this <part-of-day>until <time-of-day>", -4.330733340286331),+ ("tomorrownoon", -4.736198448394496),+ ("this <time>until <time-of-day>", -4.330733340286331),+ ("Mondaythis <time>", -4.330733340286331)],+ n = 74}}), ("<ordinal> <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.890371757896165,@@ -817,6 +816,13 @@ koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707,@@ -902,18 +908,18 @@ n = 4}}), ("time-of-day (latent)", Classifier{okData =- ClassData{prior = -0.8690378470236094,+ ClassData{prior = -0.8903152454708944, unseen = -3.7376696182833684, likelihoods = HashMap.fromList [("integer (numeric)", -2.469261259037152e-2)], n = 39}, koData =- ClassData{prior = -0.5436154465889815, unseen = -4.04305126783455,+ ClassData{prior = -0.5285252008653917, unseen = -4.07753744390572, likelihoods = HashMap.fromList- [("integer (numeric)", -0.2876820724517809),- ("integer (0..19)", -1.3862943611198906)],- n = 54}}),+ [("integer (numeric)", -0.27625337662815824),+ ("integer (0..19)", -1.4213856809311607)],+ n = 56}}), ("year", Classifier{okData = ClassData{prior = -0.1431008436406733, unseen = -3.332204510175204,@@ -1085,11 +1091,11 @@ n = 5}}), ("hh:mm", Classifier{okData =- ClassData{prior = -1.8018505502678365e-2,- unseen = -4.04305126783455,- likelihoods = HashMap.fromList [("", 0.0)], n = 55},+ ClassData{prior = -1.7094433359300068e-2,+ unseen = -4.0943445622221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 58}, koData =- ClassData{prior = -4.02535169073515, unseen = -1.0986122886681098,+ ClassData{prior = -4.07753744390572, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("quarter after|past <integer> (hour-of-day)", Classifier{okData =
Duckling/Ranking/Classifiers/DE_XX.hs view
@@ -23,23 +23,23 @@ = HashMap.fromList [("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,+ ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList- [("<time-of-day> o'clock", -1.3862943611198906),- ("hh:mm", -1.3862943611198906), ("hour", -1.3862943611198906),- ("minute", -1.3862943611198906)],- n = 2},+ [("<time-of-day> o'clock", -1.6094379124341003),+ ("hh:mm", -1.2039728043259361), ("hour", -1.6094379124341003),+ ("minute", -1.2039728043259361)],+ n = 3}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.9179699933938751, unseen = -4.795790545596741,+ ClassData{prior = -0.9246589815446716, unseen = -4.795790545596741, likelihoods = HashMap.fromList [("", 0.0)], n = 119}, koData =- ClassData{prior = -0.5097076806646496, unseen = -5.198497031265826,- likelihoods = HashMap.fromList [("", 0.0)], n = 179}}),+ ClassData{prior = -0.5052854433903752, unseen = -5.209486152841421,+ likelihoods = HashMap.fromList [("", 0.0)], n = 181}}), ("exactly <time-of-day>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455,@@ -391,287 +391,286 @@ n = 1}}), ("intersect", Classifier{okData =- ClassData{prior = -0.26272534047791335,- unseen = -6.927557906278317,+ ClassData{prior = -0.2639842810219578, unseen = -6.92951677076365, likelihoods = HashMap.fromList- [("Samstag<time-of-day> o'clock", -6.23342985266278),- ("hourday", -4.9806668841674115),- ("<datetime> - <datetime> (interval)year", -4.9806668841674115),- ("dayhour", -2.5698682065331333),- ("daymonth", -3.1653769175291626),+ [("Samstag<time-of-day> o'clock", -6.23539063760472),+ ("hourday", -4.982627669109352),+ ("<datetime> - <datetime> (interval)year", -4.982627669109352),+ ("dayhour", -2.571828991475074),+ ("daymonth", -3.167337702471103), ("<day-of-month>(ordinal) <named-month> year<time-of-day> o'clock",- -6.23342985266278),- ("monthyear", -4.528681760424354),- ("yearhour", -6.23342985266278),- ("Juliintersect", -6.23342985266278),- ("intersect<time-of-day> o'clock", -4.093363689166509),- ("christmasyear", -6.23342985266278),- ("after lunchat <time-of-day>", -6.23342985266278),+ -6.23539063760472),+ ("monthyear", -4.5306425453662955),+ ("yearhour", -6.23539063760472),+ ("Juliintersect", -6.23539063760472),+ ("intersect<time-of-day> o'clock", -4.095324474108449),+ ("christmasyear", -6.23539063760472),+ ("after lunchat <time-of-day>", -6.23539063760472), ("absorption of , after named daymm/dd/yyyy",- -6.23342985266278),- ("intersectJuli", -5.540282672102834),- ("<day-of-month> (ordinal)Dienstag", -6.23342985266278),- ("intersect by 'of', 'from', 'syear", -5.827964744554615),- ("<time-of-day> am|pmintersect", -5.13481756399467),- ("<day-of-month> (ordinal)September", -5.827964744554615),- ("intersect<time> <part-of-day>", -4.153988310982943),- ("<time-of-day> o'clockafter lunch", -5.540282672102834),- ("<day-of-month> (ordinal)Mittwoch", -6.23342985266278),- ("Montagthis <cycle>", -6.23342985266278),+ -6.23539063760472),+ ("intersectJuli", -5.5422434570447745),+ ("<day-of-month> (ordinal)Dienstag", -6.23539063760472),+ ("intersect by 'of', 'from', 'syear", -5.829925529496556),+ ("<time-of-day> am|pmintersect", -5.136778348936611),+ ("<day-of-month> (ordinal)September", -5.829925529496556),+ ("intersect<time> <part-of-day>", -4.155949095924885),+ ("<time-of-day> o'clockafter lunch", -5.5422434570447745),+ ("<day-of-month> (ordinal)Mittwoch", -6.23539063760472),+ ("Montagthis <cycle>", -6.23539063760472), ("<time> <part-of-day><time-of-day> o'clock",- -6.23342985266278),- ("Oktoberyear", -5.13481756399467),- ("today<time-of-day> o'clock", -6.23342985266278),- ("<time-of-day> o'clockon <date>", -5.827964744554615),- ("<time-of-day> am|pmintersect by ','", -5.540282672102834),- ("intersect by ','year", -5.13481756399467),- ("on <date><time-of-day> o'clock", -6.23342985266278),- ("exactly <time-of-day>tomorrow", -5.827964744554615),- ("mm/dd<time-of-day> o'clock", -6.23342985266278),- ("monthhour", -5.827964744554615),+ -6.23539063760472),+ ("Oktoberyear", -5.136778348936611),+ ("today<time-of-day> o'clock", -6.23539063760472),+ ("<time-of-day> o'clockon <date>", -5.829925529496556),+ ("<time-of-day> am|pmintersect by ','", -5.5422434570447745),+ ("intersect by ','year", -5.136778348936611),+ ("on <date><time-of-day> o'clock", -6.23539063760472),+ ("exactly <time-of-day>tomorrow", -5.829925529496556),+ ("mm/dd<time-of-day> o'clock", -6.23539063760472),+ ("monthhour", -5.829925529496556), ("on <date>between <datetime> and <datetime> (interval)",- -6.23342985266278),- ("last <day-of-week> of <time>year", -6.23342985266278),- ("hourmonth", -5.827964744554615),- ("todayat <time-of-day>", -5.540282672102834),- ("mm/ddabout <time-of-day>", -5.827964744554615),+ -6.23539063760472),+ ("last <day-of-week> of <time>year", -6.23539063760472),+ ("hourmonth", -5.829925529496556),+ ("todayat <time-of-day>", -5.5422434570447745),+ ("mm/ddabout <time-of-day>", -5.829925529496556), ("Donnerstagfrom <datetime> - <datetime> (interval)",- -5.827964744554615),+ -5.829925529496556), ("on <date>between <time-of-day> and <time-of-day> (interval)",- -6.23342985266278),- ("on <date>at <time-of-day>", -5.827964744554615),- ("dayday", -3.055376022314834),- ("<time> <part-of-day>at <time-of-day>", -5.827964744554615),+ -6.23539063760472),+ ("on <date>at <time-of-day>", -5.829925529496556),+ ("dayday", -3.0573368072567746),+ ("<time> <part-of-day>at <time-of-day>", -5.829925529496556), ("<time-of-day> am|pmabsorption of , after named day",- -6.23342985266278),- ("about <time-of-day>on <date>", -6.23342985266278),+ -6.23539063760472),+ ("about <time-of-day>on <date>", -6.23539063760472), ("<hour-of-day> <integer> (as relative minutes)in|during the <part-of-day>",- -5.827964744554615),- ("<day-of-month> (ordinal)intersect", -5.13481756399467),- ("hourhour", -3.707701208354524),- ("hh:mmintersect by ','", -4.9806668841674115),+ -5.829925529496556),+ ("<day-of-month> (ordinal)intersect", -5.136778348936611),+ ("hourhour", -3.7096619932964647),+ ("hh:mmintersect by ','", -4.982627669109352), ("Donnerstagfrom <time-of-day> - <time-of-day> (interval)",- -5.540282672102834),- ("Dienstagthis <cycle>", -6.23342985266278),- ("<part-of-day> of <time>Februar", -5.827964744554615),- ("dayyear", -3.3156591205785),- ("Mittwochthis <cycle>", -6.23342985266278),+ -5.5422434570447745),+ ("Dienstagthis <cycle>", -6.23539063760472),+ ("<part-of-day> of <time>Februar", -5.829925529496556),+ ("dayyear", -3.317619905520441),+ ("Mittwochthis <cycle>", -6.23539063760472), ("<time-of-day> o'clockin|during the <part-of-day>",- -5.13481756399467),- ("tomorrow<time-of-day> o'clock", -6.23342985266278),- ("<time-of-day> o'clocktomorrow", -5.540282672102834),+ -5.136778348936611),+ ("tomorrow<time-of-day> o'clock", -6.23539063760472),+ ("<time-of-day> o'clocktomorrow", -5.5422434570447745), ("<day-of-month>(ordinal) <named-month>year",- -5.827964744554615),+ -5.829925529496556), ("half <integer> (german style hour-of-day)after lunch",- -6.23342985266278),+ -6.23539063760472), ("absorption of , after named day<day-of-month>(ordinal) <named-month>",- -4.9806668841674115),- ("hourminute", -5.540282672102834),- ("the <day-of-month> (ordinal)Juli", -6.23342985266278),+ -4.982627669109352),+ ("hourminute", -5.5422434570447745),+ ("the <day-of-month> (ordinal)Juli", -6.23539063760472), ("on <date><day-of-month>(ordinal) <named-month>",- -5.827964744554615),- ("minutemonth", -3.559281203236251),- ("minutehour", -3.9821380540562843),+ -5.829925529496556),+ ("minutemonth", -3.5612419881781916),+ ("minutehour", -3.984098838998225), ("at <time-of-day>in|during the <part-of-day>",- -5.3171391207886245),+ -5.319099905730565), ("absorption of , after named day<day-of-month>(ordinal) <named-month> year",- -5.827964744554615),+ -5.829925529496556), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -5.13481756399467),+ -5.136778348936611), ("<day-of-month>(ordinal) <named-month> year<time> <part-of-day>",- -6.23342985266278),+ -6.23539063760472), ("<hour-of-day> <integer> (as relative minutes)after lunch",- -6.23342985266278),- ("Donnerstag<time> timezone", -6.23342985266278),- ("Samstagat <time-of-day>", -5.827964744554615),- ("<time-of-day> am|pmSamstag", -6.23342985266278),+ -6.23539063760472),+ ("Donnerstag<time> timezone", -5.829925529496556),+ ("Samstagat <time-of-day>", -5.829925529496556),+ ("<time-of-day> am|pmSamstag", -6.23539063760472), ("intersect<day-of-month>(ordinal) <named-month>",- -4.847135491542889),- ("this <part-of-day><time-of-day> o'clock", -6.23342985266278),+ -4.84909627648483),+ ("this <part-of-day><time-of-day> o'clock", -6.23539063760472), ("<day-of-month>(ordinal) <named-month>intersect",- -6.23342985266278),- ("hh:mmintersect", -3.7910828172935753),- ("Donnerstaghh:mm", -6.23342985266278),- ("<day-of-month> (ordinal)Juli", -5.540282672102834),- ("intersect by ','intersect", -4.9806668841674115),- ("intersect by 'of', 'from', 'sJuli", -6.23342985266278),- ("<day-of-month> (ordinal)Oktober", -6.23342985266278),+ -6.23539063760472),+ ("hh:mmintersect", -3.793043602235516),+ ("Donnerstaghh:mm", -6.23539063760472),+ ("<day-of-month> (ordinal)Juli", -5.5422434570447745),+ ("intersect by ','intersect", -4.982627669109352),+ ("intersect by 'of', 'from', 'sJuli", -6.23539063760472),+ ("<day-of-month> (ordinal)Oktober", -6.23539063760472), ("half <integer> (german style hour-of-day)in|during the <part-of-day>",- -5.827964744554615),+ -5.829925529496556), ("from <datetime> - <datetime> (interval)year",- -5.540282672102834),- ("at <time-of-day>intersect", -4.441670383434724),+ -5.5422434570447745),+ ("at <time-of-day>intersect", -4.443631168376665), ("on <date>from <time-of-day> - <time-of-day> (interval)",- -5.827964744554615),+ -5.829925529496556), ("<time> <part-of-day>from <time-of-day> - <time-of-day> (interval)",- -6.23342985266278),+ -6.23539063760472), ("absorption of , after named day<day-of-month> (ordinal)",- -4.9806668841674115),+ -4.982627669109352), ("Donnerstagbetween <time-of-day> and <time-of-day> (interval)",- -6.23342985266278),- ("dayminute", -4.03620527532656),+ -6.23539063760472),+ ("dayminute", -3.984098838998225), ("on <date>from <datetime> - <datetime> (interval)",- -6.23342985266278),- ("Mittwochnext <cycle>", -6.23342985266278),+ -6.23539063760472),+ ("Mittwochnext <cycle>", -6.23539063760472), ("Donnerstagbetween <datetime> and <datetime> (interval)",- -6.23342985266278),+ -6.23539063760472), ("<time> <part-of-day>from <datetime> - <datetime> (interval)",- -6.23342985266278),- ("intersectyear", -4.441670383434724),- ("on <date>intersect", -5.827964744554615),- ("on <date><day-of-month> (ordinal)", -5.827964744554615),- ("intersectSeptember", -3.4925898287375787),- ("<ordinal> <cycle> of <time>year", -6.23342985266278),- ("minuteday", -2.2537481987608188),+ -6.23539063760472),+ ("intersectyear", -4.443631168376665),+ ("on <date>intersect", -5.829925529496556),+ ("on <date><day-of-month> (ordinal)", -5.829925529496556),+ ("intersectSeptember", -3.4945506136795195),+ ("<ordinal> <cycle> of <time>year", -6.23539063760472),+ ("minuteday", -2.2557089837027595), ("absorption of , after named dayintersect",- -3.835534579864409),- ("intersect by ','September", -4.729352455886505),- ("year<time-of-day> o'clock", -6.23342985266278),- ("Juliyear", -5.827964744554615),- ("at <time-of-day>intersect by ','", -5.540282672102834),- ("hh:mmabsorption of , after named day", -5.827964744554615),- ("intersect by ','<time> <part-of-day>", -5.3171391207886245),- ("hh:mmon <date>", -3.7910828172935753),+ -3.8374953648063497),+ ("intersect by ','September", -4.731313240828446),+ ("year<time-of-day> o'clock", -6.23539063760472),+ ("Juliyear", -5.829925529496556),+ ("at <time-of-day>intersect by ','", -5.5422434570447745),+ ("hh:mmabsorption of , after named day", -5.829925529496556),+ ("intersect by ','<time> <part-of-day>", -5.319099905730565),+ ("hh:mmon <date>", -3.793043602235516), ("at <time-of-day>absorption of , after named day",- -6.23342985266278),- ("until <time-of-day>after lunch", -6.23342985266278),- ("mm/ddyear", -5.827964744554615),- ("intersect by ','<time-of-day> o'clock", -5.3171391207886245),- ("intersect<day-of-month> (ordinal)", -4.847135491542889),- ("absorption of , after named daymm/dd", -6.23342985266278),- ("on <date>September", -5.3171391207886245),- ("Septemberyear", -5.827964744554615),+ -6.23539063760472),+ ("until <time-of-day>after lunch", -6.23539063760472),+ ("mm/ddyear", -5.829925529496556),+ ("intersect by ','<time-of-day> o'clock", -5.319099905730565),+ ("intersect<day-of-month> (ordinal)", -4.84909627648483),+ ("absorption of , after named daymm/dd", -6.23539063760472),+ ("on <date>September", -5.319099905730565),+ ("Septemberyear", -5.829925529496556), ("<day-of-month> (ordinal)intersect by 'of', 'from', 's",- -5.540282672102834),- ("at <time-of-day>on <date>", -4.361627675761188),- ("intersectintersect", -4.093363689166509),- ("<day-of-month> (ordinal)Februar", -5.13481756399467),- ("dayweek", -5.13481756399467),- ("intersect by ','Juli", -5.540282672102834),+ -5.5422434570447745),+ ("at <time-of-day>on <date>", -4.363588460703129),+ ("intersectintersect", -4.095324474108449),+ ("<day-of-month> (ordinal)Februar", -5.136778348936611),+ ("dayweek", -5.136778348936611),+ ("intersect by ','Juli", -5.5422434570447745), ("absorption of , after named daythe <day-of-month> (ordinal)",- -6.23342985266278),- ("weekyear", -5.827964744554615),- ("hh:mmin|during the <part-of-day>", -5.3171391207886245),- ("Marzyear", -6.23342985266278),- ("tomorrowat <time-of-day>", -5.827964744554615),+ -6.23539063760472),+ ("weekyear", -5.829925529496556),+ ("hh:mmin|during the <part-of-day>", -5.319099905730565),+ ("Marzyear", -6.23539063760472),+ ("tomorrowat <time-of-day>", -5.829925529496556), ("<hour-of-day> <integer> (as relative minutes)on <date>",- -6.23342985266278),+ -6.23539063760472), ("Donnerstag<time-of-day> - <time-of-day> (interval)",- -6.23342985266278),+ -6.23539063760472), ("Donnerstag<datetime> - <datetime> (interval)",- -6.23342985266278),- ("Sonntaglast <cycle>", -6.23342985266278),- ("at <time-of-day>tomorrow", -6.23342985266278),+ -6.23539063760472),+ ("Sonntaglast <cycle>", -6.23539063760472),+ ("at <time-of-day>tomorrow", -6.23539063760472), ("about <time-of-day>in|during the <part-of-day>",- -5.827964744554615),+ -5.829925529496556), ("half <integer> (german style hour-of-day)on <date>",- -6.23342985266278),- ("this <part-of-day>at <time-of-day>", -5.827964744554615),- ("<datetime> - <datetime> (interval)Juli", -5.827964744554615),+ -6.23539063760472),+ ("this <part-of-day>at <time-of-day>", -5.829925529496556),+ ("<datetime> - <datetime> (interval)Juli", -5.829925529496556), ("after lunch<hour-of-day> <integer> (as relative minutes)",- -5.827964744554615),- ("<day-of-month> (ordinal)Marz", -6.23342985266278),- ("last <cycle> of <time>year", -5.827964744554615),+ -5.829925529496556),+ ("<day-of-month> (ordinal)Marz", -6.23539063760472),+ ("last <cycle> of <time>year", -5.829925529496556), ("<named-month> <day-of-month> (non ordinal)year",- -6.23342985266278),+ -6.23539063760472), ("<day-of-month> (non ordinal) <named-month>year",- -6.23342985266278)],- n = 426},+ -6.23539063760472)],+ n = 427}, koData =- ClassData{prior = -1.4651344228276666, unseen = -6.049733455231958,+ ClassData{prior = -1.4609558898889103, unseen = -6.05443934626937, likelihoods = HashMap.fromList [("Juli<day-of-month> (non ordinal) <named-month>",- -5.354224998486333),+ -5.358941988364472), ("absorption of , after named daythe <day-of-month> (non ordinal)",- -5.354224998486333),- ("<datetime> - <datetime> (interval)year", -5.354224998486333),- ("dayhour", -4.661077817926388),+ -5.358941988364472),+ ("<datetime> - <datetime> (interval)year", -5.358941988364472),+ ("dayhour", -4.665794807804526), ("<named-month> <day-of-month> (non ordinal)Juli",- -5.354224998486333),- ("daymonth", -3.4824228215847413),- ("monthday", -4.948759890378168),- ("monthyear", -5.354224998486333),- ("yearhour", -5.354224998486333),- ("after lunchat <time-of-day>", -4.948759890378168),- ("mm/dduntil <time-of-day>", -4.948759890378168),- ("until <time-of-day>year", -4.948759890378168),- ("<day-of-month> (ordinal)Dienstag", -4.948759890378168),- ("absorption of , after named dayFebruar", -4.255612709818223),- ("on <date>Februar", -5.354224998486333),- ("intersect by 'of', 'from', 'syear", -4.661077817926388),- ("<time-of-day> am|pmintersect", -3.6494769062479073),- ("intersect<time> <part-of-day>", -5.354224998486333),- ("<time-of-day> o'clockafter lunch", -5.354224998486333),- ("<day-of-month> (ordinal)Mittwoch", -5.354224998486333),- ("after lunch<time-of-day> o'clock", -5.354224998486333),- ("absorption of , after named dayhh:mm", -5.354224998486333),- ("<time-of-day> am|pmintersect by ','", -4.101462029990965),+ -5.358941988364472),+ ("daymonth", -3.48713981146288),+ ("monthday", -4.953476880256307),+ ("monthyear", -5.358941988364472),+ ("yearhour", -5.358941988364472),+ ("after lunchat <time-of-day>", -4.953476880256307),+ ("mm/dduntil <time-of-day>", -4.953476880256307),+ ("until <time-of-day>year", -4.953476880256307),+ ("<day-of-month> (ordinal)Dienstag", -4.953476880256307),+ ("absorption of , after named dayFebruar", -4.260329699696362),+ ("on <date>Februar", -5.358941988364472),+ ("intersect by 'of', 'from', 'syear", -4.665794807804526),+ ("<time-of-day> am|pmintersect", -3.654193896126046),+ ("intersect<time> <part-of-day>", -5.358941988364472),+ ("<time-of-day> o'clockafter lunch", -5.358941988364472),+ ("<day-of-month> (ordinal)Mittwoch", -5.358941988364472),+ ("after lunch<time-of-day> o'clock", -5.358941988364472),+ ("absorption of , after named dayhh:mm", -5.358941988364472),+ ("<time-of-day> am|pmintersect by ','", -4.106179019869104), ("<time-of-day> o'clock<time> <part-of-day>",- -4.437934266612178),- ("<time-of-day> am|pmFreitag", -4.948759890378168),- ("mm/ddhh:mm", -4.437934266612178),- ("monthhour", -5.354224998486333),+ -4.442651256490317),+ ("<time-of-day> am|pmFreitag", -4.953476880256307),+ ("mm/ddhh:mm", -4.442651256490317),+ ("monthhour", -5.358941988364472), ("on <date>between <datetime> and <datetime> (interval)",- -5.354224998486333),- ("todayat <time-of-day>", -5.354224998486333),+ -5.358941988364472),+ ("todayat <time-of-day>", -5.358941988364472), ("Donnerstagfrom <datetime> - <datetime> (interval)",- -4.948759890378168),+ -4.953476880256307), ("on <date>between <time-of-day> and <time-of-day> (interval)",- -5.354224998486333),- ("dayday", -3.9679306373664422),+ -5.358941988364472),+ ("dayday", -3.972647627244581), ("<time-of-day> am|pmabsorption of , after named day",- -4.948759890378168),- ("hourhour", -3.8501476017100584),+ -4.953476880256307),+ ("hourhour", -3.8548645915881976), ("Donnerstagfrom <time-of-day> - <time-of-day> (interval)",- -4.661077817926388),- ("Donnerstagafter <time-of-day>", -5.354224998486333),- ("dayyear", -3.274783456806497),- ("minutemonth", -3.4824228215847413),- ("Aprilyear", -5.354224998486333),- ("Dienstagafter <time-of-day>", -5.354224998486333),+ -4.665794807804526),+ ("Donnerstagafter <time-of-day>", -5.358941988364472),+ ("dayyear", -3.2795004466846356),+ ("minutemonth", -3.48713981146288),+ ("Aprilyear", -5.358941988364472),+ ("Dienstagafter <time-of-day>", -5.358941988364472), ("intersect<day-of-month>(ordinal) <named-month>",- -4.661077817926388),- ("Donnerstaghh:mm", -5.354224998486333),- ("<day-of-month> (ordinal)Juli", -4.948759890378168),- ("<day-of-month> (ordinal)hh:mm", -4.437934266612178),+ -4.665794807804526),+ ("Donnerstaghh:mm", -4.953476880256307),+ ("<day-of-month> (ordinal)Juli", -4.953476880256307),+ ("<day-of-month> (ordinal)hh:mm", -4.442651256490317), ("<named-month> <day-of-month> (non ordinal)August",- -5.354224998486333),+ -5.358941988364472), ("August<day-of-month> (non ordinal) <named-month>",- -5.354224998486333),- ("at <time-of-day>intersect", -4.255612709818223),+ -5.358941988364472),+ ("at <time-of-day>intersect", -4.260329699696362), ("on <date>from <time-of-day> - <time-of-day> (interval)",- -4.948759890378168),+ -4.953476880256307), ("Donnerstagbetween <time-of-day> and <time-of-day> (interval)",- -5.354224998486333),- ("dayminute", -2.715167668871074),+ -5.358941988364472),+ ("dayminute", -2.6847933389379426), ("on <date>from <datetime> - <datetime> (interval)",- -5.354224998486333),+ -5.358941988364472), ("Donnerstagbetween <datetime> and <datetime> (interval)",- -5.354224998486333),- ("until <time-of-day>Juli", -5.354224998486333),- ("intersectSeptember", -3.744787086052232),- ("minuteday", -2.3584927249323417),- ("intersect by ','September", -4.661077817926388),- ("at <time-of-day>intersect by ','", -4.661077817926388),- ("at <time-of-day>Freitag", -5.354224998486333),+ -5.358941988364472),+ ("until <time-of-day>Juli", -5.358941988364472),+ ("intersectSeptember", -3.7495040759303713),+ ("minuteday", -2.3632097148104805),+ ("intersect by ','September", -4.665794807804526),+ ("at <time-of-day>intersect by ','", -4.665794807804526),+ ("at <time-of-day>Freitag", -5.358941988364472), ("at <time-of-day>absorption of , after named day",- -5.354224998486333),- ("year<time> <part-of-day>", -5.354224998486333),- ("mm/ddyear", -3.8501476017100584),- ("intersect<day-of-month> (ordinal)", -4.661077817926388),+ -5.358941988364472),+ ("year<time> <part-of-day>", -5.358941988364472),+ ("mm/ddyear", -3.8548645915881976),+ ("intersect<day-of-month> (ordinal)", -4.665794807804526), ("<day-of-month> (ordinal)intersect by 'of', 'from', 's",- -4.948759890378168),- ("intersectintersect", -4.661077817926388),- ("Donnerstag<part-of-day> of <time>", -5.354224998486333),- ("<day-of-month> (ordinal)April", -5.354224998486333),+ -4.953476880256307),+ ("intersectintersect", -4.665794807804526),+ ("Donnerstag<part-of-day> of <time>", -5.358941988364472),+ ("<day-of-month> (ordinal)April", -5.358941988364472), ("Donnerstag<time-of-day> - <time-of-day> (interval)",- -5.354224998486333),- ("after <time-of-day>year", -5.354224998486333),- ("on <date>after <time-of-day>", -5.354224998486333),- ("tomorrownoon", -5.354224998486333)],- n = 128}}),+ -5.358941988364472),+ ("after <time-of-day>year", -5.358941988364472),+ ("on <date>after <time-of-day>", -5.358941988364472),+ ("tomorrownoon", -5.358941988364472)],+ n = 129}}), ("<ordinal> <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004,@@ -1115,7 +1114,7 @@ n = 2}}), ("time-of-day (latent)", Classifier{okData =- ClassData{prior = -0.5455111817538806,+ ClassData{prior = -0.39890770756200533, unseen = -3.9889840465642745, likelihoods = HashMap.fromList@@ -1123,12 +1122,12 @@ ("integer (0..19)", -2.3608540011180215)], n = 51}, koData =- ClassData{prior = -0.866418901833982, unseen = -3.6888794541139363,+ ClassData{prior = -1.1118575154181303, unseen = -3.332204510175204, likelihoods = HashMap.fromList- [("integer (numeric)", -0.262364264467491),- ("integer (0..19)", -1.466337068793427)],- n = 37}}),+ [("integer (numeric)", -0.11778303565638351),+ ("integer (0..19)", -2.1972245773362196)],+ n = 25}}), ("year", Classifier{okData = ClassData{prior = -8.338160893905101e-2,@@ -1306,11 +1305,11 @@ likelihoods = HashMap.fromList [], n = 0}}), ("hh:mm", Classifier{okData =- ClassData{prior = -0.6190392084062235,- unseen = -3.6109179126442243,- likelihoods = HashMap.fromList [("", 0.0)], n = 35},+ ClassData{prior = -0.6061358035703156,+ unseen = -3.6375861597263857,+ likelihoods = HashMap.fromList [("", 0.0)], n = 36}, koData =- ClassData{prior = -0.7731898882334817,+ ClassData{prior = -0.7884573603642702, unseen = -3.4657359027997265, likelihoods = HashMap.fromList [("", 0.0)], n = 30}}), ("quarter after|past <integer> (hour-of-day)",@@ -1467,8 +1466,8 @@ n = 12}}), ("Donnerstag", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,- likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -1488,21 +1487,15 @@ likelihoods = HashMap.fromList [], n = 0}}), ("last <time>", Classifier{okData =- ClassData{prior = -1.9459101490553135,- unseen = -2.3025850929940455,+ ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList- [("Sonntag", -1.5040773967762742), ("day", -1.0986122886681098),- ("Dienstag", -1.5040773967762742)],+ [("Sonntag", -1.252762968495368), ("day", -0.8472978603872037),+ ("Dienstag", -1.252762968495368)], n = 2}, koData =- ClassData{prior = -0.15415067982725836,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.8023464725249373),- ("hour", -0.8023464725249373)],- n = 12}}),+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}), ("EOM|End of month", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,
+ Duckling/Ranking/Classifiers/EL_XX.hs view
@@ -0,0 +1,2632 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++-----------------------------------------------------------------+-- Auto-generated by regenClassifiers+--+-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING+-- @generated+-----------------------------------------------------------------+{-# LANGUAGE OverloadedStrings #-}+module Duckling.Ranking.Classifiers.EL_XX (classifiers) where+import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import Duckling.Ranking.Types++classifiers :: Classifiers+classifiers+ = HashMap.fromList+ [("midnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <cycle> <time>'s'",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5553480614894135,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.128465251817791),+ ("week (grain)intersect by 'of', 'from', 's",+ -2.833213344056216),+ ("day (grain)intersect", -2.4277482359480516),+ ("weekmonth", -2.1400661634962708),+ ("day (grain)intersect by 'of', 'from', 's",+ -2.4277482359480516),+ ("week (grain)intersect", -2.833213344056216),+ ("day (grain)absorption of article before time",+ -1.580450375560848),+ ("week (grain)September", -2.833213344056216)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> timezone",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.8971199848858813),+ ("absorption of article before time", -1.8971199848858813),+ ("<time-of-day> am|pm", -2.3025850929940455),+ ("hh:mm", -1.8971199848858813), ("hour", -1.2039728043259361),+ ("minute", -1.8971199848858813)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (1st..12th, 20th, 30th..90th)",+ Classifier{okData =+ ClassData{prior = -0.9480394301887354,+ unseen = -3.4965075614664802,+ likelihoods = HashMap.fromList [("", 0.0)], n = 31},+ koData =+ ClassData{prior = -0.4902063365632549,+ unseen = -3.9318256327243257,+ likelihoods = HashMap.fromList [("", 0.0)], n = 49}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.6150455928747536, unseen = -5.272999558563747,+ likelihoods = HashMap.fromList [("", 0.0)], n = 193},+ koData =+ ClassData{prior = -0.7778693539554407, unseen = -5.111987788356543,+ likelihoods = HashMap.fromList [("", 0.0)], n = 164}}),+ ("<integer> and a half <grain>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("integer (numeric)hour (grain)", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = -2.1972245773362196,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("day", -1.252762968495368),+ ("<integer> <unit-of-duration>", -1.252762968495368)],+ n = 1},+ koData =+ ClassData{prior = -0.11778303565638351,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("day", -2.3513752571634776), ("year", -2.3513752571634776),+ ("<integer> <unit-of-duration>", -1.0986122886681098),+ ("quarter of an hour", -1.9459101490553135),+ ("minute", -1.0986122886681098)],+ n = 8}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("thursday",+ Classifier{okData =+ ClassData{prior = -0.12783337150988489,+ unseen = -3.1780538303479458,+ likelihoods = HashMap.fromList [("", 0.0)], n = 22},+ koData =+ ClassData{prior = -2.120263536200091, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("few",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fall",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month> <day-of-month> (ordinal or number)",+ Classifier{okData =+ ClassData{prior = -1.6094379124341003,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("month", -1.252762968495368),+ ("Julyinteger (numeric)", -1.252762968495368)],+ n = 1},+ koData =+ ClassData{prior = -0.2231435513142097, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("absorption of article before timeinteger (numeric)",+ -1.8718021769015913),+ ("Augustinteger (numeric)", -1.8718021769015913),+ ("Aprilinteger (numeric)", -1.8718021769015913),+ ("month", -0.9555114450274363),+ ("Julyinteger (numeric)", -1.8718021769015913)],+ n = 4}}),+ ("<time-of-day> approximately",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.252762968495368),+ ("<time-of-day> am|pm", -1.252762968495368),+ ("hour", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -0.24214005200486485,+ unseen = -5.147494476813453,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)absorption of article before time",+ -2.8390784635086144),+ ("ordinals (1st..12th, 20th, 30th..90th)absorption of article before time",+ -4.04305126783455),+ ("ordinal (digits)October", -4.04305126783455),+ ("integer (numeric)September", -2.9444389791664407),+ ("ordinals (1st..12th, 20th, 30th..90th)September",+ -3.5322256440685593),+ ("integer (numeric)December", -4.448516375942715),+ ("ordinals (1st..12th, 20th, 30th..90th)May",+ -4.448516375942715),+ ("number (0..19, 20, 30..90)April", -4.448516375942715),+ ("ordinal (digits)August", -4.448516375942715),+ ("number (0..19, 20, 30..90)March", -4.448516375942715),+ ("ordinal (digits)February", -3.5322256440685593),+ ("integer (numeric)April", -3.5322256440685593),+ ("ordinals (1st..12th, 20th, 30th..90th)April",+ -3.7553691953827695),+ ("integer (numeric)August", -3.7553691953827695),+ ("integer (numeric)February", -2.743768283704289),+ ("ordinals (1st..12th, 20th, 30th..90th)February",+ -4.448516375942715),+ ("month", -0.8375984632984902),+ ("ordinal (digits)March", -4.04305126783455),+ ("ordinals (1st..12th, 20th, 30th..90th)October",+ -3.5322256440685593),+ ("ordinals (1st..12th, 20th, 30th..90th)January",+ -4.448516375942715),+ ("integer (numeric)July", -3.5322256440685593),+ ("integer (numeric)March", -4.04305126783455),+ ("ordinals (1st..12th, 20th, 30th..90th)March",+ -3.349904087274605)],+ n = 73},+ koData =+ ClassData{prior = -1.536867219599265, unseen = -4.189654742026425,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)absorption of article before time",+ -2.382627800667582),+ ("ordinals (1st..12th, 20th, 30th..90th)absorption of article before time",+ -2.5649493574615367),+ ("ordinal (digits)October", -3.481240089335692),+ ("ordinal (digits)July", -3.481240089335692),+ ("integer (numeric)September", -3.0757749812275272),+ ("ordinal (digits)August", -3.0757749812275272),+ ("ordinal (digits)April", -3.481240089335692),+ ("month", -1.129864832172214),+ ("integer (numeric)July", -2.5649493574615367)],+ n = 20}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -9.038406146826906e-2,+ unseen = -5.231108616854587,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.134704220354885),+ ("time-of-day (latent)absorption of article before time",+ -3.4339872044851463),+ ("<time-of-day> o'clockabsorption of article before time",+ -4.532599493153256),+ ("mondayearly morning", -4.532599493153256),+ ("tomorrowafternoon", -4.532599493153256),+ ("absorption of article before timeabsorption of article before time",+ -3.6163087612791007),+ ("yesterdayabsorption of article before time",+ -4.532599493153256),+ ("hourhour", -1.44155703979494),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -4.532599493153256),+ ("todayin|during the <part-of-day>", -4.532599493153256),+ ("until <time-of-day>morning", -4.532599493153256),+ ("minutehour", -2.8278514009148306),+ ("tonightin|during the <part-of-day>", -4.532599493153256),+ ("at <time-of-day>in|during the <part-of-day>",+ -3.6163087612791007),+ ("intersectafternoon", -4.127134385045092),+ ("tomorrowevening", -4.532599493153256),+ ("absorption of article before timein|during the <part-of-day>",+ -3.6163087612791007),+ ("time-of-day (latent)morning", -4.532599493153256),+ ("yesterdayin|during the <part-of-day>", -4.532599493153256),+ ("intersectin|during the <part-of-day>", -3.2798365246578878),+ ("tonightabsorption of article before time",+ -4.532599493153256),+ ("todayabsorption of article before time", -4.532599493153256),+ ("at <time-of-day>absorption of article before time",+ -3.6163087612791007),+ ("hh:mmabsorption of article before time", -3.8394523125933104),+ ("intersectabsorption of article before time",+ -3.2798365246578878),+ ("tomorrowin|during the <part-of-day>", -3.4339872044851463),+ ("hh:mmin|during the <part-of-day>", -3.8394523125933104),+ ("time-of-day (latent)in|during the <part-of-day>",+ -3.4339872044851463),+ ("mondaymorning", -4.127134385045092),+ ("absorption of article before timemorning",+ -4.532599493153256),+ ("todaymorning", -4.532599493153256),+ ("<day-of-month> (ordinal or number) <named-month>morning",+ -4.532599493153256),+ ("tomorrowabsorption of article before time",+ -3.4339872044851463)],+ n = 74},+ koData =+ ClassData{prior = -2.4485390056171257, unseen = -3.970291913552122,+ likelihoods =+ HashMap.fromList+ [("yearhour", -2.8526314299133175),+ ("time-of-day (latent)absorption of article before time",+ -2.8526314299133175),+ ("monthhour", -3.258096538021482),+ ("year (latent)absorption of article before time",+ -3.258096538021482),+ ("hourhour", -2.341805806147327),+ ("year (latent)in|during the <part-of-day>",+ -3.258096538021482),+ ("Februarymorning", -3.258096538021482),+ ("time-of-day (latent)in|during the <part-of-day>",+ -2.8526314299133175)],+ n = 7}}),+ ("dd/mm",+ Classifier{okData =+ ClassData{prior = -3.1354942159291497,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -4.445176257083381e-2,+ unseen = -3.1780538303479458,+ likelihoods = HashMap.fromList [("", 0.0)], n = 22}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -9.716374845364774e-2,+ unseen = -4.663439094112067,+ likelihoods =+ HashMap.fromList+ [("half after|past <integer> (hour-of-day)", -3.960813169597578),+ ("<time-of-day> am|pm (verbose)", -3.5553480614894135),+ ("time-of-day (latent)", -1.3581234841531944),+ ("<time-of-day> am|pm", -1.8207470061013074),+ ("hh:mm", -3.044522437723423), ("hour", -0.916290731874155),+ ("minute", -2.456735772821304)],+ n = 49},+ koData =+ ClassData{prior = -2.379546134130174, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.041453874828161),+ ("hour", -1.041453874828161)],+ n = 5}}),+ ("December",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("wednesday", -2.772588722239781),+ ("saturday", -2.772588722239781),+ ("absorption of article before time", -2.367123614131617),+ ("monday", -2.367123614131617), ("friday", -2.0794415416798357),+ ("day", -0.9007865453381898), ("sunday", -2.772588722239781),+ ("tuesday", -2.367123614131617)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("revolution day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.791759469228055),+ ("hh:mmhh:mm", -1.791759469228055),+ ("hourminute", -1.791759469228055),+ ("time-of-day (latent)hh:mm", -1.791759469228055)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.791759469228055),+ ("time-of-day (latent)time-of-day (latent)",+ -1.791759469228055),+ ("hourhour", -1.791759469228055),+ ("minutehour", -1.791759469228055)],+ n = 2}}),+ ("between <datetime> and <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -0.6931471805599453),+ ("hh:mmhh:mm", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.295836866004329,+ likelihoods = HashMap.fromList [("", 0.0)], n = 25},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> more <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)minute (grain)", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number (0..19, 20, 30..90)",+ Classifier{okData =+ ClassData{prior = -0.11441035117774422,+ unseen = -3.5553480614894135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 33},+ koData =+ ClassData{prior = -2.2246235515243336, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("hh(:mm) - <time-of-day> am|pm (verbose)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("January",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("November",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -0.5260930958967791, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -0.8938178760220964,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),+ ("in <duration> from <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("secondsecond", -1.5040773967762742),+ ("daysecond", -1.0986122886681098),+ ("<integer> <unit-of-duration>now", -0.8109302162163288)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)quarter (grain)",+ -1.0986122886681098),+ ("ordinal (digits)quarter (grain)", -1.5040773967762742),+ ("quarter", -0.8109302162163288)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.8109302162163288),+ ("quarter", -0.8109302162163288)],+ n = 3}}),+ ("saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Last year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("May",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.42294807088851183,+ unseen = -6.862757913051402,+ likelihoods =+ HashMap.fromList+ [("tuesdaySeptember", -5.25227342804663),+ ("Father's Dayabsorption of article before time",+ -6.168564159920785),+ ("last <cycle> <time>'s'absorption of article before time",+ -5.47541697936084),+ ("hourday", -4.296761983019193),+ ("dayhour", -2.3619016701504654),+ ("daymonth", -3.8171889027573074),+ ("monthyear", -3.7706688871224143),+ ("<time-of-day> am|pmabsorption of article before time",+ -4.028497996424514),+ ("tuesdaythis <cycle>", -6.168564159920785),+ ("last <day-of-week> of <time>absorption of article before time",+ -6.168564159920785),+ ("wednesdayintersect", -5.069951871252675),+ ("absorption of article before timeabsorption of , after named day",+ -6.168564159920785),+ ("houryear", -6.168564159920785),+ ("absorption of article before timeat <time-of-day>",+ -5.47541697936084),+ ("absorption of article before time<day-of-month> (ordinal or number) <named-month>",+ -5.25227342804663),+ ("absorption of article before time<time> <part-of-day>",+ -5.47541697936084),+ ("Octoberabsorption of article before time", -5.47541697936084),+ ("intersect<day-of-month> (ordinal or number) <named-month>",+ -4.296761983019193),+ ("intersect by 'of', 'from', 'syear", -6.168564159920785),+ ("<time-of-day> am|pmintersect", -4.664486763144511),+ ("intersectat <time-of-day>", -5.76309905181262),+ ("thursday<day-of-month> ( ordinal) <named-month> year",+ -6.168564159920785),+ ("saturday<time-of-day> am|pm", -5.76309905181262),+ ("saturdayat <time-of-day>", -5.76309905181262),+ ("after tomorrowat <time-of-day>", -6.168564159920785),+ ("intersect<time-of-day> am|pm", -6.168564159920785),+ ("<part-of-day> of <time>February", -6.168564159920785),+ ("absorption of article before timeOctober", -5.76309905181262),+ ("<time-of-day> o'clockabsorption of article before time",+ -6.168564159920785),+ ("after tomorrow<time-of-day> am|pm", -5.76309905181262),+ ("wednesdayabsorption of article before time",+ -4.664486763144511),+ ("Marchabsorption of article before time", -6.168564159920785),+ ("wednesdayat <time-of-day>", -5.76309905181262),+ ("intersect by ','<time-of-day> am|pm", -5.25227342804663),+ ("thursdayhh(:mm) - <time-of-day> am|pm", -6.168564159920785),+ ("<time-of-day> am|pmintersect by ','", -5.25227342804663),+ ("absorption of article before timeLast year",+ -5.76309905181262),+ ("absorption of article before timeintersect",+ -5.25227342804663),+ ("wednesday<time> <part-of-day>", -5.25227342804663),+ ("hourmonth", -6.168564159920785),+ ("todayat <time-of-day>", -6.168564159920785),+ ("absorption of article before timeabsorption of article before time",+ -3.5658744744764013),+ ("thursday<time> timezone", -4.915801191425417),+ ("yesterdayabsorption of article before time",+ -6.168564159920785),+ ("dayday", -3.6036148024592483),+ ("<time> <part-of-day>at <time-of-day>", -5.76309905181262),+ ("tonightat <time-of-day>", -5.76309905181262),+ ("<time-of-day> am|pmabsorption of , after named day",+ -5.25227342804663),+ ("today<time-of-day> am|pm", -5.76309905181262),+ ("at <time-of-day><time> <part-of-day>", -5.47541697936084),+ ("absorption of , after named day<day-of-month> (ordinal or number) <named-month>",+ -4.2226540108654715),+ ("hourhour", -2.854378155248259),+ ("<time-of-day> - <time-of-day> (interval)absorption of article before time",+ -6.168564159920785),+ ("halloween dayabsorption of article before time",+ -6.168564159920785),+ ("<datetime> - <datetime> (interval)absorption of article before time",+ -5.76309905181262),+ ("dayyear", -2.949688335052584),+ ("thursday<day-of-month> (ordinal or number) <named-month>",+ -6.168564159920785),+ ("last weekend of <named-month>year", -6.168564159920785),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -6.168564159920785),+ ("thursdaybetween <time-of-day> and <time-of-day> (interval)",+ -6.168564159920785),+ ("tuesdayabsorption of article before time",+ -4.664486763144511),+ ("thursdaybetween <datetime> and <datetime> (interval)",+ -6.168564159920785),+ ("wednesday<time-of-day> am|pm (verbose)", -5.76309905181262),+ ("before yesterday<time-of-day> am|pm", -5.76309905181262),+ ("wednesdaythis <cycle>", -6.168564159920785),+ ("todayin|during the <part-of-day>", -6.168564159920785),+ ("<time-of-day> am|pmtomorrow", -5.25227342804663),+ ("thursdayhh:mm", -6.168564159920785),+ ("minutehour", -4.46381606768236),+ ("before yesterdayat <time-of-day>", -5.76309905181262),+ ("tonightin|during the <part-of-day>", -6.168564159920785),+ ("at <time-of-day>in|during the <part-of-day>",+ -5.25227342804663),+ ("thursdayintersect", -6.168564159920785),+ ("thursdayfrom <datetime> - <datetime> (interval)",+ -5.25227342804663),+ ("Aprilyear", -5.76309905181262),+ ("absorption of article before timetomorrow",+ -5.47541697936084),+ ("absorption of article before timehh(:mm) - <time-of-day> am|pm",+ -6.168564159920785),+ ("absorption of article before timein|during the <part-of-day>",+ -5.25227342804663),+ ("yesterdayin|during the <part-of-day>", -6.168564159920785),+ ("before yesterdayabsorption of article before time",+ -5.76309905181262),+ ("this <day-of-week>hh(:mm) - <time-of-day> am|pm",+ -6.168564159920785),+ ("tuesday<time> <part-of-day>", -5.25227342804663),+ ("absorption of article before timeFebruary",+ -5.76309905181262),+ ("weekmonth", -5.25227342804663),+ ("tuesdayat <time-of-day>", -5.76309905181262),+ ("mondaythis <cycle>", -6.168564159920785),+ ("tomorrowintersect", -5.25227342804663),+ ("intersectin|during the <part-of-day>", -4.915801191425417),+ ("<time> <part-of-day>absorption of article before time",+ -5.76309905181262),+ ("the <cycle> of <time>October", -5.76309905181262),+ ("revolution dayabsorption of article before time",+ -5.76309905181262),+ ("thursday<datetime> - <datetime> (interval)",+ -6.168564159920785),+ ("Septemberabsorption of article before time",+ -6.168564159920785),+ ("absorption of article before time<time-of-day> am|pm",+ -5.76309905181262),+ ("tonightabsorption of article before time", -5.47541697936084),+ ("todayabsorption of article before time", -5.76309905181262),+ ("at <time-of-day>absorption of article before time",+ -4.664486763144511),+ ("thursday<time-of-day> - <time-of-day> (interval)",+ -6.168564159920785),+ ("absorption of article before timeyear", -6.168564159920785),+ ("tuesday<time-of-day> am|pm (verbose)", -5.76309905181262),+ ("revolution dayLast year", -5.76309905181262),+ ("at <time-of-day>intersect", -5.25227342804663),+ ("<time-of-day> - <time-of-day> (interval)tomorrow",+ -6.168564159920785),+ ("absorption of article before timeintersect by ','",+ -6.168564159920785),+ ("dayminute", -3.9172723613142897),+ ("intersectyear", -5.069951871252675),+ ("hh:mmabsorption of article before time", -5.47541697936084),+ ("<datetime> - <datetime> (interval)tomorrow",+ -6.168564159920785),+ ("minuteday", -2.687324070585093),+ ("absorption of , after named dayintersect",+ -6.168564159920785),+ ("the <cycle> of <time>absorption of article before time",+ -6.168564159920785),+ ("<ordinal> <cycle> of <time>absorption of article before time",+ -6.168564159920785),+ ("at <time-of-day>intersect by ','", -6.168564159920785),+ ("Octoberyear", -4.915801191425417),+ ("absorption of , after named dayintersect by ','",+ -5.76309905181262),+ ("this <cycle>hh(:mm) - <time-of-day> am|pm",+ -6.168564159920785),+ ("intersectabsorption of article before time",+ -4.5591262474866845),+ ("after tomorrowabsorption of article before time",+ -6.168564159920785),+ ("saturdayabsorption of article before time",+ -5.76309905181262),+ ("tuesdaythe <day-of-month> (non ordinal)", -6.168564159920785),+ ("at <time-of-day>absorption of , after named day",+ -6.168564159920785),+ ("tomorrowin|during the <part-of-day>", -5.069951871252675),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -3.9172723613142897),+ ("year<time-of-day> am|pm", -6.168564159920785),+ ("Septemberyear", -5.25227342804663),+ ("christmasabsorption of article before time",+ -6.168564159920785),+ ("dayweek", -5.069951871252675),+ ("weekyear", -5.25227342804663),+ ("hh:mmin|during the <part-of-day>", -5.47541697936084),+ ("the <day-of-month> (non ordinal)absorption of article before time",+ -5.76309905181262),+ ("tomorrowat <time-of-day>", -6.168564159920785),+ ("tuesdayintersect", -4.5591262474866845),+ ("tomorrowbetween <time-of-day> and <time-of-day> (interval)",+ -6.168564159920785),+ ("at <time-of-day>tomorrow", -5.47541697936084),+ ("tomorrow<time-of-day> am|pm", -5.76309905181262),+ ("last <cycle> of <time>absorption of article before time",+ -5.76309905181262),+ ("in|during the <part-of-day>at <time-of-day>",+ -6.168564159920785),+ ("in|during the <part-of-day>absorption of article before time",+ -6.168564159920785),+ ("intersectFebruary", -6.168564159920785),+ ("<datetime> - <datetime> (interval)July", -6.168564159920785),+ ("tomorrowabsorption of article before time",+ -4.915801191425417),+ ("yearminute", -6.168564159920785),+ ("Mother's Dayabsorption of article before time",+ -6.168564159920785)],+ n = 378},+ koData =+ ClassData{prior = -1.0645374417836073, unseen = -6.393590753950631,+ likelihoods =+ HashMap.fromList+ [("hourday", -5.293304824724492),+ ("thursdayabsorption of article before time",+ -5.293304824724492),+ ("dayhour", -3.6193283911528207),+ ("daymonth", -2.520716102484711),+ ("hourquarter", -5.698769932832657),+ ("monthday", -5.293304824724492),+ ("absorption of article before timedd/mm", -5.698769932832657),+ ("monthyear", -3.3473946756691793),+ ("absorption of article before timeDecember",+ -5.698769932832657),+ ("tuesdayFebruary", -5.698769932832657),+ ("wednesdayintersect", -5.698769932832657),+ ("intersecthh:mm", -5.698769932832657),+ ("hh:mmuntil <time>", -5.0056227522727115),+ ("houryear", -5.293304824724492),+ ("absorption of article before time<day-of-month> (ordinal or number) <named-month>",+ -5.698769932832657),+ ("intersect by 'of', 'from', 'syear", -4.782479200958502),+ ("absorption of article before timeJuly", -5.293304824724492),+ ("thursdayafter <time-of-day>", -4.600157644164547),+ ("Marchyear", -4.194692536056383),+ ("after tomorrowat <time-of-day>", -5.698769932832657),+ ("absorption of article before timeOctober",+ -5.293304824724492),+ ("<time-of-day> am|pmuntil <time>", -5.293304824724492),+ ("wednesdayabsorption of article before time",+ -5.293304824724492),+ ("<named-month> <day-of-month> (ordinal or number)July",+ -5.698769932832657),+ ("intersect by ','<time-of-day> am|pm", -5.698769932832657),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -5.698769932832657),+ ("absorption of article before timethe <cycle> of <time>",+ -5.698769932832657),+ ("intersect by 'of', 'from', 'sabsorption of article before time",+ -5.698769932832657),+ ("intersect by ','hh:mm", -4.600157644164547),+ ("mondayabsorption of article before time", -5.698769932832657),+ ("hourmonth", -3.300874660034286),+ ("todayat <time-of-day>", -5.698769932832657),+ ("absorption of article before timeabsorption of article before time",+ -3.6193283911528207),+ ("dayday", -3.396184839838611),+ ("dayquarter", -5.698769932832657),+ ("<time-of-day> - <time-of-day> (interval)absorption of article before time",+ -5.698769932832657),+ ("thursdayat <time-of-day>", -5.293304824724492),+ ("week-endintersect", -5.698769932832657),+ ("<datetime> - <datetime> (interval)absorption of article before time",+ -5.293304824724492),+ ("dayyear", -3.1730412885244013),+ ("thursdaydd/mm", -5.698769932832657),+ ("thursdaybetween <time-of-day> and <time-of-day> (interval)",+ -5.698769932832657),+ ("tuesdayabsorption of article before time",+ -5.0056227522727115),+ ("tuesdayintersect by 'of', 'from', 's", -5.293304824724492),+ ("monthminute", -5.293304824724492),+ ("<time-of-day> am|pmtomorrow", -5.698769932832657),+ ("<named-month> <day-of-month> (ordinal or number)August",+ -5.698769932832657),+ ("tuesdayMarch", -4.782479200958502),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -5.698769932832657),+ ("thursdayhh:mm", -5.293304824724492),+ ("after <time-of-day>December", -5.698769932832657),+ ("for <duration> from <time>December", -5.698769932832657),+ ("thursdayintersect", -5.293304824724492),+ ("Aprilyear", -4.600157644164547),+ ("sundayintersect by 'of', 'from', 's", -5.698769932832657),+ ("tuesdayJanuary", -5.698769932832657),+ ("absorption of article before timehh(:mm) - <time-of-day> am|pm",+ -5.698769932832657),+ ("tuesdayOctober", -5.293304824724492),+ ("<day-of-month> (ordinal or number) of <named-month>year",+ -5.0056227522727115),+ ("absorption of article before timeFebruary",+ -5.293304824724492),+ ("tuesday<day-of-month> (ordinal or number) <named-month>",+ -5.698769932832657),+ ("weekmonth", -4.782479200958502),+ ("daysecond", -3.8269677559310655),+ ("sundayabsorption of article before time",+ -5.0056227522727115),+ ("todayabsorption of article before time", -5.698769932832657),+ ("thursday<time-of-day> - <time-of-day> (interval)",+ -5.698769932832657),+ ("yearmonth", -5.293304824724492),+ ("absorption of article before timeyear", -4.600157644164547),+ ("dayminute", -3.907010463604602),+ ("intersectyear", -3.907010463604602),+ ("hh:mmabsorption of article before time", -5.293304824724492),+ ("thursdayApril", -5.698769932832657),+ ("minuteday", -4.782479200958502),+ ("absorption of , after named dayintersect",+ -5.698769932832657),+ ("the <cycle> of <time>absorption of article before time",+ -5.0056227522727115),+ ("tuesdayApril", -5.293304824724492),+ ("Octoberyear", -5.698769932832657),+ ("absorption of , after named dayintersect by ','",+ -5.698769932832657),+ ("yearhh:mm", -5.698769932832657),+ ("this <cycle>hh(:mm) - <time-of-day> am|pm",+ -5.698769932832657),+ ("intersectabsorption of article before time",+ -4.600157644164547),+ ("tuesday<day-of-month> (ordinal or number) of <named-month>",+ -5.698769932832657),+ ("after tomorrowabsorption of article before time",+ -5.698769932832657),+ ("absorption of article before timeuntil <time>",+ -4.312475571712766),+ ("hoursecond", -4.446006964337289),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -5.0056227522727115),+ ("<duration> after <time>December", -5.698769932832657),+ ("intersectintersect", -5.698769932832657),+ ("tuesdaytuesday", -5.698769932832657),+ ("the <day-of-month> (non ordinal)absorption of article before time",+ -3.907010463604602),+ ("at <time-of-day>February", -5.698769932832657),+ ("week-endabsorption of article before time",+ -4.782479200958502),+ ("thursdayOctober", -5.293304824724492),+ ("tomorrowat <time-of-day>", -5.698769932832657),+ ("tuesdayintersect", -3.907010463604602),+ ("minutesecond", -5.0056227522727115),+ ("tomorrowbetween <time-of-day> and <time-of-day> (interval)",+ -5.698769932832657),+ ("tuesdayMay", -5.698769932832657),+ ("after <time-of-day>absorption of article before time",+ -5.698769932832657),+ ("<time-of-day> - <time-of-day> (interval)July",+ -5.293304824724492),+ ("sundayintersect", -5.698769932832657),+ ("thursdayintersect by 'of', 'from', 's", -5.698769932832657),+ ("tomorrowabsorption of article before time",+ -5.698769932832657),+ ("absorption of article before timeAugust", -5.698769932832657),+ ("yearminute", -5.698769932832657)],+ n = 199}}),+ ("quarter to|past <integer> (hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tomorrownight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half after|past <integer> (hour-of-day)",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.791759469228055),+ ("absorption of article before time", -1.791759469228055),+ ("time-of-day (latent)", -1.3862943611198906),+ ("hour", -0.8754687373538999)],+ n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.0986122886681098),+ ("hour", -1.0986122886681098)],+ n = 1}}),+ ("early morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.740840023925201),+ ("ordinals (1st..12th, 20th, 30th..90th)week (grain)intersect by 'of', 'from', 's",+ -2.740840023925201),+ ("ordinals (1st..12th, 20th, 30th..90th)day (grain)absorption of article before time",+ -2.740840023925201),+ ("ordinal (digits)quarter (grain)absorption of article before time",+ -2.3353749158170367),+ ("quarteryear", -2.0476928433652555),+ ("weekmonth", -1.6422277352570913),+ ("ordinal (digits)quarter (grain)year", -2.740840023925201),+ ("ordinals (1st..12th, 20th, 30th..90th)week (grain)intersect",+ -2.740840023925201),+ ("ordinals (1st..12th, 20th, 30th..90th)week (grain)absorption of article before time",+ -2.0476928433652555)],+ n = 9},+ koData =+ ClassData{prior = -1.3862943611198906, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)hour (grain)absorption of article before time",+ -2.2512917986064953),+ ("ordinal (digits)hour (grain)morning", -2.2512917986064953),+ ("ordinal (digits)hour (grain)in|during the <part-of-day>",+ -2.2512917986064953),+ ("hourhour", -1.55814461804655)],+ n = 3}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0986122886681098),+ ("hh:mmhh:mm", -1.0986122886681098),+ ("hourhour", -1.791759469228055),+ ("<time-of-day> am|pm<time-of-day> am|pm", -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("after tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("week", -1.791759469228055),+ ("month (grain)", -2.0794415416798357),+ ("year (grain)", -2.0794415416798357),+ ("week (grain)", -1.791759469228055),+ ("quarter", -2.4849066497880004), ("year", -2.0794415416798357),+ ("month", -2.0794415416798357),+ ("quarter (grain)", -2.4849066497880004)],+ n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = -0.587786664902119, unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("dayday", -2.917770732084279),+ ("week (grain)intersect by 'of', 'from', 's",+ -2.917770732084279),+ ("week (grain)<day-of-month> (ordinal)", -2.512305623976115),+ ("weekmonth", -2.2246235515243336),+ ("week (grain)October", -2.917770732084279),+ ("day (grain)valentine's day", -2.917770732084279),+ ("weekday", -1.6650077635889111),+ ("week (grain)intersect", -2.917770732084279),+ ("week (grain)<day-of-month> (ordinal or number) <named-month>",+ -2.001480000210124)],+ n = 10},+ koData =+ ClassData{prior = -0.8109302162163288,+ unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -2.3978952727983707),+ ("daymonth", -1.8870696490323797),+ ("day (grain)intersect", -2.803360380906535),+ ("quarteryear", -2.3978952727983707),+ ("week (grain)time-of-day (latent)", -2.3978952727983707),+ ("weekhour", -2.3978952727983707),+ ("day (grain)intersect by 'of', 'from', 's",+ -2.803360380906535),+ ("quarter (grain)year", -2.3978952727983707)],+ n = 8}}),+ ("number.number hours",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods =+ HashMap.fromList [("integer (numeric)integer (numeric)", 0.0)],+ n = 2}}),+ ("this <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("thursday", -1.252762968495368),+ ("monday", -1.252762968495368), ("day", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.5108256237659907),+ ("negative numbers", -0.916290731874155)],+ n = 3}}),+ ("absorption of article before time",+ Classifier{okData =+ ClassData{prior = -0.24251310408386942, unseen = -6.54965074223381,+ likelihoods =+ HashMap.fromList+ [("midnight", -5.855071922202427),+ ("last <cycle> <time>'s'", -3.909161773147114),+ ("week", -3.657847344866208),+ ("Father's Day", -5.449606814094262),+ ("thursday", -5.449606814094262), ("fall", -5.449606814094262),+ ("<day-of-month> (ordinal or number) <named-month>",+ -4.468777561082536),+ ("<time> <part-of-day>", -4.2456340097683265),+ ("absorption of , after named day", -5.449606814094262),+ ("revolution day", -4.756459633534318),+ ("October", -4.150323829964002),+ ("wednesday", -5.855071922202427), ("July", -5.449606814094262),+ ("<ordinal> quarter", -5.855071922202427),+ ("saturday", -5.161924741642482),+ ("Last year", -5.161924741642482),+ ("intersect", -2.810549484479004),+ ("half after|past <integer> (hour-of-day)", -5.855071922202427),+ ("<ordinal> <cycle> of <time>", -5.855071922202427),+ ("next <cycle>", -4.468777561082536),+ ("the <cycle> of <time>", -4.602308953707059),+ ("<ordinal> quarter <year>", -5.855071922202427),+ ("second", -4.938781190328272), ("monday", -5.449606814094262),+ ("valentine's day", -5.449606814094262),+ ("<day-of-month> (ordinal or number) of <named-month>",+ -5.855071922202427),+ ("this|last|next <cycle>", -4.2456340097683265),+ ("Mother's Day", -5.449606814094262),+ ("friday", -5.449606814094262),+ ("<time-of-day> am|pm (verbose)", -5.161924741642482),+ ("<time> after next", -5.855071922202427),+ ("day", -1.8847800086503053),+ ("next <day-of-week>", -4.938781190328272),+ ("afternoon", -4.150323829964002),+ ("February", -4.938781190328272),+ ("quarter", -4.756459633534318),+ ("this <cycle>", -5.855071922202427),+ ("sunday", -5.855071922202427),+ ("time-of-day (latent)", -2.9647001643062625),+ ("year", -3.5524868292083815),+ ("<time-of-day> am|pm", -3.457176649404057),+ ("<duration> after <time>", -5.161924741642482),+ ("hh:mm", -4.756459633534318),+ ("intersect by ','", -5.161924741642482),+ ("intersect by 'of', 'from', 's", -3.909161773147114),+ ("last <time>", -4.468777561082536),+ ("EOM|End of month", -5.855071922202427),+ ("March", -4.602308953707059),+ ("<day-of-month> (ordinal)", -4.468777561082536),+ ("noon", -5.449606814094262), ("hour", -1.9430489167742813),+ ("evening", -4.468777561082536), ("month", -2.937301190118148),+ ("EOD|End of day", -5.855071922202427),+ ("next <time>", -4.756459633534318),+ ("christmas", -5.449606814094262),+ ("next n <cycle>", -4.602308953707059),+ ("tuesday", -5.161924741642482),+ ("halloween day", -5.855071922202427),+ ("winter", -5.855071922202427),+ ("last n <cycle>", -4.756459633534318),+ ("last <cycle> of <time>", -4.602308953707059),+ ("minute", -3.051711541295892),+ ("week-end", -5.449606814094262),+ ("summer", -5.855071922202427), ("August", -5.855071922202427)],+ n = 317},+ koData =+ ClassData{prior = -1.5355067593065663, unseen = -5.521460917862246,+ likelihoods =+ HashMap.fromList+ [("week", -3.7256934272366524),+ ("<duration> hence|ago", -4.824305715904762),+ ("<named-month> <day-of-month> (ordinal or number)",+ -4.824305715904762),+ ("<day-of-month> (ordinal or number) <named-month>",+ -3.0325462466767075),+ ("September", -4.824305715904762),+ ("October", -4.418840607796598),+ ("<ordinal> quarter", -4.824305715904762),+ ("intersect", -3.214867803470662),+ ("the <cycle> of <time>", -3.9080149840306073),+ ("year (latent)", -4.418840607796598),+ ("second", -3.3202283191284883), ("April", -4.824305715904762),+ ("this|last|next <cycle>", -4.824305715904762),+ ("day", -2.1501570664782337), ("afternoon", -4.824305715904762),+ ("quarter", -4.1311585353448175),+ ("time-of-day (latent)", -2.472930458741285),+ ("year", -4.418840607796598), ("hh:mm", -4.824305715904762),+ ("until <time>", -3.3202283191284883),+ ("intersect by 'of', 'from', 's", -4.824305715904762),+ ("March", -4.418840607796598),+ ("<day-of-month> (ordinal)", -2.952503539003171),+ ("hour", -2.4264104431063918), ("month", -2.7448641742249267),+ ("last <cycle>", -4.1311585353448175),+ ("<datetime> - <datetime> (interval)", -4.824305715904762),+ ("<time-of-day> - <time-of-day> (interval)",+ -4.418840607796598),+ ("minute", -3.7256934272366524),+ ("August", -4.418840607796598)],+ n = 87}}),+ ("dd/mm/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)absorption of article before time",+ -1.0986122886681098),+ ("quarteryear", -0.8109302162163288),+ ("ordinal (digits)quarter (grain)year", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.2809338454620642),+ ("ordinals (1st..12th, 20th, 30th..90th)tuesdayintersect",+ -2.1972245773362196),+ ("ordinals (1st..12th, 20th, 30th..90th)tuesdayOctober",+ -2.1972245773362196),+ ("ordinals (1st..12th, 20th, 30th..90th)wednesdayintersect",+ -1.791759469228055),+ ("ordinals (1st..12th, 20th, 30th..90th)the <cycle> of <time>year",+ -2.1972245773362196),+ ("weekyear", -2.1972245773362196)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.252762968495368),+ ("ordinals (1st..12th, 20th, 30th..90th)wednesdayOctober",+ -1.540445040947149),+ ("ordinals (1st..12th, 20th, 30th..90th)tuesdaySeptember",+ -1.9459101490553135)],+ n = 3}}),+ ("the <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -0.8109302162163288, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 4},+ koData =+ ClassData{prior = -0.587786664902119, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 5}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("hourday", -0.8109302162163288),+ ("morning<day-of-month> (ordinal or number) <named-month>",+ -1.0986122886681098),+ ("morning<day-of-month> (ordinal)", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("valentine's day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("month", -0.9808292530117262),+ ("ordinals (1st..12th, 20th, 30th..90th)March",+ -0.9808292530117262)],+ n = 2},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)September",+ -1.791759469228055),+ ("month", -0.8754687373538999),+ ("ordinals (1st..12th, 20th, 30th..90th)October",+ -1.0986122886681098)],+ n = 4}}),+ ("in|during the <part-of-day>",+ Classifier{okData =+ ClassData{prior = -5.715841383994864e-2,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("afternoon", -1.213022639845854),+ ("hour", -0.7205461547480597),+ ("evening", -1.5314763709643884)],+ n = 17},+ koData =+ ClassData{prior = -2.890371757896165, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("afternoon", -0.916290731874155),+ ("hour", -0.916290731874155)],+ n = 1}}),+ ("new year's eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh(:mm) - <time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last|next <cycle>",+ Classifier{okData =+ ClassData{prior = -0.2076393647782445,+ unseen = -3.6109179126442243,+ likelihoods =+ HashMap.fromList+ [("week", -1.6376087894007967),+ ("month (grain)", -2.1972245773362196),+ ("year (grain)", -2.1972245773362196),+ ("week (grain)", -1.6376087894007967),+ ("quarter", -2.890371757896165), ("year", -2.1972245773362196),+ ("month", -2.1972245773362196),+ ("quarter (grain)", -2.890371757896165)],+ n = 13},+ koData =+ ClassData{prior = -1.6739764335716716, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("day", -1.3862943611198906),+ ("day (grain)", -1.3862943611198906)],+ n = 3}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("annunciation day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm (verbose)",+ Classifier{okData =+ ClassData{prior = -0.1823215567939546,+ unseen = -3.6635616461296463,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.538973871058276),+ ("<time-of-day> o'clock", -2.538973871058276),+ ("absorption of article before time", -2.2512917986064953),+ ("time-of-day (latent)", -1.845826690498331),+ ("hh:mm", -2.538973871058276),+ ("until <time-of-day>", -2.9444389791664407),+ ("hour", -0.9985288301111273), ("minute", -2.538973871058276)],+ n = 15},+ koData =+ ClassData{prior = -1.791759469228055, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.252762968495368),+ ("hour", -1.252762968495368)],+ n = 3}}),+ ("<time> after next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("friday", -1.2039728043259361), ("day", -1.2039728043259361),+ ("March", -1.6094379124341003), ("month", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("relative integer (minutes) to|till|before|after <integer> (time-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("number (0..19, 20, 30..90)absorption of article before time",+ -1.0986122886681098),+ ("number (0..19, 20, 30..90)<time-of-day> am|pm",+ -1.5040773967762742),+ ("hour", -0.8109302162163288)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("thursday", -1.6582280766035324),+ ("wednesday", -2.3513752571634776),+ ("monday", -2.3513752571634776), ("day", -0.8472978603872037),+ ("tuesday", -1.6582280766035324)],+ n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last weekend of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("absorption of article before time", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12}}),+ ("June",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("afternoon",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -2.4849066497880004,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<duration> from now",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("second", -1.3862943611198906),+ ("<integer> <unit-of-duration>", -0.9808292530117262),+ ("minute", -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("day", -0.9808292530117262),+ ("<integer> <unit-of-duration>", -0.9808292530117262)],+ n = 2}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.0910424533583156,+ likelihoods = HashMap.fromList [("", 0.0)], n = 20},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <cycle>",+ Classifier{okData =+ ClassData{prior = -0.2006706954621511, unseen = -3.871201010907891,+ likelihoods =+ HashMap.fromList+ [("week", -2.2407096892759584),+ ("intersect", -3.1570004211501135),+ ("year (grain)", -2.751535313041949),+ ("absorption of article before time", -1.547562508716013),+ ("week (grain)", -2.2407096892759584),+ ("day", -1.7707060600302227), ("quarter", -3.1570004211501135),+ ("year", -2.751535313041949), ("hour", -2.2407096892759584),+ ("quarter (grain)", -3.1570004211501135),+ ("summer", -3.1570004211501135)],+ n = 18},+ koData =+ ClassData{prior = -1.7047480922384253, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.845826690498331),+ ("absorption of article before time", -1.845826690498331),+ ("day", -1.55814461804655), ("hour", -2.2512917986064953)],+ n = 4}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.1823215567939546,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("week", -2.3025850929940455),+ ("absorption of article before time", -1.455287232606842),+ ("hh(:mm) - <time-of-day> am|pm", -2.70805020110221),+ ("day", -1.791759469228055),+ ("time-of-day (latent)", -2.70805020110221),+ ("<time-of-day> am|pm", -2.70805020110221),+ ("hour", -2.0149030205422647),+ ("hhmm (military)", -2.70805020110221),+ ("minute", -2.70805020110221)],+ n = 10},+ koData =+ ClassData{prior = -1.791759469228055, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("dd/mm", -1.9459101490553135), ("day", -1.9459101490553135),+ ("time-of-day (latent)", -1.9459101490553135),+ ("hour", -1.9459101490553135)],+ n = 2}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.4900224961362275,+ unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -7.410797215372185e-2),+ ("number (0..19, 20, 30..90)", -2.639057329615259)],+ n = 68},+ koData =+ ClassData{prior = -0.9483300856187717, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList [("integer (numeric)", -2.247285585205863e-2)],+ n = 43}}),+ ("three quarters of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.11506932978478723,+ unseen = -3.7612001156935624,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 41},+ koData =+ ClassData{prior = -2.2192034840549946,+ unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 5}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.9555114450274363),+ ("sundayMarch", -1.8718021769015913),+ ("sundayintersect by 'of', 'from', 's", -1.8718021769015913),+ ("mondayMarch", -1.8718021769015913),+ ("sundayintersect", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.5108256237659907, unseen = -4.74493212836325,+ likelihoods =+ HashMap.fromList+ [("week", -2.538973871058276),+ ("number (0..19, 20, 30..90)day (grain)", -3.349904087274605),+ ("number (0..19, 20, 30..90)year (grain)", -3.349904087274605),+ ("integer (numeric)day (grain)", -2.538973871058276),+ ("number (0..19, 20, 30..90)month (grain)",+ -3.6375861597263857),+ ("second", -3.6375861597263857),+ ("number (0..19, 20, 30..90)hour (grain)", -3.349904087274605),+ ("number (0..19, 20, 30..90)minute (grain)",+ -3.6375861597263857),+ ("integer (numeric)year (grain)", -4.04305126783455),+ ("day", -2.2512917986064953),+ ("number (0..19, 20, 30..90)week (grain)", -2.9444389791664407),+ ("year", -3.126760535960395),+ ("integer (numeric)week (grain)", -3.349904087274605),+ ("hour", -2.790288299339182),+ ("fewminute (grain)", -4.04305126783455),+ ("month", -3.6375861597263857),+ ("integer (numeric)minute (grain)", -2.4336133554004498),+ ("number (0..19, 20, 30..90)second (grain) ",+ -3.6375861597263857),+ ("fewhour (grain)", -4.04305126783455),+ ("minute", -2.171249090932959),+ ("integer (numeric)hour (grain)", -3.6375861597263857)],+ n = 45},+ koData =+ ClassData{prior = -0.916290731874155, unseen = -4.442651256490317,+ likelihoods =+ HashMap.fromList+ [("week", -3.332204510175204),+ ("number (0..19, 20, 30..90)day (grain)", -3.7376696182833684),+ ("integer (numeric)day (grain)", -3.332204510175204),+ ("fewday (grain)", -3.7376696182833684),+ ("second", -2.8213788864092133),+ ("number (0..19, 20, 30..90)hour (grain)", -3.7376696182833684),+ ("integer (numeric)second (grain) ", -3.044522437723423),+ ("number (0..19, 20, 30..90)minute (grain)",+ -3.332204510175204),+ ("integer (numeric)year (grain)", -3.332204510175204),+ ("day", -2.8213788864092133), ("year", -3.332204510175204),+ ("integer (numeric)week (grain)", -3.332204510175204),+ ("hour", -1.9459101490553135), ("month", -3.044522437723423),+ ("integer (numeric)minute (grain)", -3.332204510175204),+ ("number (0..19, 20, 30..90)second (grain) ",+ -3.7376696182833684),+ ("integer (numeric)month (grain)", -3.044522437723423),+ ("minute", -2.8213788864092133),+ ("integer (numeric)hour (grain)", -2.032921526044943)],+ n = 30}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = -0.1670540846631662, unseen = -5.365976015021851,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> approximately", -4.66814498514948),+ ("at <time-of-day>", -2.528078821653209),+ ("<time-of-day> o'clock", -4.66814498514948),+ ("quarter to|past <integer> (hour-of-day)", -4.66814498514948),+ ("half after|past <integer> (hour-of-day)",+ -3.9749978045895347),+ ("absorption of article before time", -2.2702497123511094),+ ("about <time-of-day>", -4.66814498514948),+ ("time-of-day (latent)", -1.864784604242945),+ ("<time-of-day> am|pm", -4.66814498514948),+ ("hh:mm", -2.4168531865429848), ("hour", -1.156599546318459),+ ("<integer>-and-half (hour-of-day)", -4.2626798770413155),+ ("hhmm (military)", -4.66814498514948),+ ("minute", -1.8349316410932637),+ ("after <time-of-day>", -4.66814498514948)],+ n = 99},+ koData =+ ClassData{prior = -1.8718021769015913, unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.2237754316221157),+ ("hour", -0.9873866535578852),+ ("after <time-of-day>", -2.322387720290225)],+ n = 18}}),+ ("<duration> after <time>",+ Classifier{okData =+ ClassData{prior = -0.17185025692665928,+ unseen = -3.8501476017100584,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>absorption of article before time",+ -1.8827312474337816),+ ("quarter of an hour<time-of-day> am|pm", -3.1354942159291497),+ ("<integer> <unit-of-duration>today", -3.1354942159291497),+ ("secondsecond", -3.1354942159291497),+ ("minutehour", -1.4307461236907244),+ ("daysecond", -2.7300291078209855),+ ("quarter of an hourabsorption of article before time",+ -2.7300291078209855),+ ("<integer> <unit-of-duration><time-of-day> am|pm",+ -2.7300291078209855),+ ("yearday", -2.7300291078209855),+ ("minutesecond", -3.1354942159291497),+ ("<integer> <unit-of-duration>now", -2.2192034840549946)],+ n = 16},+ koData =+ ClassData{prior = -1.845826690498331, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.8971199848858813),+ ("<integer> <unit-of-duration>absorption of article before time",+ -1.8971199848858813),+ ("<integer> <unit-of-duration>intersect", -2.3025850929940455),+ ("dayday", -2.3025850929940455)],+ n = 3}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -6.317890162153156e-2,+ unseen = -3.871201010907891,+ likelihoods = HashMap.fromList [("", 0.0)], n = 46},+ koData =+ ClassData{prior = -2.793208009442517, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("<duration> before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>absorption of article before time",+ -1.252762968495368),+ ("minutehour", -0.8472978603872037),+ ("quarter of an hourabsorption of article before time",+ -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect by ','",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -4.584967478670572,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal or number) <named-month>tuesday",+ -3.8815637979434374),+ ("monday<day-of-month> (ordinal or number) <named-month>",+ -3.4760986898352733),+ ("<day-of-month> (ordinal or number) <named-month>monday",+ -3.8815637979434374),+ ("absorption of article before time<day-of-month> (ordinal or number) <named-month>",+ -3.188416617383492),+ ("intersect<day-of-month> (ordinal or number) <named-month>",+ -2.62880082944807),+ ("saturday<day-of-month> (ordinal or number) <named-month>",+ -3.8815637979434374),+ ("intersect by ','year", -3.8815637979434374),+ ("wednesday<day-of-month> (ordinal or number) <named-month>",+ -3.8815637979434374),+ ("dayday", -1.684339220607218),+ ("dayyear", -2.9652730660692823),+ ("tuesday<day-of-month> (ordinal or number) <named-month>",+ -3.188416617383492),+ ("fridayintersect", -3.8815637979434374),+ ("intersect by ','intersect", -3.8815637979434374),+ ("dayminute", -2.782951509275328),+ ("<day-of-month> (ordinal or number) <named-month>intersect",+ -3.8815637979434374),+ ("intersectyear", -3.8815637979434374),+ ("minuteday", -2.495269436823547),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -3.4760986898352733),+ ("intersectintersect", -3.8815637979434374),+ ("fridayintersect by ','", -3.4760986898352733),+ ("sunday<day-of-month> (ordinal or number) <named-month>",+ -3.8815637979434374),+ ("<named-month> <day-of-month> (ordinal or number)friday",+ -3.8815637979434374),+ ("friday<day-of-month> (ordinal or number) <named-month>",+ -3.188416617383492)],+ n = 33},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -3.9889840465642745,+ likelihoods =+ HashMap.fromList+ [("monthday", -2.871679624884012),+ ("Februarytuesday", -3.2771447329921766),+ ("monthyear", -2.871679624884012),+ ("Julyintersect", -2.871679624884012),+ ("monthminute", -2.871679624884012),+ ("Aprilyear", -3.2771447329921766),+ ("Februarymonday", -3.2771447329921766),+ ("fridayintersect", -3.2771447329921766),+ ("intersect by ','intersect", -3.2771447329921766),+ ("dayminute", -2.178532444324067),+ ("<day-of-month> (ordinal or number) <named-month>intersect",+ -3.2771447329921766),+ ("Julyyear", -3.2771447329921766),+ ("intersectintersect", -3.2771447329921766),+ ("fridayintersect by ','", -3.2771447329921766)],+ n = 11}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time>",+ Classifier{okData =+ ClassData{prior = -1.540445040947149, unseen = -3.1780538303479458,+ likelihoods =+ HashMap.fromList+ [("absorption of article before time", -1.3437347467010947),+ ("day", -2.4423470353692043),+ ("<time-of-day> am|pm", -2.4423470353692043),+ ("hour", -2.4423470353692043), ("month", -2.4423470353692043),+ ("minute", -1.749199854809259)],+ n = 6},+ koData =+ ClassData{prior = -0.2411620568168881, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("intersect", -2.3978952727983707),+ ("absorption of article before time", -1.927891643552635),+ ("the <day-of-month> (non ordinal)", -3.3141860046725258),+ ("<time-of-day> am|pm (verbose)", -3.3141860046725258),+ ("day", -1.927891643552635),+ ("time-of-day (latent)", -2.2155737160044158),+ ("<time-of-day> am|pm", -2.908720896564361),+ ("hh:mm", -2.908720896564361), ("hour", -1.3682758556172123),+ ("minute", -2.908720896564361)],+ n = 22}}),+ ("before <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("week", -1.550597412411167), ("day", -1.8870696490323797),+ ("year", -2.3978952727983707),+ ("<integer> <unit-of-duration>", -0.7884573603642702),+ ("month", -2.3978952727983707)],+ n = 14},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect by 'of', 'from', 's",+ Classifier{okData =+ ClassData{prior = -0.4321333551903257, unseen = -4.74493212836325,+ likelihoods =+ HashMap.fromList+ [("halloween dayyear", -4.04305126783455),+ ("daymonth", -3.126760535960395),+ ("monthyear", -2.538973871058276),+ ("wednesdaynext <cycle>", -4.04305126783455),+ ("christmasyear", -4.04305126783455),+ ("wednesdayintersect", -4.04305126783455),+ ("Marchyear", -4.04305126783455),+ ("absorption of article before timeLast year",+ -3.6375861597263857),+ ("last <day-of-week> of <time>year", -4.04305126783455),+ ("wednesdayOctober", -4.04305126783455),+ ("dayyear", -1.7404661748405046),+ ("wednesdaythis|last|next <cycle>", -4.04305126783455),+ ("Mother's Dayyear", -4.04305126783455),+ ("tuesdayOctober", -4.04305126783455),+ ("absorption of article before timeyear", -2.2512917986064953),+ ("revolution dayLast year", -3.6375861597263857),+ ("the <cycle> of <time>year", -4.04305126783455),+ ("<ordinal> <cycle> of <time>year", -4.04305126783455),+ ("absorption of article before timeMarch", -4.04305126783455),+ ("Octoberyear", -3.349904087274605),+ ("Septemberyear", -4.04305126783455),+ ("dayweek", -3.6375861597263857),+ ("last <cycle> <time>'s'year", -3.349904087274605),+ ("weekyear", -3.126760535960395),+ ("last <cycle> of <time>year", -3.6375861597263857)],+ n = 37},+ koData =+ ClassData{prior = -1.0473189942805592, unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("tuesdaySeptember", -3.6888794541139363),+ ("week-endJuly", -3.6888794541139363),+ ("week-endOctober", -3.283414346005772),+ ("daymonth", -1.984131361875511),+ ("monthyear", -3.6888794541139363),+ ("wednesdayintersect", -3.6888794541139363),+ ("intersect by 'of', 'from', 'syear", -3.6888794541139363),+ ("hourmonth", -2.772588722239781),+ ("wednesdayOctober", -3.6888794541139363),+ ("week-endintersect", -3.6888794541139363),+ ("dayyear", -2.5902671654458267),+ ("sundayMarch", -3.6888794541139363),+ ("sundayintersect by 'of', 'from', 's", -3.6888794541139363),+ ("absorption of article before timeyear", -3.6888794541139363),+ ("the <cycle> of <time>year", -3.6888794541139363),+ ("intersectyear", -3.283414346005772),+ ("intersectSeptember", -3.6888794541139363),+ ("mondayMarch", -3.6888794541139363),+ ("intersectintersect", -3.6888794541139363),+ ("tuesdayintersect", -3.6888794541139363),+ ("sundayintersect", -3.6888794541139363),+ ("after <time-of-day>year", -3.6888794541139363)],+ n = 20}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -0.3746934494414107,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("Father's Day", -2.772588722239781),+ ("thursday", -2.772588722239781),+ ("revolution day", -2.772588722239781),+ ("Mother's Day", -2.772588722239781),+ ("day", -1.3862943611198906), ("sunday", -2.367123614131617),+ ("hour", -1.8562979903656263), ("tuesday", -2.772588722239781),+ ("week-end", -1.8562979903656263)],+ n = 11},+ koData =+ ClassData{prior = -1.1631508098056809, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("monday", -2.3025850929940455), ("day", -1.8971199848858813),+ ("sunday", -2.3025850929940455), ("hour", -1.6094379124341003),+ ("week-end", -1.6094379124341003)],+ n = 5}}),+ ("EOM|End of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4011973816621555,+ likelihoods = HashMap.fromList [("", 0.0)], n = 28},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.6418538861723948,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)", -1.3862943611198906),+ ("ordinal (digits)", -0.2876820724517809)],+ n = 10},+ koData =+ ClassData{prior = -0.7472144018302211,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)", -0.3184537311185346),+ ("ordinal (digits)", -1.2992829841302609)],+ n = 9}}),+ ("noon",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.3364722366212129, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("<time> <part-of-day>", -1.9459101490553135),+ ("absorption of article before time", -1.252762968495368),+ ("<time-of-day> am|pm (verbose)", -1.9459101490553135),+ ("hour", -0.8472978603872037)],+ n = 5},+ koData =+ ClassData{prior = -1.252762968495368, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("absorption of article before time", -0.9808292530117262),+ ("hour", -0.9808292530117262)],+ n = 2}}),+ ("evening",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("EOD|End of day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("thursday", -1.9459101490553135),+ ("wednesday", -2.639057329615259),+ ("monday", -2.639057329615259), ("day", -1.0296194171811581),+ ("March", -2.639057329615259), ("month", -2.639057329615259),+ ("tuesday", -1.9459101490553135),+ ("halloween day", -2.639057329615259)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <cycle>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("week", -1.6094379124341003),+ ("week (grain)", -1.6094379124341003),+ ("day", -1.2039728043259361),+ ("day (grain)", -1.2039728043259361)],+ n = 3}}),+ ("<integer>-and-half (hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("new year's day",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("next n <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.713572066704308,+ likelihoods =+ HashMap.fromList+ [("week", -2.995732273553991),+ ("number (0..19, 20, 30..90)day (grain)", -2.995732273553991),+ ("fewday (grain)", -2.995732273553991),+ ("second", -2.5902671654458267),+ ("number (0..19, 20, 30..90)hour (grain)", -2.995732273553991),+ ("integer (numeric)second (grain) ", -2.995732273553991),+ ("number (0..19, 20, 30..90)minute (grain)",+ -2.995732273553991),+ ("integer (numeric)year (grain)", -2.995732273553991),+ ("day", -2.5902671654458267), ("year", -2.995732273553991),+ ("integer (numeric)week (grain)", -2.995732273553991),+ ("hour", -2.5902671654458267), ("month", -2.995732273553991),+ ("integer (numeric)minute (grain)", -2.995732273553991),+ ("number (0..19, 20, 30..90)second (grain) ",+ -2.995732273553991),+ ("integer (numeric)month (grain)", -2.995732273553991),+ ("minute", -2.5902671654458267),+ ("integer (numeric)hour (grain)", -2.995732273553991)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tuesday",+ Classifier{okData =+ ClassData{prior = -0.5306282510621704,+ unseen = -3.0910424533583156,+ likelihoods = HashMap.fromList [("", 0.0)], n = 20},+ koData =+ ClassData{prior = -0.8873031950009028, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.1780538303479458,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 22}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("half a <grain>", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half a <grain>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1}}),+ ("halloween day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("absorption of article before time", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hhmm (military) am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <duration>",+ Classifier{okData =+ ClassData{prior = -7.598590697792199e-2,+ unseen = -4.5217885770490405,+ likelihoods =+ HashMap.fromList+ [("week", -3.817712325956905),+ ("<integer> and a half <grain>", -3.817712325956905),+ ("<integer> more <unit-of-duration>", -3.817712325956905),+ ("<integer> + '\"", -3.1245651453969594),+ ("number.number hours", -3.817712325956905),+ ("second", -3.1245651453969594), ("day", -3.1245651453969594),+ ("half an hour", -3.1245651453969594),+ ("three quarters of an hour", -2.9014215940827497),+ ("<integer> <unit-of-duration>", -1.5151272329628591),+ ("quarter of an hour", -2.9014215940827497),+ ("hour", -2.5649493574615367),+ ("about|exactly <duration>", -3.817712325956905),+ ("half a <grain>", -3.817712325956905),+ ("minute", -1.252762968495368)],+ n = 38},+ koData =+ ClassData{prior = -2.6149597780361984,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("week", -2.3513752571634776), ("day", -1.9459101490553135),+ ("<integer> <unit-of-duration>", -1.6582280766035324)],+ n = 3}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -1.067840630001356, unseen = -3.8066624897703196,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -3.0910424533583156),+ ("minuteminute", -1.9924301646902063),+ ("absorption of article before timeabsorption of article before time",+ -3.0910424533583156),+ ("hh:mmhh:mm", -2.174751721484161),+ ("dayday", -2.174751721484161),+ ("hourhour", -2.6855773452501515),+ ("<day-of-month> (ordinal or number) <named-month><day-of-month> (ordinal or number) <named-month>",+ -2.6855773452501515),+ ("absorption of article before timethe <day-of-month> (non ordinal)",+ -3.0910424533583156),+ ("<time-of-day> am|pm<time-of-day> am|pm",+ -2.6855773452501515)],+ n = 11},+ koData =+ ClassData{prior = -0.42121346507630353,+ unseen = -4.174387269895637,+ likelihoods =+ HashMap.fromList+ [("hourday", -3.0602707946915624),+ ("dayhour", -3.0602707946915624),+ ("monthday", -3.0602707946915624),+ ("absorption of article before time<day-of-month> (ordinal or number) <named-month>",+ -3.0602707946915624),+ ("<time-of-day> am|pmintersect", -3.4657359027997265),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -3.4657359027997265),+ ("hh:mm<time-of-day> am|pm", -3.0602707946915624),+ ("absorption of article before timeintersect",+ -2.772588722239781),+ ("minuteminute", -2.2129729343043585),+ ("absorption of article before timeabsorption of article before time",+ -2.772588722239781),+ ("hh:mmhh:mm", -2.772588722239781),+ ("dayday", -2.5494451709255714),+ ("hourhour", -2.772588722239781),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -3.4657359027997265),+ ("minutehour", -3.0602707946915624),+ ("hh:mmintersect", -3.0602707946915624),+ ("absorption of article before timehh:mm", -3.4657359027997265),+ ("about <time-of-day><time-of-day> am|pm", -3.4657359027997265),+ ("<time-of-day> am|pm<time-of-day> am|pm",+ -3.4657359027997265)],+ n = 21}}),+ ("on the day of <day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("day", -0.6931471805599453),+ ("new year's day", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -1.3545456628053103,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> am|pmabsorption of article before time",+ -2.70805020110221),+ ("minuteminute", -1.791759469228055),+ ("hh:mmhh:mm", -1.791759469228055),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),+ ("hourhour", -1.791759469228055),+ ("<time-of-day> am|pm<time-of-day> am|pm",+ -2.3025850929940455)],+ n = 8},+ koData =+ ClassData{prior = -0.29849298855599654,+ unseen = -4.110873864173311,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.791759469228055),+ ("hh:mm<time-of-day> am|pm", -2.995732273553991),+ ("minuteminute", -2.4849066497880004),+ ("absorption of article before timeabsorption of article before time",+ -3.4011973816621555),+ ("hh:mmhh:mm", -2.70805020110221),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.995732273553991),+ ("hourhour", -2.0149030205422647),+ ("about <time-of-day>time-of-day (latent)",+ -3.4011973816621555),+ ("minutehour", -1.529395204760564),+ ("absorption of article before timetime-of-day (latent)",+ -2.995732273553991),+ ("absorption of article before timehh:mm", -3.4011973816621555),+ ("about <time-of-day><time-of-day> am|pm", -3.4011973816621555),+ ("<time-of-day> am|pm<time-of-day> am|pm",+ -3.4011973816621555)],+ n = 23}}),+ ("<number><grain> (one word)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last n <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("week", -2.917770732084279),+ ("integer (numeric)day (grain)", -2.512305623976115),+ ("second", -2.512305623976115),+ ("integer (numeric)second (grain) ", -2.512305623976115),+ ("number (0..19, 20, 30..90)minute (grain)",+ -2.917770732084279),+ ("integer (numeric)year (grain)", -2.917770732084279),+ ("day", -2.512305623976115), ("year", -2.917770732084279),+ ("integer (numeric)week (grain)", -2.917770732084279),+ ("hour", -2.917770732084279), ("month", -2.512305623976115),+ ("integer (numeric)minute (grain)", -2.917770732084279),+ ("integer (numeric)month (grain)", -2.512305623976115),+ ("minute", -2.512305623976115),+ ("integer (numeric)hour (grain)", -2.917770732084279)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)thursdayintersect",+ -1.791759469228055),+ ("dayday", -0.8754687373538999),+ ("ordinals (1st..12th, 20th, 30th..90th)thursdayabsorption of article before time",+ -1.3862943611198906),+ ("ordinals (1st..12th, 20th, 30th..90th)thursdayintersect by 'of', 'from', 's",+ -1.791759469228055)],+ n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("dayday", -1.0986122886681098),+ ("ordinals (1st..12th, 20th, 30th..90th)thursdayabsorption of article before time",+ -1.0986122886681098)],+ n = 1}}),+ ("hhmm (military)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = -0.42488319396526597,+ unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -1.0608719606852628,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.6739764335716716),+ ("daymonth", -0.8266785731844679),+ ("day (grain)intersect", -1.6739764335716716),+ ("day (grain)intersect by 'of', 'from', 's",+ -1.6739764335716716)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> ( ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = -0.2411620568168881,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)September",+ -1.9810014688665833),+ ("ordinals (1st..12th, 20th, 30th..90th)April",+ -2.268683541318364),+ ("ordinal (digits)April", -2.6741486494265287),+ ("month", -0.8823891801984737),+ ("ordinal (digits)March", -2.268683541318364),+ ("ordinals (1st..12th, 20th, 30th..90th)March",+ -1.9810014688665833)],+ n = 11},+ koData =+ ClassData{prior = -1.540445040947149, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("ordinals (1st..12th, 20th, 30th..90th)absorption of article before time",+ -1.1786549963416462),+ ("month", -1.1786549963416462)],+ n = 3}}),+ ("morning",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.9459101490553135,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("lastnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -2.120263536200091, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("absorption of article before time", -1.3862943611198906),+ ("<time-of-day> am|pm", -1.791759469228055),+ ("hour", -1.0986122886681098)],+ n = 3},+ koData =+ ClassData{prior = -0.12783337150988489,+ unseen = -3.9318256327243257,+ likelihoods =+ HashMap.fromList+ [("intersect", -2.8134107167600364),+ ("absorption of article before time", -1.1394342831883648),+ ("day", -1.8325814637483102),+ ("<time-of-day> am|pm", -2.3025850929940455),+ ("intersect by 'of', 'from', 's", -3.2188758248682006),+ ("hour", -1.1394342831883648)],+ n = 22}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = -0.1466034741918754, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19},+ koData =+ ClassData{prior = -1.9924301646902063,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>absorption of article before time",+ -1.0986122886681098),+ ("dayday", -1.0986122886681098)],+ n = 1},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("dayhour", -0.9808292530117262),+ ("<integer> <unit-of-duration>absorption of article before time",+ -1.3862943611198906),+ ("<integer> <unit-of-duration>intersect", -1.3862943611198906)],+ n = 2}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer> (as relative minutes)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("absorption of article before timeinteger (numeric)",+ -1.8718021769015913),+ ("absorption of article before timenumber (0..19, 20, 30..90)",+ -1.8718021769015913),+ ("at <time-of-day>number (0..19, 20, 30..90)",+ -1.8718021769015913),+ ("hour", -0.9555114450274363),+ ("at <time-of-day>integer (numeric)", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("September", -2.120263536200091),+ ("October", -2.5257286443082556), ("July", -1.4271163556401458),+ ("month", -0.8209805520698302), ("August", -2.120263536200091)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("within <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("week", -0.6931471805599453),+ ("<integer> <unit-of-duration>", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("before yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("August",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}})]
Duckling/Ranking/Classifiers/EN_CA.hs view
@@ -40,2306 +40,2371 @@ n = 7}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hh:mm", -1.7047480922384253), ("hour", -1.2992829841302609),- ("minute", -1.7047480922384253)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thursday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods = HashMap.fromList [("", 0.0)], n = 18},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (numeric)",- Classifier{okData =- ClassData{prior = -0.7740538191727457, unseen = -5.19295685089021,- likelihoods = HashMap.fromList [("", 0.0)], n = 178},- koData =- ClassData{prior = -0.6182992897635128,- unseen = -5.3471075307174685,- likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),- ("<duration> hence|ago",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.784189633918261,- likelihoods =- HashMap.fromList- [("week", -1.563975538357343), ("day", -1.8152899666382492),- ("year", -2.662587827025453),- ("<integer> <unit-of-duration>", -1.0531499145913523),- ("a <unit-of-duration>", -2.662587827025453),- ("month", -2.662587827025453),- ("fortnight", -2.662587827025453)],- n = 18},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("noon|midnight|EOD|end of day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter to|till|before <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Father's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<cycle> after|before <time>",- Classifier{okData =- ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.6094379124341003),- ("dayday", -1.0986122886681098),- ("day (grain)yesterday", -1.6094379124341003)],- n = 4},- koData =- ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("dayhour", -1.466337068793427),- ("year (grain)Christmas", -1.8718021769015913),- ("day (grain)intersect", -1.466337068793427),- ("yearday", -1.8718021769015913)],- n = 3}}),- ("Martin Luther King's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (20..90)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/yyyy",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("integer after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("hour", -0.8109302162163288),- ("integer (numeric)time-of-day (latent)", -1.0986122886681098),- ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal or number) <named-month>",- Classifier{okData =- ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("ordinal (digits)December", -2.1400661634962708),- ("ordinal (digits)February", -2.1400661634962708),- ("integer (numeric)April", -2.1400661634962708),- ("month", -1.4469189829363254)],- n = 3},- koData =- ClassData{prior = -0.2876820724517809,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("ordinal (digits)October", -2.6741486494265287),- ("ordinal (digits)July", -2.6741486494265287),- ("integer (numeric)September", -2.268683541318364),- ("ordinal (digits)August", -2.6741486494265287),- ("integer (numeric)August", -2.6741486494265287),- ("ordinal (digits)April", -2.6741486494265287),- ("month", -1.0647107369924282),- ("integer (numeric)July", -2.268683541318364)],- n = 9}}),- ("<time> <part-of-day>",- Classifier{okData =- ClassData{prior = -9.844007281325252e-2,- unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("<day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("dayhour", -1.5284688499004333),- ("Mondayearly morning", -3.3202283191284883),- ("time-of-day (latent)tonight", -3.3202283191284883),- ("hourhour", -2.339399066116762),- ("<time-of-day> o'clockin|during the <part-of-day>",- -3.7256934272366524),- ("todaypart of days", -3.7256934272366524),- ("minutehour", -2.627081138568543),- ("at <time-of-day>in|during the <part-of-day>",- -3.3202283191284883),- ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),- ("Mondayin|during the <part-of-day>", -3.7256934272366524),- ("intersectpart of days", -3.7256934272366524),- ("intersectin|during the <part-of-day>", -3.7256934272366524),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -3.7256934272366524),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("tomorrowpart of days", -2.339399066116762),- ("hh:mmin|during the <part-of-day>", -3.0325462466767075),- ("time-of-day (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("hhmm (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("yesterdaypart of days", -3.7256934272366524),- ("Mondaypart of days", -3.7256934272366524)],- n = 29},- koData =- ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,- likelihoods =- HashMap.fromList- [("yearhour", -2.740840023925201),- ("monthhour", -2.740840023925201),- ("hourhour", -2.740840023925201),- ("past year (latent)in|during the <part-of-day>",- -2.740840023925201),- ("Februaryin|during the <part-of-day>", -2.740840023925201),- ("time-of-day (latent)in|during the <part-of-day>",- -2.740840023925201)],- n = 3}}),- ("today",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd",- Classifier{okData =- ClassData{prior = -1.4271163556401458,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,- likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),- ("at <time-of-day>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -4.787491742782046,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -3.6805112044434196),- ("integer after|past <hour-of-day>", -3.6805112044434196),- ("half after|past <hour-of-day>", -4.085976312551584),- ("time-of-day (latent)", -1.7346010553881064),- ("hhmm (latent)", -3.392829131991639),- ("<time-of-day> am|pm", -1.7833912195575383),- ("hh:mm", -3.169685580677429),- ("about|exactly <time-of-day>", -3.6805112044434196),- ("hour", -1.1415373333851437),- ("<time-of-day> sharp|exactly", -4.085976312551584),- ("minute", -1.8887517352153647)],- n = 54},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.1895840668738362),- ("hour", -1.1895840668738362)],- n = 6}}),- ("December",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("absorption of , after named day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("on <date>", -2.1972245773362196),- ("Wednesday", -2.6026896854443837),- ("Saturday", -2.6026896854443837),- ("Monday", -2.1972245773362196),- ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),- ("Sunday", -2.6026896854443837)],- n = 10},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("September",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("tonight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the ides of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("on <date>",- Classifier{okData =- ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,- likelihoods =- HashMap.fromList- [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),- ("absorption of , after named day", -2.890371757896165),- ("intersect", -2.890371757896165),- ("Saturday", -2.6026896854443837),- ("Friday", -3.295836866004329), ("day", -0.8979415932059586),- ("the <day-of-month> (ordinal)", -2.890371757896165),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -2.6026896854443837),- ("hour", -3.295836866004329)],- n = 22},- koData =- ClassData{prior = -1.8718021769015913,- unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("intersect", -1.791759469228055), ("day", -1.2809338454620642),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.791759469228055)],- n = 4}}),- ("integer (0..19)",- Classifier{okData =- ClassData{prior = -2.409755157906053e-2,- unseen = -3.7612001156935624,- likelihoods = HashMap.fromList [("", 0.0)], n = 41},- koData =- ClassData{prior = -3.7376696182833684,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("between <time-of-day> and <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("minuteminute", -0.916290731874155),- ("hh:mmhh:mm", -0.916290731874155)],- n = 3},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -0.916290731874155),- ("minutehour", -0.916290731874155)],- n = 3}}),- ("Halloween",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),- ("Augustordinal (digits)integer (numeric)",- -1.6094379124341003),- ("month", -0.916290731874155),- ("Augustordinal (digits)ordinal (digits)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("October",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("month (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> more <unit-of-duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("integer (numeric)minute (grain)", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> o'clock",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("in|within|after <duration>",- Classifier{okData =- ClassData{prior = -4.652001563489282e-2,- unseen = -4.61512051684126,- likelihoods =- HashMap.fromList- [("week", -3.2188758248682006),- ("<integer> more <unit-of-duration>", -3.912023005428146),- ("three-quarters of an hour", -2.995732273553991),- ("<integer> + '\"", -3.2188758248682006),- ("number.number hours", -3.912023005428146),- ("second", -3.506557897319982), ("day", -3.2188758248682006),- ("half an hour", -2.995732273553991),- ("<integer> <unit-of-duration>", -1.6094379124341003),- ("a <unit-of-duration>", -2.995732273553991),- ("quarter of an hour", -2.995732273553991),- ("hour", -2.5257286443082556),- ("about|exactly <duration>", -3.912023005428146),- ("<integer> and an half hour", -3.912023005428146),- ("minute", -1.2729656758128873)],- n = 42},- koData =- ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("quarter", -1.8971199848858813),- ("<integer> <unit-of-duration>", -2.3025850929940455),- ("a <unit-of-duration>", -2.3025850929940455)],- n = 2}}),- ("three-quarters of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Wednesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> + '\"",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half <integer> (UK style hour-of-day)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("July",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hour (grain)",- Classifier{okData =- ClassData{prior = -0.8209805520698302,- unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),- ("<ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -1.1786549963416462),- ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",- -1.466337068793427),- ("quarter", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.8109302162163288),- ("quarter", -0.8109302162163288)],- n = 3}}),- ("one twenty two",- Classifier{okData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)", -0.3364722366212129),- ("integer (0..19)integer (20..90)", -1.252762968495368)],- n = 5}}),- ("intersect",- Classifier{okData =- ClassData{prior = -0.4634795031687923, unseen = -6.169610732491456,- likelihoods =- HashMap.fromList- [("<datetime> - <datetime> (interval)on <date>",- -4.558078578454241),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.558078578454241),- ("hourday", -3.769621218089971),- ("dayhour", -3.223077511721901),- ("daymonth", -4.781222129768451),- ("monthday", -5.0689042022202315),- ("monthyear", -3.8649313978942956),- ("Tuesdaythe <day-of-month> (ordinal)", -5.474369310328396),- ("Christmasyear", -5.474369310328396),- ("from <datetime> - <datetime> (interval)July",- -5.474369310328396),- ("houryear", -5.474369310328396),- ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.781222129768451),- ("<time-of-day> am|pmintersect", -4.221606341833028),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -5.474369310328396),- ("Marchyear", -5.474369310328396),- ("<named-month>|<named-day> <day-of-month> (ordinal)year",- -5.0689042022202315),- ("intersect<time-of-day> am|pm", -5.474369310328396),- ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.474369310328396),- ("monthhour", -5.0689042022202315),- ("last <day-of-week> of <time>year", -5.474369310328396),- ("todayat <time-of-day>", -5.474369310328396),- ("Thursday<time> timezone", -5.0689042022202315),- ("this <time>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("dayday", -3.459466289786131),- ("Thanksgiving Dayyear", -4.375757021660286),- ("<time> <part-of-day>at <time-of-day>", -5.474369310328396),- ("Tuesdayin <named-month>", -5.474369310328396),- ("mm/ddat <time-of-day>", -5.474369310328396),- ("tonightat <time-of-day>", -5.474369310328396),- ("<time-of-day> am|pmabsorption of , after named day",- -4.781222129768451),- ("today<time-of-day> am|pm", -5.474369310328396),- ("Februarythe <day-of-month> (ordinal)", -5.0689042022202315),- ("at <time-of-day><time> <part-of-day>", -5.474369310328396),- ("mm/dd<time-of-day> am|pm", -5.474369310328396),- ("hourhour", -4.221606341833028),- ("<time-of-day> am|pmon <date>", -3.459466289786131),- ("Wednesdaythis|last|next <cycle>", -5.474369310328396),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.970291913552122),- ("dayyear", -3.0320222749591914),- ("last weekend of <named-month>year", -5.474369310328396),- ("<time-of-day> o'clockin|during the <part-of-day>",- -5.474369310328396),- ("<time-of-day> am|pmtomorrow", -4.781222129768451),- ("minutehour", -4.558078578454241),- ("Mother's Dayyear", -5.474369310328396),- ("at <time-of-day>in|during the <part-of-day>",- -5.0689042022202315),- ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -3.769621218089971),- ("for <duration> from <time>December", -5.474369310328396),- ("tomorrow<time-of-day> sharp|exactly", -5.474369310328396),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.558078578454241),- ("on <date><named-month> <day-of-month> (non ordinal)",- -5.0689042022202315),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.558078578454241),- ("Mondayin|during the <part-of-day>", -5.474369310328396),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.0689042022202315),- ("intersectin|during the <part-of-day>", -5.474369310328396),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -5.474369310328396),- ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.781222129768451),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -4.558078578454241),- ("at <time-of-day>intersect", -5.0689042022202315),- ("<time-of-day> - <time-of-day> (interval)tomorrow",- -5.474369310328396),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.474369310328396),- ("dayminute", -3.1717842173343502),- ("from <datetime> - <datetime> (interval)on <date>",- -5.0689042022202315),- ("<datetime> - <datetime> (interval)tomorrow",- -5.474369310328396),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.0689042022202315),- ("<ordinal> <cycle> of <time>year", -5.474369310328396),- ("minuteday", -2.0731719286662407),- ("absorption of , after named dayintersect",- -5.474369310328396),- ("Octoberyear", -4.221606341833028),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -5.474369310328396),- ("at <time-of-day>absorption of , after named day",- -5.474369310328396),- ("<day-of-month> (ordinal or number) <named-month>year",- -5.474369310328396),- ("year<time-of-day> am|pm", -5.474369310328396),- ("Septemberyear", -5.0689042022202315),- ("at <time-of-day>on <date>", -4.375757021660286),- ("between <time-of-day> and <time-of-day> (interval)on <date>",- -4.781222129768451),- ("Halloweenyear", -5.474369310328396),- ("dayweek", -5.474369310328396),- ("weekyear", -5.0689042022202315),- ("hh:mmin|during the <part-of-day>", -4.781222129768451),- ("Father's Dayyear", -5.474369310328396),- ("<cycle> after|before <time><time-of-day> am|pm",- -5.0689042022202315),- ("February<time> <part-of-day>", -5.474369310328396),- ("Martin Luther King's Dayyear", -5.0689042022202315),- ("tomorrowat <time-of-day>", -4.781222129768451),- ("between <time> and <time>on <date>", -4.781222129768451),- ("at <time-of-day>tomorrow", -5.0689042022202315),- ("tomorrow<time-of-day> am|pm", -5.474369310328396),- ("in|during the <part-of-day>at <time-of-day>",- -5.474369310328396),- ("black fridayyear", -5.0689042022202315),- ("Labor Dayyear", -5.474369310328396),- ("Februaryintersect", -5.474369310328396),- ("last <cycle> of <time>year", -4.781222129768451),- ("<named-month> <day-of-month> (non ordinal)year",- -5.474369310328396),- ("yearminute", -5.474369310328396)],- n = 173},- koData =- ClassData{prior = -0.9917982843823002, unseen = -5.817111159963204,- likelihoods =- HashMap.fromList- [("in <named-month>year", -5.120983351265121),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -5.120983351265121),- ("hourday", -5.120983351265121),- ("<named-month> <day-of-month> (non ordinal)July",- -5.120983351265121),- ("dayhour", -3.329223882037066),- ("daymonth", -3.041541809585285),- ("monthday", -4.715518243156957),- ("monthyear", -4.427836170705175),- ("intersecthh:mm", -5.120983351265121),- ("from <datetime> - <datetime> (interval)July",- -5.120983351265121),- ("houryear", -5.120983351265121),- ("from <time-of-day> - <time-of-day> (interval)July",- -5.120983351265121),- ("until <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.427836170705175),- ("<time-of-day> am|pmintersect", -3.868220382769753),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.204692619390966),- ("Tuesdayafter <time-of-day>", -5.120983351265121),- ("July<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("absorption of , after named dayJuly", -4.715518243156957),- ("monthhour", -5.120983351265121),- ("hourmonth", -4.427836170705175),- ("todayat <time-of-day>", -5.120983351265121),- ("dayday", -4.715518243156957),- ("mm/ddat <time-of-day>", -4.715518243156957),- ("<time-of-day> am|pmon <date>", -3.868220382769753),- ("dayyear", -3.868220382769753),- ("Thursdaymm/dd", -5.120983351265121),- ("Thursdayat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>September",- -5.120983351265121),- ("monthminute", -5.120983351265121),- ("<time-of-day> am|pmtomorrow", -5.120983351265121),- ("Thursdayhh:mm", -5.120983351265121),- ("August<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("Fridayyear", -4.715518243156957),- ("minutemonth", -3.416235259026696),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.715518243156957),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("Aprilyear", -5.120983351265121),- ("mm/dd<time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.120983351265121),- ("<duration> after|before|from <time>December",- -5.120983351265121),- ("yesterday<time-of-day> am|pm", -5.120983351265121),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -4.204692619390966),- ("<named-month> <day-of-month> (non ordinal)August",- -5.120983351265121),- ("until <time-of-day>on <date>", -4.427836170705175),- ("at <time-of-day>intersect", -4.715518243156957),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("dayminute", -3.175073202209808),- ("intersectSeptember", -3.616905954488847),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("minuteday", -2.317622970358586),- ("absorption of , after named dayintersect",- -5.120983351265121),- ("Februaryin|during the <part-of-day>", -5.120983351265121),- ("week-endin <named-month>", -5.120983351265121),- ("Octoberyear", -5.120983351265121),- ("yearhh:mm", -5.120983351265121),- ("hh:mmon <date>", -3.616905954488847),- ("absorption of , after named daySeptember",- -4.204692619390966),- ("on <date>September", -4.715518243156957),- ("at <time-of-day>on <date>", -4.715518243156957),- ("absorption of , after named dayFebruary", -4.204692619390966),- ("July<integer> to|till|before <hour-of-day>",- -5.120983351265121),- ("tomorrowat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>July",- -5.120983351265121),- ("tomorrow<time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day>year", -5.120983351265121),- ("yearminute", -5.120983351265121)],- n = 102}}),- ("after lunch/work/school",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("early morning",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <number> (implicit minutes)",- Classifier{okData =- ClassData{prior = -1.041453874828161, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.5596157879354228),- ("integer (0..19)", -0.8472978603872037)],- n = 12},- koData =- ClassData{prior = -0.4353180712578455,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.3448404862917295),- ("integer (0..19)", -1.2321436812926323)],- n = 22}}),- ("<ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("daymonth", -2.0149030205422647),- ("quarteryear", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)day (grain)October",- -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",- -2.0149030205422647),- ("weekmonth", -1.6094379124341003),- ("ordinal (digits)quarter (grain)year", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)October",- -2.0149030205422647)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("year (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods = HashMap.fromList [("", 0.0)], n = 21},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.6375861597263857,- likelihoods =- HashMap.fromList- [("minuteminute", -2.001480000210124),- ("<day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("hh:mmhh:mm", -2.001480000210124),- ("dayday", -2.512305623976115),- ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),- ("hourhour", -2.512305623976115),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.912023005428146,- likelihoods =- HashMap.fromList- [("hourday", -3.1986731175506815),- ("dayhour", -2.793208009442517),- ("<day-of-month> (ordinal)time-of-day (latent)",- -3.1986731175506815),- ("hh:mmtime-of-day (latent)", -2.2823823856765264),- ("minuteminute", -2.793208009442517),- ("time-of-day (latent)time-of-day (latent)",- -2.793208009442517),- ("dayday", -3.1986731175506815),- ("hourhour", -2.505525936990736),- ("dayyear", -3.1986731175506815),- ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",- -3.1986731175506815),- ("minutehour", -2.2823823856765264),- ("hh:mmintersect", -2.793208009442517),- ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("time-of-day (latent)<time-of-day> am|pm",- -3.1986731175506815),- ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",- -3.1986731175506815)],- n = 14}}),- ("Saturday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",- -1.7346010553881064),- ("weekmonth", -1.7346010553881064),- ("week (grain)October", -1.7346010553881064),- ("week (grain)<named-month> <day-of-month> (non ordinal)",- -1.7346010553881064),- ("weekday", -1.2237754316221157)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("number.number hours",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("minuteminute", -1.6094379124341003),- ("hh:mmhh:mm", -1.6094379124341003),- ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),- ("hourhour", -2.3025850929940455),- ("hourminute", -2.3025850929940455),- ("time-of-day (latent)<time-of-day> sharp|exactly",- -2.70805020110221),- ("time-of-day (latent)hh:mm", -2.70805020110221),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],- n = 9},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.6094379124341003),- ("time-of-day (latent)time-of-day (latent)",- -2.0149030205422647),- ("hourhour", -1.791759469228055),- ("minutehour", -1.6094379124341003),- ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],- n = 9}}),- ("integer 21..99",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods =- HashMap.fromList [("integer (numeric)integer (numeric)", 0.0)],- n = 2}}),- ("last|next n <cycle>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("week", -2.627081138568543),- ("integer (0..19)year (grain)", -3.3202283191284883),- ("integer (numeric)day (grain)", -3.0325462466767075),- ("integer (0..19)second (grain) ", -3.3202283191284883),- ("integer (0..19)hour (grain)", -3.3202283191284883),- ("second", -2.8094026953624978),- ("integer (numeric)second (grain) ", -3.3202283191284883),- ("integer (numeric)year (grain)", -3.3202283191284883),- ("day", -2.472930458741285), ("year", -2.8094026953624978),- ("integer (numeric)week (grain)", -3.0325462466767075),- ("integer (0..19)month (grain)", -3.3202283191284883),- ("hour", -2.8094026953624978), ("month", -2.8094026953624978),- ("integer (numeric)minute (grain)", -3.3202283191284883),- ("integer (0..19)minute (grain)", -3.3202283191284883),- ("integer (numeric)month (grain)", -3.3202283191284883),- ("minute", -2.8094026953624978),- ("integer (numeric)hour (grain)", -3.3202283191284883),- ("integer (0..19)day (grain)", -3.0325462466767075),- ("integer (0..19)week (grain)", -3.3202283191284883)],- n = 31},- koData =- ClassData{prior = -infinity, unseen = -3.0910424533583156,- likelihoods = HashMap.fromList [], n = 0}}),- ("yyyy-mm-dd",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd/yyyy",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -1.6094379124341003,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("Monday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("yesterday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<ordinal> quarter <year>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh:mm:ss",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<hour-of-day> <integer>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("at <time-of-day>integer (20..90)", -1.3862943611198906),- ("hour", -0.9808292530117262),- ("at <time-of-day>integer (numeric)", -1.3862943611198906)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>integer (numeric)",- -1.0986122886681098),- ("hour", -1.0986122886681098)],- n = 1}}),- ("nth <time> of <time>",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("daymonth", -0.9808292530117262),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -2.0794415416798357),- ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",- -1.6739764335716716),- ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",- -1.6739764335716716)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.5649493574615367,- likelihoods =- HashMap.fromList- [("daymonth", -1.0986122886681098),- ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",- -1.791759469228055),- ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",- -1.3862943611198906)],- n = 3}}),- ("Valentine's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("April",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("end of month",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("week (grain)",- Classifier{okData =- ClassData{prior = -8.004270767353637e-2,- unseen = -3.6375861597263857,- likelihoods = HashMap.fromList [("", 0.0)], n = 36},- koData =- ClassData{prior = -2.5649493574615367,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("<part-of-day> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",- -1.6094379124341003),- ("hourday", -0.916290731874155),- ("part of daysthe <day-of-month> (ordinal)",- -1.6094379124341003),- ("part of daysthe <day-of-month> (number)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("past year (latent)",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 2}}),- ("now",- Classifier{okData =- ClassData{prior = -0.15415067982725836,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -1.9459101490553135,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("<day-of-month> (ordinal or number) of <named-month>",- Classifier{okData =- ClassData{prior = -0.13353139262452263,- unseen = -3.0910424533583156,- likelihoods =- HashMap.fromList- [("ordinal (digits)July", -2.3513752571634776),- ("ordinals (first..twentieth,thirtieth,...)March",- -2.3513752571634776),- ("ordinal (digits)February", -2.3513752571634776),- ("integer (numeric)February", -1.9459101490553135),- ("month", -0.9650808960435872),- ("ordinal (digits)March", -2.3513752571634776),- ("integer (numeric)July", -2.3513752571634776)],- n = 7},- koData =- ClassData{prior = -2.0794415416798357,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)February", -1.5040773967762742),- ("month", -1.5040773967762742)],- n = 1}}),- ("this <part-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("hour", -0.6931471805599453),- ("part of days", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Friday",- Classifier{okData =- ClassData{prior = -0.3677247801253174,- unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("in|during the <part-of-day>",- Classifier{okData =- ClassData{prior = -8.701137698962981e-2,- unseen = -3.258096538021482,- likelihoods =- HashMap.fromList- [("early morning", -2.5257286443082556),- ("hour", -0.7339691750802004),- ("part of days", -0.8209805520698302)],- n = 11},- koData =- ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("hour", -0.916290731874155),- ("part of days", -0.916290731874155)],- n = 1}}),- ("tomorrow",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh(:mm) - <time-of-day> am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("this|last|next <cycle>",- Classifier{okData =- ClassData{prior = -0.15822400521489416,- unseen = -4.394449154672439,- likelihoods =- HashMap.fromList- [("week", -1.5488132906176655),- ("month (grain)", -2.995732273553991),- ("year (grain)", -1.817077277212345),- ("week (grain)", -1.5488132906176655),- ("quarter", -2.772588722239781), ("year", -1.817077277212345),- ("month", -2.995732273553991),- ("quarter (grain)", -2.772588722239781)],- n = 35},- koData =- ClassData{prior = -1.9218125974762528,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("week", -1.4816045409242156),- ("week (grain)", -1.4816045409242156),- ("day", -1.9924301646902063),- ("day (grain)", -1.9924301646902063)],- n = 6}}),- ("Mother's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Eve",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("by <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -2.1972245773362196),- ("end of month", -2.1972245773362196),- ("time-of-day (latent)", -2.1972245773362196),- ("<time-of-day> am|pm", -2.1972245773362196),- ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),- ("month", -2.1972245773362196), ("minute", -1.791759469228055)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [], n = 0}}),- ("half an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.2006706954621511,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("ordinals (first..twentieth,thirtieth,...)",- -1.7047480922384253),- ("ordinal (digits)", -0.2006706954621511)],- n = 9},- koData =- ClassData{prior = -1.7047480922384253,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],- n = 2}}),- ("last weekend of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("October", -0.9555114450274363), ("July", -1.8718021769015913),- ("month", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (number)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("fractional number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),- ("Sunday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("February",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods = HashMap.fromList [("", 0.0)], n = 13},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("minute (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1}}),- ("time-of-day (latent)",- Classifier{okData =- ClassData{prior = -0.5363047090669756, unseen = -4.174387269895637,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.1158318155251217),- ("integer (0..19)", -2.2129729343043585)],- n = 62},- koData =- ClassData{prior = -0.8792494601938059,- unseen = -3.8501476017100584,- likelihoods =- HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)],- n = 44}}),- ("year",- Classifier{okData =- ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 34},- koData =- ClassData{prior = -1.6582280766035324,- unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 8}}),- ("last <day-of-week> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("daymonth", -0.916290731874155),- ("SundayMarch", -1.6094379124341003),- ("MondayMarch", -1.6094379124341003),- ("Sundayintersect", -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.7444404749474959, unseen = -4.605170185988091,- likelihoods =- HashMap.fromList- [("week", -2.3978952727983707),- ("integer (0..19)year (grain)", -3.2088254890146994),- ("integer (numeric)day (grain)", -2.515678308454754),- ("integer (0..19)second (grain) ", -3.9019726695746444),- ("integer (0..19)hour (grain)", -2.803360380906535),- ("second", -3.9019726695746444),- ("integer (numeric)year (grain)", -3.9019726695746444),- ("day", -2.515678308454754), ("year", -2.9856819377004897),- ("integer (numeric)week (grain)", -2.9856819377004897),- ("integer (0..19)month (grain)", -3.4965075614664802),- ("hour", -2.515678308454754), ("month", -3.4965075614664802),- ("integer (numeric)minute (grain)", -2.9856819377004897),- ("integer (0..19)minute (grain)", -2.803360380906535),- ("minute", -2.2925347571405443),- ("integer (numeric)hour (grain)", -3.4965075614664802),- ("integer (0..19)week (grain)", -2.9856819377004897)],- n = 38},- koData =- ClassData{prior = -0.6443570163905132, unseen = -4.68213122712422,- likelihoods =- HashMap.fromList- [("week", -2.8810693652338513),- ("integer (0..19)year (grain)", -3.5742165457937967),- ("integer (numeric)day (grain)", -3.2865344733420154),- ("integer (0..19)second (grain) ", -3.5742165457937967),- ("integer (0..19)hour (grain)", -3.5742165457937967),- ("second", -3.0633909220278057),- ("integer (numeric)second (grain) ", -3.5742165457937967),- ("integer (numeric)year (grain)", -3.5742165457937967),- ("day", -2.7269186854065928), ("quarter", -3.979681653901961),- ("year", -3.0633909220278057),- ("integer (numeric)week (grain)", -3.2865344733420154),- ("integer (0..19)month (grain)", -3.5742165457937967),- ("hour", -1.9647786333596962), ("month", -3.0633909220278057),- ("integer (numeric)minute (grain)", -3.5742165457937967),- ("integer (0..19)minute (grain)", -3.5742165457937967),- ("integer (numeric)month (grain)", -3.5742165457937967),- ("minute", -3.0633909220278057),- ("integer (numeric)hour (grain)", -2.1078794770003695),- ("integer (0..19)day (grain)", -3.2865344733420154),- ("integer (0..19)week (grain)", -3.5742165457937967),- ("integer (0..19)quarter (grain)", -3.979681653901961)],- n = 42}}),- ("hhmm (latent)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> am|pm",- Classifier{okData =- ClassData{prior = -0.2847365622220242, unseen = -5.231108616854587,- likelihoods =- HashMap.fromList- [("integer after|past <hour-of-day>", -3.8394523125933104),- ("at <time-of-day>", -2.2300144001592104),- ("<time-of-day> o'clock", -4.127134385045092),- ("half after|past <hour-of-day>", -4.127134385045092),- ("time-of-day (latent)", -1.7600107709134747),- ("hhmm (latent)", -4.532599493153256),- ("hh:mm", -2.181224235989778),- ("quarter after|past <hour-of-day>", -4.532599493153256),- ("about|exactly <time-of-day>", -4.532599493153256),- ("until <time-of-day>", -3.8394523125933104),- ("hour", -1.2939210409888755),- ("<time-of-day> sharp|exactly", -4.532599493153256),- ("minute", -1.6422277352570913),- ("after <time-of-day>", -4.532599493153256)],- n = 85},- koData =- ClassData{prior = -1.3951833085371366, unseen = -4.290459441148391,- likelihoods =- HashMap.fromList- [("<integer> to|till|before <hour-of-day>", -3.1780538303479458),- ("<hour-of-day> <integer>", -3.58351893845611),- ("time-of-day (latent)", -1.0577902941478545),- ("hour", -1.0185695809945732), ("minute", -2.890371757896165),- ("after <time-of-day>", -3.58351893845611)],- n = 28}}),- ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("ordinal (digits)ordinal (digits)July", -1.252762968495368),- ("integer (numeric)integer (numeric)July", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thanksgiving Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("a <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.5753641449035618,- unseen = -3.4965075614664802,- likelihoods =- HashMap.fromList- [("week", -2.0794415416798357),- ("year (grain)", -2.772588722239781),- ("second", -2.772588722239781),- ("week (grain)", -2.0794415416798357),- ("day", -2.0794415416798357),- ("minute (grain)", -2.772588722239781),- ("year", -2.772588722239781),- ("second (grain) ", -2.772588722239781),- ("minute", -2.772588722239781),- ("day (grain)", -2.0794415416798357)],- n = 9},- koData =- ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("hour (grain)", -1.7227665977411035),- ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),- ("quarter (grain)", -1.9459101490553135)],- n = 7}}),- ("hh:mm",- Classifier{okData =- ClassData{prior = -5.406722127027582e-2,- unseen = -4.02535169073515,- likelihoods = HashMap.fromList [("", 0.0)], n = 54},- koData =- ClassData{prior = -2.9444389791664407,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("quarter of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("second (grain) ",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinals (first..twentieth,thirtieth,...)",- Classifier{okData =- ClassData{prior = -6.899287148695143e-2,- unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14},- koData =- ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("quarter after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> after|before <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.252762968495368),- ("dayday", -0.8472978603872037),- ("day (grain)yesterday", -1.252762968495368)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("about|exactly <time-of-day>",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("week", -2.639057329615259),- ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),- ("this|last|next <cycle>", -2.639057329615259),- ("day", -2.2335922215070942),- ("time-of-day (latent)", -2.639057329615259),- ("hhmm (latent)", -2.2335922215070942),- ("<time-of-day> am|pm", -2.639057329615259),- ("hour", -1.9459101490553135),- ("next <time>", -2.639057329615259),- ("this|next <day-of-week>", -2.639057329615259),- ("minute", -2.2335922215070942)],- n = 8},- koData =- ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),- ("time-of-day (latent)", -2.0794415416798357),- ("hour", -2.0794415416798357)],- n = 2}}),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- Classifier{okData =- ClassData{prior = -0.48130318449966897,- unseen = -5.170483995038151,- likelihoods =- HashMap.fromList- [("Wednesday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayhour", -3.2188758248682006),- ("daymonth", -3.2188758248682006),- ("<named-month> <day-of-month> (non ordinal)Friday",- -4.471638793363569),- ("Friday<named-month> <day-of-month> (non ordinal)",- -3.7784916128036232),- ("Wednesdayintersect", -4.471638793363569),- ("Labor Daythis|last|next <cycle>", -4.471638793363569),- ("black fridaythis|last|next <cycle>", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.471638793363569),- ("<part-of-day> of <time>February", -4.471638793363569),- ("Saturday<time-of-day> am|pm", -4.471638793363569),- ("Martin Luther King's Daythis|last|next <cycle>",- -4.471638793363569),- ("on <date><time-of-day> am|pm", -4.471638793363569),- ("hourmonth", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.471638793363569),- ("dayday", -2.5998366164619773),- ("the <day-of-month> (ordinal)February", -4.0661736852554045),- ("WednesdayOctober", -4.471638793363569),- ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.5553480614894135),- ("dayyear", -2.8622008809294686),- ("Saturday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.471638793363569),- ("Thursdayhh:mm", -4.0661736852554045),- ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),- ("Memorial Daythis|last|next <cycle>", -4.471638793363569),- ("on <date><named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("TuesdayOctober", -4.471638793363569),- ("the <day-of-month> (ordinal)March", -4.471638793363569),- ("Mondaythis|last|next <cycle>", -4.471638793363569),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.0661736852554045),- ("Fridayintersect", -4.471638793363569),- ("Thursday<datetime> - <datetime> (interval)",- -3.7784916128036232),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.5553480614894135),- ("Tuesdaythis|last|next <cycle>", -4.471638793363569),- ("Sunday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayminute", -2.6798793241355137),- ("intersectyear", -4.471638793363569),- ("minuteday", -3.5553480614894135),- ("this|last|next <cycle>Sunday", -4.471638793363569),- ("Sundaythis|last|next <cycle>", -4.471638793363569),- ("intersectintersect", -4.471638793363569),- ("weekday", -4.471638793363569),- ("dayweek", -3.373026504695459),- ("Thursday<time-of-day> am|pm", -4.471638793363569),- ("Monday<named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("<named-month> <day-of-month> (non ordinal)year",- -4.0661736852554045)],- n = 55},- koData =- ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,- likelihoods =- HashMap.fromList- [("week-endJuly", -4.197201947661808),- ("week-endOctober", -3.5040547671018634),- ("daymonth", -1.9999773703255892),- ("TuesdaySeptember", -4.197201947661808),- ("Wednesdayintersect", -4.197201947661808),- ("hourmonth", -3.0985896589936988),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.197201947661808),- ("Fridaythis|last|next <cycle>", -4.197201947661808),- ("SundayFebruary", -4.197201947661808),- ("WednesdayOctober", -4.197201947661808),- ("week-endintersect", -4.197201947661808),- ("dayyear", -4.197201947661808),- ("FridayJuly", -3.791736839553644),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.197201947661808),- ("FridaySeptember", -4.197201947661808),- ("WednesdayFebruary", -4.197201947661808),- ("minutemonth", -3.2809112157876537),- ("SundayMarch", -4.197201947661808),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.197201947661808),- ("MondayFebruary", -3.791736839553644),- ("Fridayintersect", -4.197201947661808),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.791736839553644),- ("dayminute", -2.810907586541918),- ("SaturdaySeptember", -4.197201947661808),- ("intersectSeptember", -3.2809112157876537),- ("MondayMarch", -4.197201947661808),- ("on <date>September", -3.791736839553644),- ("intersectintersect", -4.197201947661808),- ("Tuesdayintersect", -4.197201947661808),- ("Sundayintersect", -4.197201947661808)],- n = 34}}),- ("last <time>",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("Father's Day", -2.6741486494265287),- ("Martin Luther King's Day", -2.6741486494265287),- ("Memorial Day", -2.6741486494265287),- ("Mother's Day", -2.6741486494265287),- ("day", -1.2878542883066382), ("Sunday", -2.6741486494265287),- ("Thanksgiving Day", -2.6741486494265287),- ("hour", -2.6741486494265287), ("Tuesday", -2.6741486494265287),- ("week-end", -2.6741486494265287)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("intersect", -3.0204248861443626),- ("Monday", -3.0204248861443626), ("day", -2.1041341542702074),- ("Sunday", -3.0204248861443626),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.7676619176489945),- ("hour", -1.3156767939059373),- ("week-end", -1.9218125974762528)],- n = 14}}),- ("March",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<named-month>|<named-day> <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.11778303565638351,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("Octoberordinal (digits)", -2.0794415416798357),- ("Thursdayordinal (digits)", -2.4849066497880004),- ("day", -2.0794415416798357),- ("Augustordinal (digits)", -2.4849066497880004),- ("Marchordinals (first..twentieth,thirtieth,...)",- -2.0794415416798357),- ("Tuesdayordinal (digits)", -2.4849066497880004),- ("month", -1.2321436812926323),- ("Marchordinal (digits)", -2.4849066497880004)],- n = 8},- koData =- ClassData{prior = -2.1972245773362196,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Augustordinal (digits)", -1.6094379124341003),- ("month", -1.6094379124341003)],- n = 1}}),- ("Labor Day weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Christmas",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("until <time-of-day>",- Classifier{okData =- ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -2.3025850929940455),- ("<time-of-day> am|pm", -1.6094379124341003),- ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),- ("minute", -1.3862943611198906)],- n = 6},- koData =- ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("intersect", -1.7227665977411035),- ("yesterday", -2.2335922215070942),- ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),- ("hour", -2.639057329615259), ("minute", -1.252762968495368)],- n = 10}}),- ("<duration> after|before|from <time>",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("a <unit-of-duration>now", -2.70805020110221),- ("a <unit-of-duration>Christmas", -2.70805020110221),- ("<integer> <unit-of-duration>today", -2.70805020110221),- ("daysecond", -2.70805020110221),- ("a <unit-of-duration>right now", -2.70805020110221),- ("minutenograin", -2.70805020110221),- ("<integer> <unit-of-duration>Christmas", -2.70805020110221),- ("secondnograin", -2.70805020110221),- ("yearday", -2.0149030205422647),- ("daynograin", -2.70805020110221),- ("<integer> <unit-of-duration>now", -2.3025850929940455)],- n = 7},- koData =- ClassData{prior = -1.2039728043259361,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("dayhour", -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal)",- -2.3978952727983707),- ("dayday", -1.9924301646902063),- ("<integer> <unit-of-duration>time-of-day (latent)",- -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -2.3978952727983707)],- n = 3}}),- ("Independence Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("decimal number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("next <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5263605246161616,- likelihoods =- HashMap.fromList- [("Martin Luther King's Day", -2.803360380906535),- ("Halloween", -2.803360380906535),- ("Wednesday", -2.803360380906535),- ("Memorial Day", -2.803360380906535),- ("Monday", -2.803360380906535),- ("Mother's Day", -2.803360380906535),- ("day", -1.0986122886681098),- ("Thanksgiving Day", -2.803360380906535),- ("March", -2.803360380906535), ("month", -2.803360380906535),- ("Tuesday", -2.1102132003465894)],- n = 11},- koData =- ClassData{prior = -infinity, unseen = -2.4849066497880004,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> sharp|exactly",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -2.1400661634962708),- ("time-of-day (latent)", -2.1400661634962708),- ("hhmm (latent)", -2.1400661634962708),- ("<time-of-day> am|pm", -2.1400661634962708),- ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),- ("minute", -1.4469189829363254)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day Weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("negative numbers",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 24}}),- ("about|exactly <duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("half an hour", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time> before last|after next",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("Wednesday", -1.8718021769015913),- ("Friday", -1.466337068793427), ("day", -1.1786549963416462),- ("March", -1.8718021769015913), ("month", -1.8718021769015913)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("by the end of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("this|last|next <cycle>", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hhmm (military) am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -0.48550781578170077,- unseen = -3.891820298110627,- likelihoods =- HashMap.fromList- [("minuteminute", -1.4733057381095205),- ("hh:mmhh:mm", -1.6739764335716716),- ("dayday", -2.772588722239781),- ("hourhour", -2.2617630984737906),- ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -3.1780538303479458),- ("<time-of-day> am|pm<time-of-day> am|pm",- -2.4849066497880004)],- n = 16},- koData =- ClassData{prior = -0.9555114450274363,- unseen = -3.6109179126442243,- likelihoods =- HashMap.fromList- [("<named-month> <day-of-month> (non ordinal)July",- -2.890371757896165),- ("daymonth", -2.4849066497880004),- ("<time-of-day> am|pmintersect", -2.890371757896165),- ("hh:mm<time-of-day> am|pm", -2.4849066497880004),- ("minuteminute", -1.9740810260220096),- ("hourhour", -2.4849066497880004),- ("minutehour", -2.4849066497880004),- ("hh:mmintersect", -1.9740810260220096),- ("<named-month> <day-of-month> (non ordinal)August",- -2.890371757896165),- ("about|exactly <time-of-day><time-of-day> am|pm",- -2.890371757896165)],- n = 10}}),- ("Tuesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Day",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),- ("fortnight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> and an half hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <named-month>",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -1.252762968495368), ("March", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -0.8472978603872037),- ("month", -0.8472978603872037)],- n = 2}}),- ("<time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.8873031950009028,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("minuteminute", -1.5163474893680884),- ("hh:mmhh:mm", -1.5163474893680884),- ("<time-of-day> am|pmtime-of-day (latent)", -2.327277705584417),- ("hourhour", -1.7676619176489945),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.327277705584417)],- n = 14},- koData =- ClassData{prior = -0.5306282510621704,- unseen = -3.9889840465642745,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>time-of-day (latent)",- -3.2771447329921766),- ("hh:mmtime-of-day (latent)", -1.5723966407537513),- ("hh:mm<time-of-day> am|pm", -2.871679624884012),- ("<time-of-day> am|pmtime-of-day (latent)",- -3.2771447329921766),- ("at <time-of-day><time-of-day> am|pm", -3.2771447329921766),- ("hourhour", -2.0243817644968085),- ("minutehour", -1.262241712449912),- ("about|exactly <time-of-day><time-of-day> am|pm",- -3.2771447329921766),- ("at <time-of-day>time-of-day (latent)", -2.871679624884012),- ("<integer> to|till|before <hour-of-day>time-of-day (latent)",- -2.871679624884012)],- n = 20}}),- ("nth <time> after <time>",- Classifier{okData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -0.916290731874155)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",- -0.916290731874155)],- n = 1}}),- ("<named-month> <day-of-month> (non ordinal)",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.9318256327243257,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.5257286443082556),- ("Marchinteger (numeric)", -2.8134107167600364),- ("Aprilinteger (numeric)", -3.2188758248682006),- ("month", -0.8209805520698302),- ("Februaryinteger (numeric)", -1.9661128563728327),- ("Septemberinteger (numeric)", -2.8134107167600364),- ("Octoberinteger (numeric)", -2.8134107167600364),- ("Julyinteger (numeric)", -2.120263536200091)],- n = 21},- koData =- ClassData{prior = -1.2039728043259361, unseen = -3.295836866004329,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.159484249353372),- ("Marchinteger (numeric)", -2.5649493574615367),- ("Aprilinteger (numeric)", -2.5649493574615367),- ("month", -0.9555114450274363),- ("Julyinteger (numeric)", -1.466337068793427)],- n = 9}}),- ("this|next <day-of-week>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods =- HashMap.fromList- [("Thursday", -2.2512917986064953),- ("Wednesday", -2.2512917986064953),- ("Monday", -1.845826690498331), ("day", -0.8649974374866046),- ("Tuesday", -1.55814461804655)],- n = 7},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinal (digits)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5553480614894135,- likelihoods = HashMap.fromList [("", 0.0)], n = 33},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter (grain)",- Classifier{okData =- ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("last <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("day (grain)October", -1.791759469228055),- ("daymonth", -1.2809338454620642),- ("day (grain)intersect", -1.791759469228055),- ("weekmonth", -1.791759469228055),- ("week (grain)intersect", -2.1972245773362196),- ("week (grain)September", -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("seasons",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month>(ordinal) <named-month> year",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)April", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Labor Day",- Classifier{okData =- ClassData{prior = -0.2876820724517809,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -1.3862943611198906,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("week-end",- Classifier{okData =- ClassData{prior = -1.5040773967762742,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.25131442828090605,- unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),- ("after <time-of-day>",- Classifier{okData =- ClassData{prior = -1.6094379124341003,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hour", -1.2992829841302609)],- n = 2},- koData =- ClassData{prior = -0.2231435513142097,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("intersect", -2.03688192726104),- ("tomorrow", -2.03688192726104), ("day", -1.3437347467010947),- ("time-of-day (latent)", -2.4423470353692043),- ("<time-of-day> am|pm", -2.4423470353692043),- ("Christmas", -2.03688192726104), ("hour", -1.749199854809259)],- n = 8}}),- ("day (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.2188758248682006,- likelihoods = HashMap.fromList [("", 0.0)], n = 23},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("black friday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("right now",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("for <duration> from <time>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("<integer> <unit-of-duration><day-of-month> (ordinal)",- -1.5040773967762742),- ("dayday", -1.0986122886681098),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -1.5040773967762742)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("dayhour", -1.252762968495368),- ("<integer> <unit-of-duration>time-of-day (latent)",- -1.252762968495368)],- n = 1}}),- ("between <time> and <time>",- Classifier{okData =- ClassData{prior = -1.0986122886681098,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("minuteminute", -1.0116009116784799),- ("hh:mmhh:mm", -1.0116009116784799)],- n = 3},- koData =- ClassData{prior = -0.40546510810816444,- unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.4469189829363254),- ("minuteminute", -1.4469189829363254),- ("minutehour", -1.4469189829363254),- ("hh:mmintersect", -1.4469189829363254)],- n = 6}}),- ("<month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.2992829841302609),- ("Augustordinal (digits)integer (numeric)",- -1.9924301646902063),- ("month", -0.7884573603642702),- ("Augustordinal (digits)ordinal (digits)",- -1.9924301646902063)],- n = 9},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of days",- Classifier{okData =- ClassData{prior = -4.0821994520255166e-2,- unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("", 0.0)], n = 24},- koData =- ClassData{prior = -3.2188758248682006,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("dd-dd <month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)September",- -1.791759469228055),- ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),- ("ordinal (digits)ordinal (digits)October",- -2.1972245773362196),- ("integer (numeric)integer (numeric)July", -2.1972245773362196),- ("month", -0.9444616088408514),- ("ordinal (digits)ordinal (digits)August",- -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("this <time>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("Thursday", -2.6026896854443837),- ("Martin Luther King's Day", -2.6026896854443837),- ("intersect", -2.6026896854443837),- ("Monday", -2.6026896854443837), ("day", -1.2163953243244932),- ("Thanksgiving Day", -2.6026896854443837),- ("hour", -2.1972245773362196), ("seasons", -1.9095425048844386),- ("week-end", -2.6026896854443837)],- n = 9},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("intersect", -1.7047480922384253),- ("day", -1.7047480922384253)],- n = 1}}),+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.824549292051046),+ ("<time-of-day> am|pm", -1.6422277352570913),+ ("hh:mm", -1.824549292051046), ("hour", -1.1314021114911006),+ ("minute", -1.824549292051046)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.7765287894989963, unseen = -5.225746673713201,+ likelihoods = HashMap.fromList [("", 0.0)], n = 184},+ koData =+ ClassData{prior = -0.616186139423817, unseen = -5.384495062789089,+ likelihoods = HashMap.fromList [("", 0.0)], n = 216}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.784189633918261,+ likelihoods =+ HashMap.fromList+ [("week", -1.563975538357343), ("day", -1.8152899666382492),+ ("year", -2.662587827025453),+ ("<integer> <unit-of-duration>", -1.0531499145913523),+ ("a <unit-of-duration>", -2.662587827025453),+ ("month", -2.662587827025453),+ ("fortnight", -2.662587827025453)],+ n = 18},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("noon|midnight|EOD|end of day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter to|till|before <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.6094379124341003),+ ("dayday", -1.0986122886681098),+ ("day (grain)yesterday", -1.6094379124341003)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.466337068793427),+ ("year (grain)Christmas", -1.8718021769015913),+ ("day (grain)intersect", -1.466337068793427),+ ("yearday", -1.8718021769015913)],+ n = 3}}),+ ("Martin Luther King's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("mm/yyyy",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("integer after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("hour", -0.8109302162163288),+ ("integer (numeric)time-of-day (latent)", -1.0986122886681098),+ ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)December", -2.1400661634962708),+ ("ordinal (digits)February", -2.1400661634962708),+ ("integer (numeric)April", -2.1400661634962708),+ ("month", -1.4469189829363254)],+ n = 3},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)October", -2.6741486494265287),+ ("ordinal (digits)July", -2.6741486494265287),+ ("integer (numeric)September", -2.268683541318364),+ ("ordinal (digits)August", -2.6741486494265287),+ ("integer (numeric)August", -2.6741486494265287),+ ("ordinal (digits)April", -2.6741486494265287),+ ("month", -1.0647107369924282),+ ("integer (numeric)July", -2.268683541318364)],+ n = 9}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -9.844007281325252e-2,+ unseen = -4.430816798843313,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("dayhour", -1.5284688499004333),+ ("Mondayearly morning", -3.3202283191284883),+ ("time-of-day (latent)tonight", -3.3202283191284883),+ ("hourhour", -2.339399066116762),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -3.7256934272366524),+ ("todaypart of days", -3.7256934272366524),+ ("minutehour", -2.627081138568543),+ ("at <time-of-day>in|during the <part-of-day>",+ -3.3202283191284883),+ ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),+ ("Mondayin|during the <part-of-day>", -3.7256934272366524),+ ("intersectpart of days", -3.7256934272366524),+ ("intersectin|during the <part-of-day>", -3.7256934272366524),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -3.7256934272366524),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("tomorrowpart of days", -2.339399066116762),+ ("hh:mmin|during the <part-of-day>", -3.0325462466767075),+ ("time-of-day (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("hhmm (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("yesterdaypart of days", -3.7256934272366524),+ ("Mondaypart of days", -3.7256934272366524)],+ n = 29},+ koData =+ ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("yearhour", -2.740840023925201),+ ("monthhour", -2.740840023925201),+ ("hourhour", -2.740840023925201),+ ("past year (latent)in|during the <part-of-day>",+ -2.740840023925201),+ ("Februaryin|during the <part-of-day>", -2.740840023925201),+ ("time-of-day (latent)in|during the <part-of-day>",+ -2.740840023925201)],+ n = 3}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd",+ Classifier{okData =+ ClassData{prior = -1.4271163556401458,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -9.381875521765486e-2,+ unseen = -4.90527477843843,+ likelihoods =+ HashMap.fromList+ [("<time> timezone", -3.7992275112828016),+ ("noon|midnight|EOD|end of day", -3.7992275112828016),+ ("integer after|past <hour-of-day>", -3.7992275112828016),+ ("half after|past <hour-of-day>", -4.204692619390966),+ ("time-of-day (latent)", -1.7197859696029658),+ ("hhmm (latent)", -3.5115454388310208),+ ("<time-of-day> am|pm", -1.8067973465925955),+ ("hh:mm", -3.288401887516811),+ ("about|exactly <time-of-day>", -3.7992275112828016),+ ("hour", -1.0911773101805915),+ ("<time-of-day> sharp|exactly", -4.204692619390966),+ ("minute", -2.0074680420547466)],+ n = 61},+ koData =+ ClassData{prior = -2.412933150162911, unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.2321436812926323),+ ("hour", -1.2321436812926323)],+ n = 6}}),+ ("December",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("on <date>", -2.1972245773362196),+ ("Wednesday", -2.6026896854443837),+ ("Saturday", -2.6026896854443837),+ ("Monday", -2.1972245773362196),+ ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),+ ("Sunday", -2.6026896854443837)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last|past|next <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("week", -2.456735772821304), ("second", -2.639057329615259),+ ("day", -2.3025850929940455), ("year", -2.639057329615259),+ ("<integer> <unit-of-duration>", -0.7827593392496325),+ ("hour", -2.639057329615259), ("month", -2.639057329615259),+ ("minute", -2.639057329615259)],+ n = 31},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the ides of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,+ likelihoods =+ HashMap.fromList+ [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),+ ("absorption of , after named day", -2.890371757896165),+ ("intersect", -2.890371757896165),+ ("Saturday", -2.6026896854443837),+ ("Friday", -3.295836866004329), ("day", -0.8979415932059586),+ ("the <day-of-month> (ordinal)", -2.890371757896165),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.6026896854443837),+ ("hour", -3.295836866004329)],+ n = 22},+ koData =+ ClassData{prior = -1.8718021769015913,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.791759469228055), ("day", -1.2809338454620642),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -1.791759469228055)],+ n = 4}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.784189633918261,+ likelihoods = HashMap.fromList [("", 0.0)], n = 42},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -0.916290731874155),+ ("hh:mmhh:mm", -0.916290731874155)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -0.916290731874155),+ ("minutehour", -0.916290731874155)],+ n = 3}}),+ ("Halloween",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),+ ("Augustordinal (digits)integer (numeric)",+ -1.6094379124341003),+ ("month", -0.916290731874155),+ ("Augustordinal (digits)ordinal (digits)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from|since|after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("July", -3.3141860046725258),+ ("time-of-day (latent)", -2.3978952727983707),+ ("<time-of-day> am|pm", -2.3978952727983707),+ ("hh:mm", -2.3978952727983707), ("hour", -1.8101086078962516),+ ("month", -2.908720896564361), ("minute", -2.3978952727983707),+ ("August", -3.3141860046725258)],+ n = 14},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -4.836281906951478,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.7297014486341915),+ ("week", -4.135166556742356),+ ("<day-of-month> (ordinal or number) <named-month>",+ -4.135166556742356),+ ("today", -4.135166556742356),+ ("intersect", -2.7488721956224653),+ ("second", -4.135166556742356), ("now", -3.4420193761824103),+ ("tomorrow", -3.7297014486341915),+ ("this|last|next <cycle>", -4.135166556742356),+ ("day", -1.995100393246085),+ ("time-of-day (latent)", -4.135166556742356),+ ("<time-of-day> am|pm", -3.7297014486341915),+ ("nograin", -3.4420193761824103),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ -4.135166556742356),+ ("Christmas", -3.4420193761824103),+ ("hour", -2.8824035882469876),+ ("<datetime> - <datetime> (interval)", -2.7488721956224653),+ ("<time-of-day> - <time-of-day> (interval)",+ -2.430418464503931),+ ("<named-month> <day-of-month> (non ordinal)",+ -3.7297014486341915),+ ("minute", -1.6928195213731514),+ ("right now", -4.135166556742356),+ ("<month> dd-dd (interval)", -3.4420193761824103),+ ("dd-dd <month> (interval)", -3.7297014486341915)],+ n = 49}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> more <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)minute (grain)", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in|within|after <duration>",+ Classifier{okData =+ ClassData{prior = -4.652001563489282e-2,+ unseen = -4.61512051684126,+ likelihoods =+ HashMap.fromList+ [("week", -3.2188758248682006),+ ("<integer> more <unit-of-duration>", -3.912023005428146),+ ("three-quarters of an hour", -2.995732273553991),+ ("<integer> + '\"", -3.2188758248682006),+ ("number.number hours", -3.912023005428146),+ ("second", -3.506557897319982), ("day", -3.2188758248682006),+ ("half an hour", -2.995732273553991),+ ("<integer> <unit-of-duration>", -1.6094379124341003),+ ("a <unit-of-duration>", -2.995732273553991),+ ("quarter of an hour", -2.995732273553991),+ ("hour", -2.5257286443082556),+ ("about|exactly <duration>", -3.912023005428146),+ ("<integer> and an half hour", -3.912023005428146),+ ("minute", -1.2729656758128873)],+ n = 42},+ koData =+ ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("quarter", -1.8971199848858813),+ ("<integer> <unit-of-duration>", -2.3025850929940455),+ ("a <unit-of-duration>", -2.3025850929940455)],+ n = 2}}),+ ("three-quarters of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half <integer> (UK style hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -0.8209805520698302,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -1.1786549963416462),+ ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",+ -1.466337068793427),+ ("quarter", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.8109302162163288),+ ("quarter", -0.8109302162163288)],+ n = 3}}),+ ("one twenty two",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.4957877464014501, unseen = -6.293419278846481,+ likelihoods =+ HashMap.fromList+ [("<datetime> - <datetime> (interval)on <date>",+ -4.345658990503007),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -4.345658990503007),+ ("hourday", -3.8936738667599493),+ ("dayhour", -2.765208614942159),+ ("daymonth", -4.90527477843843),+ ("monthday", -5.19295685089021),+ ("monthyear", -3.9889840465642745),+ ("Tuesdaythe <day-of-month> (ordinal)", -5.598421958998375),+ ("Christmasyear", -5.598421958998375),+ ("from <datetime> - <datetime> (interval)July",+ -5.598421958998375),+ ("houryear", -5.598421958998375),+ ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.90527477843843),+ ("<time-of-day> am|pmintersect", -4.345658990503007),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -5.598421958998375),+ ("Marchyear", -5.598421958998375),+ ("<named-month>|<named-day> <day-of-month> (ordinal)year",+ -5.19295685089021),+ ("intersect<time-of-day> am|pm", -5.598421958998375),+ ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.598421958998375),+ ("monthhour", -5.19295685089021),+ ("last <day-of-week> of <time>year", -5.598421958998375),+ ("todayat <time-of-day>", -5.598421958998375),+ ("Thursday<time> timezone", -3.8936738667599493),+ ("this <time>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("dayday", -3.58351893845611),+ ("Thanksgiving Dayyear", -4.499809670330265),+ ("<time> <part-of-day>at <time-of-day>", -5.598421958998375),+ ("Tuesdayin <named-month>", -5.598421958998375),+ ("mm/ddat <time-of-day>", -5.598421958998375),+ ("tonightat <time-of-day>", -5.598421958998375),+ ("<time-of-day> am|pmabsorption of , after named day",+ -4.90527477843843),+ ("today<time-of-day> am|pm", -5.598421958998375),+ ("Februarythe <day-of-month> (ordinal)", -5.19295685089021),+ ("at <time-of-day><time> <part-of-day>", -5.598421958998375),+ ("mm/dd<time-of-day> am|pm", -5.598421958998375),+ ("hourhour", -4.345658990503007),+ ("<time-of-day> am|pmon <date>", -3.58351893845611),+ ("Wednesdaythis|last|next <cycle>", -5.598421958998375),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -4.0943445622221),+ ("dayyear", -3.1560749236291703),+ ("last weekend of <named-month>year", -5.598421958998375),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -5.598421958998375),+ ("Thursdayat <time-of-day>", -5.19295685089021),+ ("<time-of-day> am|pmtomorrow", -4.90527477843843),+ ("minutehour", -4.68213122712422),+ ("Mother's Dayyear", -5.598421958998375),+ ("at <time-of-day>in|during the <part-of-day>",+ -5.19295685089021),+ ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",+ -3.8936738667599493),+ ("for <duration> from <time>December", -5.598421958998375),+ ("tomorrow<time-of-day> sharp|exactly", -5.598421958998375),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -5.19295685089021),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.68213122712422),+ ("Mondayin|during the <part-of-day>", -5.598421958998375),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.19295685089021),+ ("intersectin|during the <part-of-day>", -5.598421958998375),+ ("Thursday<datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -5.598421958998375),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.345658990503007),+ ("from <time-of-day> - <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -4.68213122712422),+ ("at <time-of-day>intersect", -5.19295685089021),+ ("<time-of-day> - <time-of-day> (interval)tomorrow",+ -5.598421958998375),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.598421958998375),+ ("dayminute", -2.924273309571846),+ ("from <datetime> - <datetime> (interval)on <date>",+ -5.19295685089021),+ ("<datetime> - <datetime> (interval)tomorrow",+ -5.598421958998375),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.19295685089021),+ ("<ordinal> <cycle> of <time>year", -5.598421958998375),+ ("minuteday", -2.132686056198648),+ ("absorption of , after named dayintersect",+ -5.598421958998375),+ ("Octoberyear", -4.345658990503007),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -5.598421958998375),+ ("at <time-of-day>absorption of , after named day",+ -5.598421958998375),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -5.598421958998375),+ ("year<time-of-day> am|pm", -5.598421958998375),+ ("Septemberyear", -5.19295685089021),+ ("at <time-of-day>on <date>", -4.499809670330265),+ ("between <time-of-day> and <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("Halloweenyear", -5.598421958998375),+ ("dayweek", -5.598421958998375),+ ("Thursday<time-of-day> am|pm", -5.598421958998375),+ ("weekyear", -5.19295685089021),+ ("hh:mmin|during the <part-of-day>", -4.90527477843843),+ ("Father's Dayyear", -5.598421958998375),+ ("<cycle> after|before <time><time-of-day> am|pm",+ -5.19295685089021),+ ("February<time> <part-of-day>", -5.598421958998375),+ ("Martin Luther King's Dayyear", -5.19295685089021),+ ("tomorrowat <time-of-day>", -4.90527477843843),+ ("between <time> and <time>on <date>", -4.90527477843843),+ ("Thursdayfrom|since|after <time-of-day>", -4.90527477843843),+ ("at <time-of-day>tomorrow", -5.19295685089021),+ ("tomorrow<time-of-day> am|pm", -5.598421958998375),+ ("in|during the <part-of-day>at <time-of-day>",+ -5.598421958998375),+ ("Labor Dayyear", -5.598421958998375),+ ("Februaryintersect", -5.598421958998375),+ ("last <cycle> of <time>year", -4.90527477843843),+ ("<named-month> <day-of-month> (non ordinal)year",+ -5.598421958998375),+ ("yearminute", -5.598421958998375),+ ("Black Fridayyear", -5.19295685089021)],+ n = 201},+ koData =+ ClassData{prior = -0.9392802500988537, unseen = -5.983936280687191,+ likelihoods =+ HashMap.fromList+ [("in <named-month>year", -5.288267030694535),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -5.288267030694535),+ ("hourday", -5.288267030694535),+ ("<named-month> <day-of-month> (non ordinal)July",+ -5.288267030694535),+ ("dayhour", -2.890371757896165),+ ("daymonth", -3.2088254890146994),+ ("monthday", -4.882801922586371),+ ("monthyear", -4.59511985013459),+ ("intersecthh:mm", -5.288267030694535),+ ("from <datetime> - <datetime> (interval)July",+ -5.288267030694535),+ ("houryear", -5.288267030694535),+ ("from <time-of-day> - <time-of-day> (interval)July",+ -5.288267030694535),+ ("until <time-of-day><time-of-day> am|pm", -5.288267030694535),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.59511985013459),+ ("<time-of-day> am|pmintersect", -4.035504062199167),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.37197629882038),+ ("from|since|after <time-of-day>on <date>", -4.37197629882038),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("absorption of , after named dayJuly", -4.882801922586371),+ ("monthhour", -5.288267030694535),+ ("hourmonth", -4.59511985013459),+ ("todayat <time-of-day>", -5.288267030694535),+ ("from|since|after <time-of-day>July", -5.288267030694535),+ ("dayday", -4.882801922586371),+ ("mm/ddat <time-of-day>", -4.882801922586371),+ ("<time-of-day> am|pmon <date>", -4.035504062199167),+ ("dayyear", -4.035504062199167),+ ("Thursdaymm/dd", -5.288267030694535),+ ("Thursdayat <time-of-day>", -4.035504062199167),+ ("<integer> to|till|before <hour-of-day>September",+ -5.288267030694535),+ ("monthminute", -5.288267030694535),+ ("<time-of-day> am|pmtomorrow", -5.288267030694535),+ ("Thursdayhh:mm", -4.37197629882038),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("Fridayyear", -4.882801922586371),+ ("minutemonth", -3.4965075614664802),+ ("Sundayfrom|since|after <time-of-day>", -5.288267030694535),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.882801922586371),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("Aprilyear", -5.288267030694535),+ ("mm/dd<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.288267030694535),+ ("<duration> after|before|from <time>December",+ -5.288267030694535),+ ("yesterday<time-of-day> am|pm", -5.288267030694535),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -4.37197629882038),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("<named-month> <day-of-month> (non ordinal)August",+ -5.288267030694535),+ ("until <time-of-day>on <date>", -4.59511985013459),+ ("at <time-of-day>intersect", -4.882801922586371),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("dayminute", -2.7625383863862796),+ ("intersectSeptember", -3.784189633918261),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("minuteday", -2.3704962986102562),+ ("absorption of , after named dayintersect",+ -5.288267030694535),+ ("Februaryin|during the <part-of-day>", -5.288267030694535),+ ("week-endin <named-month>", -5.288267030694535),+ ("Octoberyear", -5.288267030694535),+ ("from|since|after <time-of-day>year", -5.288267030694535),+ ("yearhh:mm", -5.288267030694535),+ ("hh:mmon <date>", -3.784189633918261),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -5.288267030694535),+ ("absorption of , after named daySeptember", -4.37197629882038),+ ("on <date>September", -4.882801922586371),+ ("at <time-of-day>on <date>", -4.882801922586371),+ ("dayweek", -5.288267030694535),+ ("Thursday<time-of-day> am|pm", -4.882801922586371),+ ("absorption of , after named dayFebruary", -4.37197629882038),+ ("July<integer> to|till|before <hour-of-day>",+ -5.288267030694535),+ ("tomorrowat <time-of-day>", -5.288267030694535),+ ("<integer> to|till|before <hour-of-day>July",+ -5.288267030694535),+ ("Thursdayfrom|since|after <time-of-day>", -3.6788291182604347),+ ("tomorrow<time-of-day> am|pm", -5.288267030694535),+ ("Tuesdayfrom|since|after <time-of-day>", -5.288267030694535),+ ("yearminute", -5.288267030694535)],+ n = 129}}),+ ("one eleven",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("after lunch/work/school",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("early morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <number> (implicit minutes)",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.3184537311185346),+ ("integer (0..19)", -1.2992829841302609)],+ n = 9},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.16251892949777494),+ ("integer (0..19)", -1.8971199848858813)],+ n = 18}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.0149030205422647),+ ("quarteryear", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)day (grain)October",+ -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",+ -2.0149030205422647),+ ("weekmonth", -1.6094379124341003),+ ("ordinal (digits)quarter (grain)year", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)October",+ -2.0149030205422647)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods = HashMap.fromList [("", 0.0)], n = 21},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -1.0116009116784799,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -2.001480000210124),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("hh:mmhh:mm", -2.001480000210124),+ ("dayday", -2.512305623976115),+ ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),+ ("hourhour", -2.512305623976115),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],+ n = 8},+ koData =+ ClassData{prior = -0.45198512374305727,+ unseen = -3.912023005428146,+ likelihoods =+ HashMap.fromList+ [("hourday", -3.1986731175506815),+ ("dayhour", -2.793208009442517),+ ("<day-of-month> (ordinal)time-of-day (latent)",+ -3.1986731175506815),+ ("hh:mmtime-of-day (latent)", -2.2823823856765264),+ ("minuteminute", -2.793208009442517),+ ("time-of-day (latent)time-of-day (latent)",+ -2.793208009442517),+ ("dayday", -3.1986731175506815),+ ("hourhour", -2.505525936990736),+ ("dayyear", -3.1986731175506815),+ ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",+ -3.1986731175506815),+ ("minutehour", -2.2823823856765264),+ ("hh:mmintersect", -2.793208009442517),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("time-of-day (latent)<time-of-day> am|pm",+ -3.1986731175506815),+ ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",+ -3.1986731175506815)],+ n = 14}}),+ ("Saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",+ -1.7346010553881064),+ ("weekmonth", -1.7346010553881064),+ ("week (grain)October", -1.7346010553881064),+ ("week (grain)<named-month> <day-of-month> (non ordinal)",+ -1.7346010553881064),+ ("weekday", -1.2237754316221157)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number.number hours",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.6094379124341003),+ ("hh:mmhh:mm", -1.6094379124341003),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),+ ("hourhour", -2.3025850929940455),+ ("hourminute", -2.3025850929940455),+ ("time-of-day (latent)<time-of-day> sharp|exactly",+ -2.70805020110221),+ ("time-of-day (latent)hh:mm", -2.70805020110221),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],+ n = 9},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.6094379124341003),+ ("time-of-day (latent)time-of-day (latent)",+ -2.0149030205422647),+ ("hourhour", -1.791759469228055),+ ("minutehour", -1.6094379124341003),+ ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],+ n = 9}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)", -0.6931471805599453),+ ("integer (20..90)integer (0..19)", -0.6931471805599453)],+ n = 4}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("Monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (20..90)", -1.3862943611198906),+ ("hour", -0.9808292530117262),+ ("at <time-of-day>integer (numeric)", -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>integer (numeric)",+ -1.0986122886681098),+ ("hour", -1.0986122886681098)],+ n = 1}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.9808292530117262),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -2.0794415416798357),+ ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",+ -1.6739764335716716),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0986122886681098),+ ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",+ -1.791759469228055),+ ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",+ -1.3862943611198906)],+ n = 3}}),+ ("Valentine's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("end of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = -8.004270767353637e-2,+ unseen = -3.6375861597263857,+ likelihoods = HashMap.fromList [("", 0.0)], n = 36},+ koData =+ ClassData{prior = -2.5649493574615367,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",+ -1.6094379124341003),+ ("hourday", -0.916290731874155),+ ("part of daysthe <day-of-month> (ordinal)",+ -1.6094379124341003),+ ("part of daysthe <day-of-month> (number)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("past year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 2}}),+ ("six thirty six a.m.",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.252762968495368),+ ("one twenty two", -0.8472978603872037),+ ("one eleven", -1.252762968495368)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.9459101490553135,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -2.3513752571634776),+ ("ordinals (first..twentieth,thirtieth,...)March",+ -2.3513752571634776),+ ("ordinal (digits)February", -2.3513752571634776),+ ("integer (numeric)February", -1.9459101490553135),+ ("month", -0.9650808960435872),+ ("ordinal (digits)March", -2.3513752571634776),+ ("integer (numeric)July", -2.3513752571634776)],+ n = 7},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)February", -1.5040773967762742),+ ("month", -1.5040773967762742)],+ n = 1}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Friday",+ Classifier{okData =+ ClassData{prior = -0.3677247801253174,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("in|during the <part-of-day>",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("early morning", -2.5257286443082556),+ ("hour", -0.7339691750802004),+ ("part of days", -0.8209805520698302)],+ n = 11},+ koData =+ ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("hour", -0.916290731874155),+ ("part of days", -0.916290731874155)],+ n = 1}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh(:mm) - <time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last|next <cycle>",+ Classifier{okData =+ ClassData{prior = -0.15822400521489416,+ unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("week", -1.5488132906176655),+ ("month (grain)", -2.995732273553991),+ ("year (grain)", -1.817077277212345),+ ("week (grain)", -1.5488132906176655),+ ("quarter", -2.772588722239781), ("year", -1.817077277212345),+ ("month", -2.995732273553991),+ ("quarter (grain)", -2.772588722239781)],+ n = 35},+ koData =+ ClassData{prior = -1.9218125974762528,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("week", -1.4816045409242156),+ ("week (grain)", -1.4816045409242156),+ ("day", -1.9924301646902063),+ ("day (grain)", -1.9924301646902063)],+ n = 6}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -2.1972245773362196),+ ("end of month", -2.1972245773362196),+ ("time-of-day (latent)", -2.1972245773362196),+ ("<time-of-day> am|pm", -2.1972245773362196),+ ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),+ ("month", -2.1972245773362196), ("minute", -1.791759469228055)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2006706954621511,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..twentieth,thirtieth,...)",+ -1.7047480922384253),+ ("ordinal (digits)", -0.2006706954621511)],+ n = 9},+ koData =+ ClassData{prior = -1.7047480922384253,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],+ n = 2}}),+ ("last weekend of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("October", -0.9555114450274363), ("July", -1.8718021769015913),+ ("month", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (number)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),+ ("Sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.5315058290035293,+ unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.12136085700426748),+ ("integer (0..19)", -2.3025850929940455)],+ n = 67},+ koData =+ ClassData{prior = -0.8860508466844369,+ unseen = -3.9318256327243257,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.10536051565782628),+ ("integer (0..19)", -2.8134107167600364),+ ("integer 21..99", -3.2188758248682006)],+ n = 47}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.23483959107740107, unseen = -3.58351893845611,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 34},+ koData =+ ClassData{prior = -1.563975538357343, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 9}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("SundayMarch", -1.6094379124341003),+ ("MondayMarch", -1.6094379124341003),+ ("Sundayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.1479201300766222,+ unseen = -5.0875963352323845,+ likelihoods =+ HashMap.fromList+ [("week", -2.4423470353692043),+ ("integer (0..19)year (grain)", -3.289644895756408),+ ("integer (numeric)day (grain)", -2.6835090921860925),+ ("integer (0..19)second (grain) ", -3.6951100038645723),+ ("integer (0..19)hour (grain)", -3.001962823304627),+ ("second", -3.289644895756408),+ ("integer (numeric)second (grain) ", -3.982792076316353),+ ("integer (numeric)year (grain)", -3.6951100038645723),+ ("day", -2.4423470353692043), ("year", -2.8841797876482436),+ ("integer (numeric)week (grain)", -3.001962823304627),+ ("integer (0..19)month (grain)", -3.4719664525503626),+ ("hour", -2.5964977151964628), ("month", -3.1354942159291497),+ ("integer (numeric)minute (grain)", -3.1354942159291497),+ ("integer (0..19)minute (grain)", -3.001962823304627),+ ("integer (numeric)month (grain)", -3.982792076316353),+ ("minute", -2.4423470353692043),+ ("integer (numeric)hour (grain)", -3.4719664525503626),+ ("integer (0..19)day (grain)", -3.6951100038645723),+ ("integer (0..19)week (grain)", -3.1354942159291497)],+ n = 69},+ koData =+ ClassData{prior = -1.984131361875511, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("quarter", -3.1135153092103742), ("hour", -1.4087672169719492),+ ("integer (numeric)hour (grain)", -1.4087672169719492),+ ("integer (0..19)quarter (grain)", -3.1135153092103742)],+ n = 11}}),+ ("hhmm (latent)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = -0.2929871246814741,+ unseen = -5.3230099791384085,+ likelihoods =+ HashMap.fromList+ [("integer after|past <hour-of-day>", -3.9318256327243257),+ ("at <time-of-day>", -2.2270775404859005),+ ("from|since|after <time-of-day>", -3.708682081410116),+ ("<time-of-day> o'clock", -4.219507705176107),+ ("half after|past <hour-of-day>", -4.219507705176107),+ ("time-of-day (latent)", -1.7346010553881064),+ ("hhmm (latent)", -4.624972813284271),+ ("hh:mm", -2.2735975561207935),+ ("quarter after|past <hour-of-day>", -4.624972813284271),+ ("about|exactly <time-of-day>", -4.624972813284271),+ ("until <time-of-day>", -3.9318256327243257),+ ("hour", -1.2237754316221157),+ ("<time-of-day> sharp|exactly", -4.624972813284271),+ ("minute", -1.7346010553881064)],+ n = 94},+ koData =+ ClassData{prior = -1.3705460041517514, unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.283414346005772),+ ("from|since|after <time-of-day>", -3.283414346005772),+ ("<hour-of-day> <integer>", -3.6888794541139363),+ ("time-of-day (latent)", -1.0498221244986778),+ ("hour", -1.0147308046874075), ("minute", -2.772588722239781)],+ n = 32}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)ordinal (digits)July", -1.252762968495368),+ ("integer (numeric)integer (numeric)July", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thanksgiving Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("a <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.5753641449035618,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("week", -2.0794415416798357),+ ("year (grain)", -2.772588722239781),+ ("second", -2.772588722239781),+ ("week (grain)", -2.0794415416798357),+ ("day", -2.0794415416798357),+ ("minute (grain)", -2.772588722239781),+ ("year", -2.772588722239781),+ ("second (grain) ", -2.772588722239781),+ ("minute", -2.772588722239781),+ ("day (grain)", -2.0794415416798357)],+ n = 9},+ koData =+ ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -1.7227665977411035),+ ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),+ ("quarter (grain)", -1.9459101490553135)],+ n = 7}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -6.782259633876106e-2,+ unseen = -4.07753744390572,+ likelihoods = HashMap.fromList [("", 0.0)], n = 57},+ koData =+ ClassData{prior = -2.7245795030534206, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (first..twentieth,thirtieth,...)",+ Classifier{okData =+ ClassData{prior = -6.899287148695143e-2,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14},+ koData =+ ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("quarter after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.252762968495368),+ ("dayday", -0.8472978603872037),+ ("day (grain)yesterday", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("week", -2.639057329615259),+ ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),+ ("this|last|next <cycle>", -2.639057329615259),+ ("day", -2.2335922215070942),+ ("time-of-day (latent)", -2.639057329615259),+ ("hhmm (latent)", -2.2335922215070942),+ ("<time-of-day> am|pm", -2.639057329615259),+ ("hour", -1.9459101490553135),+ ("next <time>", -2.639057329615259),+ ("this|next <day-of-week>", -2.639057329615259),+ ("minute", -2.2335922215070942)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),+ ("time-of-day (latent)", -2.0794415416798357),+ ("hour", -2.0794415416798357)],+ n = 2}}),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ Classifier{okData =+ ClassData{prior = -0.48130318449966897,+ unseen = -5.170483995038151,+ likelihoods =+ HashMap.fromList+ [("Wednesday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayhour", -3.2188758248682006),+ ("daymonth", -3.2188758248682006),+ ("<named-month> <day-of-month> (non ordinal)Friday",+ -4.471638793363569),+ ("Friday<named-month> <day-of-month> (non ordinal)",+ -3.7784916128036232),+ ("Wednesdayintersect", -4.471638793363569),+ ("Labor Daythis|last|next <cycle>", -4.471638793363569),+ ("Black Fridaythis|last|next <cycle>", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.471638793363569),+ ("<part-of-day> of <time>February", -4.471638793363569),+ ("Saturday<time-of-day> am|pm", -4.471638793363569),+ ("Martin Luther King's Daythis|last|next <cycle>",+ -4.471638793363569),+ ("on <date><time-of-day> am|pm", -4.471638793363569),+ ("hourmonth", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.471638793363569),+ ("dayday", -2.5998366164619773),+ ("the <day-of-month> (ordinal)February", -4.0661736852554045),+ ("WednesdayOctober", -4.471638793363569),+ ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -3.5553480614894135),+ ("dayyear", -2.8622008809294686),+ ("Saturday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.471638793363569),+ ("Thursdayhh:mm", -4.0661736852554045),+ ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),+ ("Memorial Daythis|last|next <cycle>", -4.471638793363569),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("TuesdayOctober", -4.471638793363569),+ ("the <day-of-month> (ordinal)March", -4.471638793363569),+ ("Mondaythis|last|next <cycle>", -4.471638793363569),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.0661736852554045),+ ("Fridayintersect", -4.471638793363569),+ ("Thursday<datetime> - <datetime> (interval)",+ -3.7784916128036232),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.5553480614894135),+ ("Tuesdaythis|last|next <cycle>", -4.471638793363569),+ ("Sunday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayminute", -2.6798793241355137),+ ("intersectyear", -4.471638793363569),+ ("minuteday", -3.5553480614894135),+ ("this|last|next <cycle>Sunday", -4.471638793363569),+ ("Sundaythis|last|next <cycle>", -4.471638793363569),+ ("intersectintersect", -4.471638793363569),+ ("weekday", -4.471638793363569),+ ("dayweek", -3.373026504695459),+ ("Thursday<time-of-day> am|pm", -4.471638793363569),+ ("Monday<named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("<named-month> <day-of-month> (non ordinal)year",+ -4.0661736852554045)],+ n = 55},+ koData =+ ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,+ likelihoods =+ HashMap.fromList+ [("week-endJuly", -4.197201947661808),+ ("week-endOctober", -3.5040547671018634),+ ("daymonth", -1.9999773703255892),+ ("TuesdaySeptember", -4.197201947661808),+ ("Wednesdayintersect", -4.197201947661808),+ ("hourmonth", -3.0985896589936988),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.197201947661808),+ ("Fridaythis|last|next <cycle>", -4.197201947661808),+ ("SundayFebruary", -4.197201947661808),+ ("WednesdayOctober", -4.197201947661808),+ ("week-endintersect", -4.197201947661808),+ ("dayyear", -4.197201947661808),+ ("FridayJuly", -3.791736839553644),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.197201947661808),+ ("FridaySeptember", -4.197201947661808),+ ("WednesdayFebruary", -4.197201947661808),+ ("minutemonth", -3.2809112157876537),+ ("SundayMarch", -4.197201947661808),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.197201947661808),+ ("MondayFebruary", -3.791736839553644),+ ("Fridayintersect", -4.197201947661808),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.791736839553644),+ ("dayminute", -2.810907586541918),+ ("SaturdaySeptember", -4.197201947661808),+ ("intersectSeptember", -3.2809112157876537),+ ("MondayMarch", -4.197201947661808),+ ("on <date>September", -3.791736839553644),+ ("intersectintersect", -4.197201947661808),+ ("Tuesdayintersect", -4.197201947661808),+ ("Sundayintersect", -4.197201947661808)],+ n = 34}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -0.6286086594223742, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("Father's Day", -2.6026896854443837),+ ("Martin Luther King's Day", -2.6026896854443837),+ ("Memorial Day", -2.6026896854443837),+ ("Mother's Day", -2.6026896854443837),+ ("day", -1.2163953243244932), ("Sunday", -2.6026896854443837),+ ("Thanksgiving Day", -2.6026896854443837),+ ("hour", -2.6026896854443837), ("Tuesday", -2.6026896854443837),+ ("week-end", -2.6026896854443837)],+ n = 8},+ koData =+ ClassData{prior = -0.7621400520468967, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Monday", -2.5257286443082556), ("day", -2.120263536200091),+ ("Sunday", -2.5257286443082556), ("hour", -1.4271163556401458),+ ("week-end", -1.4271163556401458)],+ n = 7}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Octoberordinal (digits)", -2.120263536200091),+ ("Thursdayordinal (digits)", -2.5257286443082556),+ ("day", -2.120263536200091),+ ("Augustordinal (digits)", -2.5257286443082556),+ ("Marchordinals (first..twentieth,thirtieth,...)",+ -2.120263536200091),+ ("Tuesdayordinal (digits)", -2.5257286443082556),+ ("month", -1.2729656758128873),+ ("Marchordinal (digits)", -2.5257286443082556)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("from|since|after <time-of-day>ordinal (digits)",+ -1.8718021769015913),+ ("Augustordinal (digits)", -1.8718021769015913),+ ("month", -1.466337068793427)],+ n = 2}}),+ ("Labor Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -2.3025850929940455),+ ("<time-of-day> am|pm", -1.6094379124341003),+ ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),+ ("minute", -1.3862943611198906)],+ n = 6},+ koData =+ ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.7227665977411035),+ ("yesterday", -2.2335922215070942),+ ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),+ ("hour", -2.639057329615259), ("minute", -1.252762968495368)],+ n = 10}}),+ ("mm.dd.yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after|before|from <time>",+ Classifier{okData =+ ClassData{prior = -0.35667494393873245,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("a <unit-of-duration>now", -2.70805020110221),+ ("a <unit-of-duration>Christmas", -2.70805020110221),+ ("<integer> <unit-of-duration>today", -2.70805020110221),+ ("daysecond", -2.70805020110221),+ ("a <unit-of-duration>right now", -2.70805020110221),+ ("minutenograin", -2.70805020110221),+ ("<integer> <unit-of-duration>Christmas", -2.70805020110221),+ ("secondnograin", -2.70805020110221),+ ("yearday", -2.0149030205422647),+ ("daynograin", -2.70805020110221),+ ("<integer> <unit-of-duration>now", -2.3025850929940455)],+ n = 7},+ koData =+ ClassData{prior = -1.2039728043259361,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -2.3978952727983707),+ ("dayday", -1.9924301646902063),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -2.3978952727983707)],+ n = 3}}),+ ("Independence Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("Martin Luther King's Day", -2.803360380906535),+ ("Halloween", -2.803360380906535),+ ("Wednesday", -2.803360380906535),+ ("Memorial Day", -2.803360380906535),+ ("Monday", -2.803360380906535),+ ("Mother's Day", -2.803360380906535),+ ("day", -1.0986122886681098),+ ("Thanksgiving Day", -2.803360380906535),+ ("March", -2.803360380906535), ("month", -2.803360380906535),+ ("Tuesday", -2.1102132003465894)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> sharp|exactly",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.1400661634962708),+ ("time-of-day (latent)", -2.1400661634962708),+ ("hhmm (latent)", -2.1400661634962708),+ ("<time-of-day> am|pm", -2.1400661634962708),+ ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),+ ("minute", -1.4469189829363254)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -7.696104113612832e-2),+ ("integer (0..19)", -2.6026896854443837)],+ n = 25}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("half an hour", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> before last|after next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("Wednesday", -1.8718021769015913),+ ("Friday", -1.466337068793427), ("day", -1.1786549963416462),+ ("March", -1.8718021769015913), ("month", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("this|last|next <cycle>", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hhmm (military) am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.3794896217049037, unseen = -4.304065093204169,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -3.1918471524802814),+ ("intersect<time-of-day> am|pm", -3.1918471524802814),+ ("minuteminute", -1.457246097092175),+ ("hh:mmhh:mm", -2.093234863812172),+ ("dayday", -3.1918471524802814),+ ("hourhour", -2.093234863812172),+ ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -3.597312260588446),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.597312260588446),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.681021528714291),+ ("from|since|after <time-of-day>hh:mm", -2.681021528714291)],+ n = 26},+ koData =+ ClassData{prior = -1.1526795099383855, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -3.1135153092103742),+ ("daymonth", -2.70805020110221),+ ("from|since|after <time-of-day>intersect", -2.70805020110221),+ ("<time-of-day> am|pmintersect", -3.1135153092103742),+ ("hh:mm<time-of-day> am|pm", -2.70805020110221),+ ("minuteminute", -1.8607523407150064),+ ("hourhour", -2.70805020110221),+ ("minutehour", -2.70805020110221),+ ("hh:mmintersect", -2.1972245773362196),+ ("<named-month> <day-of-month> (non ordinal)August",+ -3.1135153092103742),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.1135153092103742)],+ n = 12}}),+ ("Tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Day",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("fortnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> and an half hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <named-month>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -1.252762968495368), ("March", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -0.8472978603872037),+ ("month", -0.8472978603872037)],+ n = 2}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.7375989431307791, unseen = -4.110873864173311,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.529395204760564),+ ("hh:mmhh:mm", -1.8971199848858813),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -2.4849066497880004),+ ("hourhour", -1.6964492894237302),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -3.4011973816621555),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.4011973816621555),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.4849066497880004),+ ("from|since|after <time-of-day>hh:mm", -2.4849066497880004)],+ n = 22},+ koData =+ ClassData{prior = -0.6505875661411494, unseen = -4.174387269895637,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>time-of-day (latent)",+ -3.4657359027997265),+ ("hh:mmtime-of-day (latent)", -1.7609878105613013),+ ("hh:mm<time-of-day> am|pm", -3.0602707946915624),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -3.4657359027997265),+ ("at <time-of-day><time-of-day> am|pm", -3.4657359027997265),+ ("hourhour", -2.2129729343043585),+ ("minutehour", -1.2144441041932315),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.4657359027997265),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -2.5494451709255714),+ ("at <time-of-day>time-of-day (latent)", -3.0602707946915624),+ ("<integer> to|till|before <hour-of-day>time-of-day (latent)",+ -3.0602707946915624)],+ n = 24}}),+ ("military spelled out numbers am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods =+ HashMap.fromList [("integer (0..19)integer (20..90)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",+ -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -0.42121346507630353,+ unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.5455312716044354),+ ("Marchinteger (numeric)", -2.833213344056216),+ ("Aprilinteger (numeric)", -3.2386784521643803),+ ("month", -0.8407831793660099),+ ("Februaryinteger (numeric)", -1.9859154836690123),+ ("Septemberinteger (numeric)", -2.833213344056216),+ ("Octoberinteger (numeric)", -2.833213344056216),+ ("Julyinteger (numeric)", -2.1400661634962708)],+ n = 21},+ koData =+ ClassData{prior = -1.067840630001356, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.3353749158170367),+ ("Marchinteger (numeric)", -2.740840023925201),+ ("Aprilinteger (numeric)", -2.740840023925201),+ ("month", -0.9490805546971459),+ ("from|since|after <time-of-day>integer (numeric)",+ -2.3353749158170367),+ ("Julyinteger (numeric)", -1.6422277352570913)],+ n = 11}}),+ ("this|next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.2512917986064953),+ ("Wednesday", -2.2512917986064953),+ ("Monday", -1.845826690498331), ("day", -0.8649974374866046),+ ("Tuesday", -1.55814461804655)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5553480614894135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 33},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.791759469228055),+ ("daymonth", -1.2809338454620642),+ ("day (grain)intersect", -1.791759469228055),+ ("weekmonth", -1.791759469228055),+ ("week (grain)intersect", -2.1972245773362196),+ ("week (grain)September", -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)April", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Black Friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Labor Day",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("right now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -1.5040773967762742),+ ("dayday", -1.0986122886681098),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -1.5040773967762742)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.252762968495368),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -1.252762968495368)],+ n = 1}}),+ ("between <time> and <time>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0116009116784799),+ ("hh:mmhh:mm", -1.0116009116784799)],+ n = 3},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.4469189829363254),+ ("minuteminute", -1.4469189829363254),+ ("minutehour", -1.4469189829363254),+ ("hh:mmintersect", -1.4469189829363254)],+ n = 6}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6422277352570913),+ ("from|since|after <time-of-day>ordinal (digits)ordinal (digits)",+ -2.740840023925201),+ ("from|since|after <time-of-day>integer (numeric)integer (numeric)",+ -2.740840023925201),+ ("from|since|after <time-of-day>ordinal (digits)integer (numeric)",+ -2.740840023925201),+ ("Augustordinal (digits)integer (numeric)",+ -2.3353749158170367),+ ("month", -0.8690378470236094),+ ("Augustordinal (digits)ordinal (digits)",+ -2.3353749158170367)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of days",+ Classifier{okData =+ ClassData{prior = -4.0821994520255166e-2,+ unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -3.2188758248682006,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)September",+ -1.791759469228055),+ ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),+ ("ordinal (digits)ordinal (digits)October",+ -2.1972245773362196),+ ("integer (numeric)integer (numeric)July", -2.1972245773362196),+ ("month", -0.9444616088408514),+ ("ordinal (digits)ordinal (digits)August",+ -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.5257286443082556),+ ("Martin Luther King's Day", -2.5257286443082556),+ ("Monday", -2.5257286443082556), ("day", -1.1394342831883648),+ ("Thanksgiving Day", -2.5257286443082556),+ ("hour", -2.5257286443082556), ("winter", -2.5257286443082556),+ ("week-end", -2.5257286443082556),+ ("summer", -2.120263536200091)],+ n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [], n = 0}}), ("August", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357,
Duckling/Ranking/Classifiers/EN_GB.hs view
@@ -40,2299 +40,2369 @@ n = 7}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hh:mm", -1.7047480922384253), ("hour", -1.2992829841302609),- ("minute", -1.7047480922384253)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thursday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods = HashMap.fromList [("", 0.0)], n = 18},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (numeric)",- Classifier{okData =- ClassData{prior = -0.7740538191727457, unseen = -5.19295685089021,- likelihoods = HashMap.fromList [("", 0.0)], n = 178},- koData =- ClassData{prior = -0.6182992897635128,- unseen = -5.3471075307174685,- likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),- ("<duration> hence|ago",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.784189633918261,- likelihoods =- HashMap.fromList- [("week", -1.563975538357343), ("day", -1.8152899666382492),- ("year", -2.662587827025453),- ("<integer> <unit-of-duration>", -1.0531499145913523),- ("a <unit-of-duration>", -2.662587827025453),- ("month", -2.662587827025453),- ("fortnight", -2.662587827025453)],- n = 18},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("noon|midnight|EOD|end of day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter to|till|before <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Father's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<cycle> after|before <time>",- Classifier{okData =- ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.6094379124341003),- ("dayday", -1.0986122886681098),- ("day (grain)yesterday", -1.6094379124341003)],- n = 4},- koData =- ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("dayhour", -1.466337068793427),- ("year (grain)Christmas", -1.8718021769015913),- ("day (grain)intersect", -1.466337068793427),- ("yearday", -1.8718021769015913)],- n = 3}}),- ("Martin Luther King's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (20..90)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/yyyy",- Classifier{okData =- ClassData{prior = -1.0986122886681098,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -0.40546510810816444,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),- ("integer after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("hour", -0.8109302162163288),- ("integer (numeric)time-of-day (latent)", -1.0986122886681098),- ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal or number) <named-month>",- Classifier{okData =- ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("ordinal (digits)December", -2.1400661634962708),- ("ordinal (digits)February", -2.1400661634962708),- ("integer (numeric)April", -2.1400661634962708),- ("month", -1.4469189829363254)],- n = 3},- koData =- ClassData{prior = -0.2876820724517809,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("ordinal (digits)October", -2.6741486494265287),- ("ordinal (digits)July", -2.6741486494265287),- ("integer (numeric)September", -2.268683541318364),- ("ordinal (digits)August", -2.6741486494265287),- ("integer (numeric)August", -2.6741486494265287),- ("ordinal (digits)April", -2.6741486494265287),- ("month", -1.0647107369924282),- ("integer (numeric)July", -2.268683541318364)],- n = 9}}),- ("<time> <part-of-day>",- Classifier{okData =- ClassData{prior = -9.844007281325252e-2,- unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("<day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("dayhour", -1.5284688499004333),- ("Mondayearly morning", -3.3202283191284883),- ("time-of-day (latent)tonight", -3.3202283191284883),- ("hourhour", -2.339399066116762),- ("<time-of-day> o'clockin|during the <part-of-day>",- -3.7256934272366524),- ("todaypart of days", -3.7256934272366524),- ("minutehour", -2.627081138568543),- ("at <time-of-day>in|during the <part-of-day>",- -3.3202283191284883),- ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),- ("Mondayin|during the <part-of-day>", -3.7256934272366524),- ("intersectpart of days", -3.7256934272366524),- ("intersectin|during the <part-of-day>", -3.7256934272366524),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -3.7256934272366524),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("tomorrowpart of days", -2.339399066116762),- ("hh:mmin|during the <part-of-day>", -3.0325462466767075),- ("time-of-day (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("hhmm (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("yesterdaypart of days", -3.7256934272366524),- ("Mondaypart of days", -3.7256934272366524)],- n = 29},- koData =- ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,- likelihoods =- HashMap.fromList- [("yearhour", -2.740840023925201),- ("monthhour", -2.740840023925201),- ("hourhour", -2.740840023925201),- ("past year (latent)in|during the <part-of-day>",- -2.740840023925201),- ("Februaryin|during the <part-of-day>", -2.740840023925201),- ("time-of-day (latent)in|during the <part-of-day>",- -2.740840023925201)],- n = 3}}),- ("dd/mm",- Classifier{okData =- ClassData{prior = -1.3437347467010947,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -0.3022808718729337,- unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),- ("today",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("at <time-of-day>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -4.787491742782046,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -3.6805112044434196),- ("integer after|past <hour-of-day>", -3.6805112044434196),- ("half after|past <hour-of-day>", -4.085976312551584),- ("time-of-day (latent)", -1.7346010553881064),- ("hhmm (latent)", -3.392829131991639),- ("<time-of-day> am|pm", -1.7833912195575383),- ("hh:mm", -3.169685580677429),- ("about|exactly <time-of-day>", -3.6805112044434196),- ("hour", -1.1415373333851437),- ("<time-of-day> sharp|exactly", -4.085976312551584),- ("minute", -1.8887517352153647)],- n = 54},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.1895840668738362),- ("hour", -1.1895840668738362)],- n = 6}}),- ("December",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("absorption of , after named day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("on <date>", -2.1972245773362196),- ("Wednesday", -2.6026896854443837),- ("Saturday", -2.6026896854443837),- ("Monday", -2.1972245773362196),- ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),- ("Sunday", -2.6026896854443837)],- n = 10},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("September",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("tonight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the ides of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("on <date>",- Classifier{okData =- ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,- likelihoods =- HashMap.fromList- [("Thursday", -1.791759469228055), ("dd/mm", -3.295836866004329),- ("absorption of , after named day", -2.890371757896165),- ("intersect", -2.890371757896165),- ("Saturday", -2.6026896854443837),- ("Friday", -3.295836866004329), ("day", -0.8979415932059586),- ("the <day-of-month> (ordinal)", -2.890371757896165),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -2.6026896854443837),- ("hour", -3.295836866004329)],- n = 22},- koData =- ClassData{prior = -1.8718021769015913,- unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("intersect", -1.791759469228055), ("day", -1.2809338454620642),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.791759469228055)],- n = 4}}),- ("integer (0..19)",- Classifier{okData =- ClassData{prior = -2.409755157906053e-2,- unseen = -3.7612001156935624,- likelihoods = HashMap.fromList [("", 0.0)], n = 41},- koData =- ClassData{prior = -3.7376696182833684,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("between <time-of-day> and <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("minuteminute", -0.916290731874155),- ("hh:mmhh:mm", -0.916290731874155)],- n = 3},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -0.916290731874155),- ("minutehour", -0.916290731874155)],- n = 3}}),- ("Halloween",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),- ("Augustordinal (digits)integer (numeric)",- -1.6094379124341003),- ("month", -0.916290731874155),- ("Augustordinal (digits)ordinal (digits)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("October",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("month (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> more <unit-of-duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("integer (numeric)minute (grain)", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> o'clock",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("in|within|after <duration>",- Classifier{okData =- ClassData{prior = -4.652001563489282e-2,- unseen = -4.61512051684126,- likelihoods =- HashMap.fromList- [("week", -3.2188758248682006),- ("<integer> more <unit-of-duration>", -3.912023005428146),- ("three-quarters of an hour", -2.995732273553991),- ("<integer> + '\"", -3.2188758248682006),- ("number.number hours", -3.912023005428146),- ("second", -3.506557897319982), ("day", -3.2188758248682006),- ("half an hour", -2.995732273553991),- ("<integer> <unit-of-duration>", -1.6094379124341003),- ("a <unit-of-duration>", -2.995732273553991),- ("quarter of an hour", -2.995732273553991),- ("hour", -2.5257286443082556),- ("about|exactly <duration>", -3.912023005428146),- ("<integer> and an half hour", -3.912023005428146),- ("minute", -1.2729656758128873)],- n = 42},- koData =- ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("quarter", -1.8971199848858813),- ("<integer> <unit-of-duration>", -2.3025850929940455),- ("a <unit-of-duration>", -2.3025850929940455)],- n = 2}}),- ("three-quarters of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Wednesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> + '\"",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half <integer> (UK style hour-of-day)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("July",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hour (grain)",- Classifier{okData =- ClassData{prior = -0.8209805520698302,- unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),- ("<ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -1.1786549963416462),- ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",- -1.466337068793427),- ("quarter", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.8109302162163288),- ("quarter", -0.8109302162163288)],- n = 3}}),- ("one twenty two",- Classifier{okData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)", -0.5108256237659907),- ("integer (0..19)integer (20..90)", -0.916290731874155)],- n = 3}}),- ("intersect",- Classifier{okData =- ClassData{prior = -0.45983651189029134,- unseen = -6.1675164908883415,- likelihoods =- HashMap.fromList- [("<datetime> - <datetime> (interval)on <date>",- -4.55597994179732),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.55597994179732),- ("hourday", -3.7675225814330493),- ("dayhour", -3.2209788750649797),- ("daymonth", -4.77912349311153),- ("monthday", -5.06680556556331),- ("monthyear", -3.862832761237374),- ("Tuesdaythe <day-of-month> (ordinal)", -5.472270673671475),- ("Christmasyear", -5.472270673671475),- ("from <datetime> - <datetime> (interval)July",- -5.472270673671475),- ("houryear", -5.472270673671475),- ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",- -5.472270673671475),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.77912349311153),- ("<time-of-day> am|pmintersect", -4.219507705176107),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -5.472270673671475),- ("Marchyear", -5.472270673671475),- ("<named-month>|<named-day> <day-of-month> (ordinal)year",- -5.06680556556331),- ("intersect<time-of-day> am|pm", -5.472270673671475),- ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.472270673671475),- ("monthhour", -5.06680556556331),- ("last <day-of-week> of <time>year", -5.472270673671475),- ("todayat <time-of-day>", -5.472270673671475),- ("Thursday<time> timezone", -5.06680556556331),- ("dd/mm<time-of-day> am|pm", -5.472270673671475),- ("this <time>hh(:mm) - <time-of-day> am|pm",- -5.472270673671475),- ("dayday", -3.45736765312921),- ("Thanksgiving Dayyear", -4.373658385003365),- ("dd/mmat <time-of-day>", -5.472270673671475),- ("<time> <part-of-day>at <time-of-day>", -5.472270673671475),- ("Tuesdayin <named-month>", -5.472270673671475),- ("tonightat <time-of-day>", -5.472270673671475),- ("<time-of-day> am|pmabsorption of , after named day",- -4.77912349311153),- ("today<time-of-day> am|pm", -5.472270673671475),- ("Februarythe <day-of-month> (ordinal)", -5.06680556556331),- ("at <time-of-day><time> <part-of-day>", -5.472270673671475),- ("hourhour", -4.219507705176107),- ("<time-of-day> am|pmon <date>", -3.45736765312921),- ("Wednesdaythis|last|next <cycle>", -5.472270673671475),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.968193276895201),- ("dayyear", -3.0299236383022703),- ("last weekend of <named-month>year", -5.472270673671475),- ("<time-of-day> o'clockin|during the <part-of-day>",- -5.472270673671475),- ("<time-of-day> am|pmtomorrow", -4.77912349311153),- ("minutehour", -4.55597994179732),- ("Mother's Dayyear", -5.472270673671475),- ("at <time-of-day>in|during the <part-of-day>",- -5.06680556556331),- ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -3.7675225814330493),- ("for <duration> from <time>December", -5.472270673671475),- ("tomorrow<time-of-day> sharp|exactly", -5.472270673671475),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.55597994179732),- ("on <date><named-month> <day-of-month> (non ordinal)",- -5.06680556556331),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.55597994179732),- ("Mondayin|during the <part-of-day>", -5.472270673671475),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.06680556556331),- ("intersectin|during the <part-of-day>", -5.472270673671475),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -5.472270673671475),- ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.77912349311153),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -4.55597994179732),- ("at <time-of-day>intersect", -5.06680556556331),- ("<time-of-day> - <time-of-day> (interval)tomorrow",- -5.472270673671475),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.472270673671475),- ("dayminute", -3.169685580677429),- ("from <datetime> - <datetime> (interval)on <date>",- -5.06680556556331),- ("<datetime> - <datetime> (interval)tomorrow",- -5.472270673671475),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.06680556556331),- ("<ordinal> <cycle> of <time>year", -5.472270673671475),- ("minuteday", -2.0710732920093196),- ("absorption of , after named dayintersect",- -5.472270673671475),- ("Octoberyear", -4.219507705176107),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -5.472270673671475),- ("at <time-of-day>absorption of , after named day",- -5.472270673671475),- ("<day-of-month> (ordinal or number) <named-month>year",- -5.472270673671475),- ("year<time-of-day> am|pm", -5.472270673671475),- ("Septemberyear", -5.06680556556331),- ("at <time-of-day>on <date>", -4.373658385003365),- ("between <time-of-day> and <time-of-day> (interval)on <date>",- -4.77912349311153),- ("Halloweenyear", -5.472270673671475),- ("dayweek", -5.472270673671475),- ("weekyear", -5.06680556556331),- ("hh:mmin|during the <part-of-day>", -4.77912349311153),- ("Father's Dayyear", -5.472270673671475),- ("<cycle> after|before <time><time-of-day> am|pm",- -5.06680556556331),- ("February<time> <part-of-day>", -5.472270673671475),- ("Martin Luther King's Dayyear", -5.06680556556331),- ("tomorrowat <time-of-day>", -4.77912349311153),- ("between <time> and <time>on <date>", -4.77912349311153),- ("at <time-of-day>tomorrow", -5.06680556556331),- ("tomorrow<time-of-day> am|pm", -5.472270673671475),- ("in|during the <part-of-day>at <time-of-day>",- -5.472270673671475),- ("black fridayyear", -5.06680556556331),- ("Labor Dayyear", -5.472270673671475),- ("Februaryintersect", -5.472270673671475),- ("last <cycle> of <time>year", -4.77912349311153),- ("<named-month> <day-of-month> (non ordinal)year",- -5.472270673671475),- ("yearminute", -5.472270673671475)],- n = 173},- koData =- ClassData{prior = -0.9980075895468108, unseen = -5.808142489980444,- likelihoods =- HashMap.fromList- [("in <named-month>year", -5.111987788356543),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -5.111987788356543),- ("hourday", -5.111987788356543),- ("<named-month> <day-of-month> (non ordinal)July",- -5.111987788356543),- ("dayhour", -3.3202283191284883),- ("daymonth", -3.0325462466767075),- ("monthday", -4.706522680248379),- ("monthyear", -4.418840607796598),- ("intersecthh:mm", -5.111987788356543),- ("from <datetime> - <datetime> (interval)July",- -5.111987788356543),- ("houryear", -5.111987788356543),- ("from <time-of-day> - <time-of-day> (interval)July",- -5.111987788356543),- ("until <time-of-day><time-of-day> am|pm", -5.111987788356543),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.418840607796598),- ("<time-of-day> am|pmintersect", -3.859224819861175),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.1956970564823886),- ("Tuesdayafter <time-of-day>", -5.111987788356543),- ("July<day-of-month> (ordinal or number) <named-month>",- -5.111987788356543),- ("absorption of , after named dayJuly", -4.706522680248379),- ("monthhour", -5.111987788356543),- ("hourmonth", -4.418840607796598),- ("todayat <time-of-day>", -5.111987788356543),- ("dayday", -5.111987788356543),- ("dd/mmat <time-of-day>", -4.706522680248379),- ("<time-of-day> am|pmon <date>", -3.859224819861175),- ("dayyear", -3.859224819861175),- ("Thursdayat <time-of-day>", -5.111987788356543),- ("<integer> to|till|before <hour-of-day>September",- -5.111987788356543),- ("monthminute", -5.111987788356543),- ("<time-of-day> am|pmtomorrow", -5.111987788356543),- ("Thursdayhh:mm", -5.111987788356543),- ("August<day-of-month> (ordinal or number) <named-month>",- -5.111987788356543),- ("Fridayyear", -4.706522680248379),- ("minutemonth", -3.407239696118118),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.706522680248379),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.706522680248379),- ("Aprilyear", -5.111987788356543),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.111987788356543),- ("dd/mm<time-of-day> - <time-of-day> (interval)",- -4.706522680248379),- ("<duration> after|before|from <time>December",- -5.111987788356543),- ("yesterday<time-of-day> am|pm", -5.111987788356543),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -4.1956970564823886),- ("<named-month> <day-of-month> (non ordinal)August",- -5.111987788356543),- ("until <time-of-day>on <date>", -4.418840607796598),- ("at <time-of-day>intersect", -4.706522680248379),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.111987788356543),- ("dayminute", -3.16607763930123),- ("intersectSeptember", -3.607910391580269),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.111987788356543),- ("minuteday", -2.3086274074500084),- ("absorption of , after named dayintersect",- -5.111987788356543),- ("Februaryin|during the <part-of-day>", -5.111987788356543),- ("week-endin <named-month>", -5.111987788356543),- ("Octoberyear", -5.111987788356543),- ("yearhh:mm", -5.111987788356543),- ("hh:mmon <date>", -3.607910391580269),- ("absorption of , after named daySeptember",- -4.1956970564823886),- ("on <date>September", -4.706522680248379),- ("at <time-of-day>on <date>", -4.706522680248379),- ("absorption of , after named dayFebruary",- -4.1956970564823886),- ("July<integer> to|till|before <hour-of-day>",- -5.111987788356543),- ("tomorrowat <time-of-day>", -5.111987788356543),- ("<integer> to|till|before <hour-of-day>July",- -5.111987788356543),- ("tomorrow<time-of-day> am|pm", -5.111987788356543),- ("after <time-of-day><time-of-day> am|pm", -5.111987788356543),- ("after <time-of-day>year", -5.111987788356543),- ("yearminute", -5.111987788356543)],- n = 101}}),- ("after lunch/work/school",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("early morning",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <number> (implicit minutes)",- Classifier{okData =- ClassData{prior = -1.041453874828161, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.5596157879354228),- ("integer (0..19)", -0.8472978603872037)],- n = 12},- koData =- ClassData{prior = -0.4353180712578455,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.3448404862917295),- ("integer (0..19)", -1.2321436812926323)],- n = 22}}),- ("<ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("daymonth", -2.0149030205422647),- ("quarteryear", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)day (grain)October",- -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",- -2.0149030205422647),- ("weekmonth", -1.6094379124341003),- ("ordinal (digits)quarter (grain)year", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)October",- -2.0149030205422647)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("year (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods = HashMap.fromList [("", 0.0)], n = 21},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.6375861597263857,- likelihoods =- HashMap.fromList- [("minuteminute", -2.001480000210124),- ("<day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("hh:mmhh:mm", -2.001480000210124),- ("dayday", -2.512305623976115),- ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),- ("hourhour", -2.512305623976115),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.912023005428146,- likelihoods =- HashMap.fromList- [("hourday", -3.1986731175506815),- ("dayhour", -2.793208009442517),- ("<day-of-month> (ordinal)time-of-day (latent)",- -3.1986731175506815),- ("hh:mmtime-of-day (latent)", -2.2823823856765264),- ("minuteminute", -2.793208009442517),- ("time-of-day (latent)time-of-day (latent)",- -2.793208009442517),- ("dayday", -3.1986731175506815),- ("hourhour", -2.505525936990736),- ("dayyear", -3.1986731175506815),- ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",- -3.1986731175506815),- ("minutehour", -2.2823823856765264),- ("hh:mmintersect", -2.793208009442517),- ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("time-of-day (latent)<time-of-day> am|pm",- -3.1986731175506815),- ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",- -3.1986731175506815)],- n = 14}}),- ("Saturday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",- -1.7346010553881064),- ("weekmonth", -1.7346010553881064),- ("week (grain)October", -1.7346010553881064),- ("week (grain)<named-month> <day-of-month> (non ordinal)",- -1.7346010553881064),- ("weekday", -1.2237754316221157)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("number.number hours",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("minuteminute", -1.6094379124341003),- ("hh:mmhh:mm", -1.6094379124341003),- ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),- ("hourhour", -2.3025850929940455),- ("hourminute", -2.3025850929940455),- ("time-of-day (latent)<time-of-day> sharp|exactly",- -2.70805020110221),- ("time-of-day (latent)hh:mm", -2.70805020110221),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],- n = 9},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.6094379124341003),- ("time-of-day (latent)time-of-day (latent)",- -2.0149030205422647),- ("hourhour", -1.791759469228055),- ("minutehour", -1.6094379124341003),- ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],- n = 9}}),- ("integer 21..99",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods =- HashMap.fromList [("integer (numeric)integer (numeric)", 0.0)],- n = 2}}),- ("last|next n <cycle>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("week", -2.627081138568543),- ("integer (0..19)year (grain)", -3.3202283191284883),- ("integer (numeric)day (grain)", -3.0325462466767075),- ("integer (0..19)second (grain) ", -3.3202283191284883),- ("integer (0..19)hour (grain)", -3.3202283191284883),- ("second", -2.8094026953624978),- ("integer (numeric)second (grain) ", -3.3202283191284883),- ("integer (numeric)year (grain)", -3.3202283191284883),- ("day", -2.472930458741285), ("year", -2.8094026953624978),- ("integer (numeric)week (grain)", -3.0325462466767075),- ("integer (0..19)month (grain)", -3.3202283191284883),- ("hour", -2.8094026953624978), ("month", -2.8094026953624978),- ("integer (numeric)minute (grain)", -3.3202283191284883),- ("integer (0..19)minute (grain)", -3.3202283191284883),- ("integer (numeric)month (grain)", -3.3202283191284883),- ("minute", -2.8094026953624978),- ("integer (numeric)hour (grain)", -3.3202283191284883),- ("integer (0..19)day (grain)", -3.0325462466767075),- ("integer (0..19)week (grain)", -3.3202283191284883)],- n = 31},- koData =- ClassData{prior = -infinity, unseen = -3.0910424533583156,- likelihoods = HashMap.fromList [], n = 0}}),- ("yyyy-mm-dd",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -1.6094379124341003,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("Monday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("dd/mm/yyyy",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("yesterday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<ordinal> quarter <year>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh:mm:ss",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<hour-of-day> <integer>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("at <time-of-day>integer (20..90)", -1.3862943611198906),- ("hour", -0.9808292530117262),- ("at <time-of-day>integer (numeric)", -1.3862943611198906)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>integer (numeric)",- -1.0986122886681098),- ("hour", -1.0986122886681098)],- n = 1}}),- ("nth <time> of <time>",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("daymonth", -0.9808292530117262),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -2.0794415416798357),- ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",- -1.6739764335716716),- ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",- -1.6739764335716716)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.5649493574615367,- likelihoods =- HashMap.fromList- [("daymonth", -1.0986122886681098),- ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",- -1.791759469228055),- ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",- -1.3862943611198906)],- n = 3}}),- ("Valentine's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("April",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("end of month",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("week (grain)",- Classifier{okData =- ClassData{prior = -8.004270767353637e-2,- unseen = -3.6375861597263857,- likelihoods = HashMap.fromList [("", 0.0)], n = 36},- koData =- ClassData{prior = -2.5649493574615367,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("<part-of-day> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",- -1.6094379124341003),- ("hourday", -0.916290731874155),- ("part of daysthe <day-of-month> (ordinal)",- -1.6094379124341003),- ("part of daysthe <day-of-month> (number)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("past year (latent)",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 2}}),- ("now",- Classifier{okData =- ClassData{prior = -0.15415067982725836,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -1.9459101490553135,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("<day-of-month> (ordinal or number) of <named-month>",- Classifier{okData =- ClassData{prior = -0.13353139262452263,- unseen = -3.0910424533583156,- likelihoods =- HashMap.fromList- [("ordinal (digits)July", -2.3513752571634776),- ("ordinals (first..twentieth,thirtieth,...)March",- -2.3513752571634776),- ("ordinal (digits)February", -2.3513752571634776),- ("integer (numeric)February", -1.9459101490553135),- ("month", -0.9650808960435872),- ("ordinal (digits)March", -2.3513752571634776),- ("integer (numeric)July", -2.3513752571634776)],- n = 7},- koData =- ClassData{prior = -2.0794415416798357,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)February", -1.5040773967762742),- ("month", -1.5040773967762742)],- n = 1}}),- ("this <part-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("hour", -0.6931471805599453),- ("part of days", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Friday",- Classifier{okData =- ClassData{prior = -0.3677247801253174,- unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("in|during the <part-of-day>",- Classifier{okData =- ClassData{prior = -8.701137698962981e-2,- unseen = -3.258096538021482,- likelihoods =- HashMap.fromList- [("early morning", -2.5257286443082556),- ("hour", -0.7339691750802004),- ("part of days", -0.8209805520698302)],- n = 11},- koData =- ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("hour", -0.916290731874155),- ("part of days", -0.916290731874155)],- n = 1}}),- ("tomorrow",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh(:mm) - <time-of-day> am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("this|last|next <cycle>",- Classifier{okData =- ClassData{prior = -0.15822400521489416,- unseen = -4.394449154672439,- likelihoods =- HashMap.fromList- [("week", -1.5488132906176655),- ("month (grain)", -2.995732273553991),- ("year (grain)", -1.817077277212345),- ("week (grain)", -1.5488132906176655),- ("quarter", -2.772588722239781), ("year", -1.817077277212345),- ("month", -2.995732273553991),- ("quarter (grain)", -2.772588722239781)],- n = 35},- koData =- ClassData{prior = -1.9218125974762528,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("week", -1.4816045409242156),- ("week (grain)", -1.4816045409242156),- ("day", -1.9924301646902063),- ("day (grain)", -1.9924301646902063)],- n = 6}}),- ("Mother's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Eve",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("by <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -2.1972245773362196),- ("end of month", -2.1972245773362196),- ("time-of-day (latent)", -2.1972245773362196),- ("<time-of-day> am|pm", -2.1972245773362196),- ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),- ("month", -2.1972245773362196), ("minute", -1.791759469228055)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [], n = 0}}),- ("half an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.2006706954621511,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("ordinals (first..twentieth,thirtieth,...)",- -1.7047480922384253),- ("ordinal (digits)", -0.2006706954621511)],- n = 9},- koData =- ClassData{prior = -1.7047480922384253,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],- n = 2}}),- ("last weekend of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("October", -0.9555114450274363), ("July", -1.8718021769015913),- ("month", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (number)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("fractional number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),- ("Sunday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("February",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods = HashMap.fromList [("", 0.0)], n = 13},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("minute (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1}}),- ("time-of-day (latent)",- Classifier{okData =- ClassData{prior = -0.5363047090669756, unseen = -4.174387269895637,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.1158318155251217),- ("integer (0..19)", -2.2129729343043585)],- n = 62},- koData =- ClassData{prior = -0.8792494601938059,- unseen = -3.8501476017100584,- likelihoods =- HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)],- n = 44}}),- ("year",- Classifier{okData =- ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 34},- koData =- ClassData{prior = -1.6582280766035324,- unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 8}}),- ("last <day-of-week> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("daymonth", -0.916290731874155),- ("SundayMarch", -1.6094379124341003),- ("MondayMarch", -1.6094379124341003),- ("Sundayintersect", -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.7444404749474959, unseen = -4.605170185988091,- likelihoods =- HashMap.fromList- [("week", -2.3978952727983707),- ("integer (0..19)year (grain)", -3.2088254890146994),- ("integer (numeric)day (grain)", -2.515678308454754),- ("integer (0..19)second (grain) ", -3.9019726695746444),- ("integer (0..19)hour (grain)", -2.803360380906535),- ("second", -3.9019726695746444),- ("integer (numeric)year (grain)", -3.9019726695746444),- ("day", -2.515678308454754), ("year", -2.9856819377004897),- ("integer (numeric)week (grain)", -2.9856819377004897),- ("integer (0..19)month (grain)", -3.4965075614664802),- ("hour", -2.515678308454754), ("month", -3.4965075614664802),- ("integer (numeric)minute (grain)", -2.9856819377004897),- ("integer (0..19)minute (grain)", -2.803360380906535),- ("minute", -2.2925347571405443),- ("integer (numeric)hour (grain)", -3.4965075614664802),- ("integer (0..19)week (grain)", -2.9856819377004897)],- n = 38},- koData =- ClassData{prior = -0.6443570163905132, unseen = -4.68213122712422,- likelihoods =- HashMap.fromList- [("week", -2.8810693652338513),- ("integer (0..19)year (grain)", -3.5742165457937967),- ("integer (numeric)day (grain)", -3.2865344733420154),- ("integer (0..19)second (grain) ", -3.5742165457937967),- ("integer (0..19)hour (grain)", -3.5742165457937967),- ("second", -3.0633909220278057),- ("integer (numeric)second (grain) ", -3.5742165457937967),- ("integer (numeric)year (grain)", -3.5742165457937967),- ("day", -2.7269186854065928), ("quarter", -3.979681653901961),- ("year", -3.0633909220278057),- ("integer (numeric)week (grain)", -3.2865344733420154),- ("integer (0..19)month (grain)", -3.5742165457937967),- ("hour", -1.9647786333596962), ("month", -3.0633909220278057),- ("integer (numeric)minute (grain)", -3.5742165457937967),- ("integer (0..19)minute (grain)", -3.5742165457937967),- ("integer (numeric)month (grain)", -3.5742165457937967),- ("minute", -3.0633909220278057),- ("integer (numeric)hour (grain)", -2.1078794770003695),- ("integer (0..19)day (grain)", -3.2865344733420154),- ("integer (0..19)week (grain)", -3.5742165457937967),- ("integer (0..19)quarter (grain)", -3.979681653901961)],- n = 42}}),- ("hhmm (latent)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> am|pm",- Classifier{okData =- ClassData{prior = -0.2847365622220242, unseen = -5.231108616854587,- likelihoods =- HashMap.fromList- [("integer after|past <hour-of-day>", -3.8394523125933104),- ("at <time-of-day>", -2.2300144001592104),- ("<time-of-day> o'clock", -4.127134385045092),- ("half after|past <hour-of-day>", -4.127134385045092),- ("time-of-day (latent)", -1.7600107709134747),- ("hhmm (latent)", -4.532599493153256),- ("hh:mm", -2.181224235989778),- ("quarter after|past <hour-of-day>", -4.532599493153256),- ("about|exactly <time-of-day>", -4.532599493153256),- ("until <time-of-day>", -3.8394523125933104),- ("hour", -1.2939210409888755),- ("<time-of-day> sharp|exactly", -4.532599493153256),- ("minute", -1.6422277352570913),- ("after <time-of-day>", -4.532599493153256)],- n = 85},- koData =- ClassData{prior = -1.3951833085371366, unseen = -4.290459441148391,- likelihoods =- HashMap.fromList- [("<integer> to|till|before <hour-of-day>", -3.1780538303479458),- ("<hour-of-day> <integer>", -3.58351893845611),- ("time-of-day (latent)", -1.0577902941478545),- ("hour", -1.0185695809945732), ("minute", -2.890371757896165),- ("after <time-of-day>", -3.58351893845611)],- n = 28}}),- ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("ordinal (digits)ordinal (digits)July", -1.252762968495368),- ("integer (numeric)integer (numeric)July", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thanksgiving Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("a <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.5753641449035618,- unseen = -3.4965075614664802,- likelihoods =- HashMap.fromList- [("week", -2.0794415416798357),- ("year (grain)", -2.772588722239781),- ("second", -2.772588722239781),- ("week (grain)", -2.0794415416798357),- ("day", -2.0794415416798357),- ("minute (grain)", -2.772588722239781),- ("year", -2.772588722239781),- ("second (grain) ", -2.772588722239781),- ("minute", -2.772588722239781),- ("day (grain)", -2.0794415416798357)],- n = 9},- koData =- ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("hour (grain)", -1.7227665977411035),- ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),- ("quarter (grain)", -1.9459101490553135)],- n = 7}}),- ("hh:mm",- Classifier{okData =- ClassData{prior = -5.406722127027582e-2,- unseen = -4.02535169073515,- likelihoods = HashMap.fromList [("", 0.0)], n = 54},- koData =- ClassData{prior = -2.9444389791664407,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("quarter of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("second (grain) ",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinals (first..twentieth,thirtieth,...)",- Classifier{okData =- ClassData{prior = -6.899287148695143e-2,- unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14},- koData =- ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("quarter after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> after|before <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.252762968495368),- ("dayday", -0.8472978603872037),- ("day (grain)yesterday", -1.252762968495368)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("about|exactly <time-of-day>",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("week", -2.639057329615259),- ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),- ("this|last|next <cycle>", -2.639057329615259),- ("day", -2.2335922215070942),- ("time-of-day (latent)", -2.639057329615259),- ("hhmm (latent)", -2.2335922215070942),- ("<time-of-day> am|pm", -2.639057329615259),- ("hour", -1.9459101490553135),- ("next <time>", -2.639057329615259),- ("this|next <day-of-week>", -2.639057329615259),- ("minute", -2.2335922215070942)],- n = 8},- koData =- ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("dd/mm", -2.0794415416798357), ("day", -2.0794415416798357),- ("time-of-day (latent)", -2.0794415416798357),- ("hour", -2.0794415416798357)],- n = 2}}),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- Classifier{okData =- ClassData{prior = -0.48130318449966897,- unseen = -5.170483995038151,- likelihoods =- HashMap.fromList- [("Wednesday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayhour", -3.2188758248682006),- ("daymonth", -3.2188758248682006),- ("<named-month> <day-of-month> (non ordinal)Friday",- -4.471638793363569),- ("Friday<named-month> <day-of-month> (non ordinal)",- -3.7784916128036232),- ("Wednesdayintersect", -4.471638793363569),- ("Labor Daythis|last|next <cycle>", -4.471638793363569),- ("black fridaythis|last|next <cycle>", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.471638793363569),- ("<part-of-day> of <time>February", -4.471638793363569),- ("Saturday<time-of-day> am|pm", -4.471638793363569),- ("Martin Luther King's Daythis|last|next <cycle>",- -4.471638793363569),- ("on <date><time-of-day> am|pm", -4.471638793363569),- ("hourmonth", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.471638793363569),- ("dayday", -2.5998366164619773),- ("the <day-of-month> (ordinal)February", -4.0661736852554045),- ("WednesdayOctober", -4.471638793363569),- ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.5553480614894135),- ("dayyear", -2.8622008809294686),- ("Saturday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.471638793363569),- ("Thursdayhh:mm", -4.0661736852554045),- ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),- ("Memorial Daythis|last|next <cycle>", -4.471638793363569),- ("on <date><named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("TuesdayOctober", -4.471638793363569),- ("the <day-of-month> (ordinal)March", -4.471638793363569),- ("Mondaythis|last|next <cycle>", -4.471638793363569),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.0661736852554045),- ("Fridayintersect", -4.471638793363569),- ("Thursday<datetime> - <datetime> (interval)",- -3.7784916128036232),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.5553480614894135),- ("Tuesdaythis|last|next <cycle>", -4.471638793363569),- ("Sunday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayminute", -2.6798793241355137),- ("intersectyear", -4.471638793363569),- ("minuteday", -3.5553480614894135),- ("this|last|next <cycle>Sunday", -4.471638793363569),- ("Sundaythis|last|next <cycle>", -4.471638793363569),- ("intersectintersect", -4.471638793363569),- ("weekday", -4.471638793363569),- ("dayweek", -3.373026504695459),- ("Thursday<time-of-day> am|pm", -4.471638793363569),- ("Monday<named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("<named-month> <day-of-month> (non ordinal)year",- -4.0661736852554045)],- n = 55},- koData =- ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,- likelihoods =- HashMap.fromList- [("week-endJuly", -4.197201947661808),- ("week-endOctober", -3.5040547671018634),- ("daymonth", -1.9999773703255892),- ("TuesdaySeptember", -4.197201947661808),- ("Wednesdayintersect", -4.197201947661808),- ("hourmonth", -3.0985896589936988),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.197201947661808),- ("Fridaythis|last|next <cycle>", -4.197201947661808),- ("SundayFebruary", -4.197201947661808),- ("WednesdayOctober", -4.197201947661808),- ("week-endintersect", -4.197201947661808),- ("dayyear", -4.197201947661808),- ("FridayJuly", -3.791736839553644),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.197201947661808),- ("FridaySeptember", -4.197201947661808),- ("WednesdayFebruary", -4.197201947661808),- ("minutemonth", -3.2809112157876537),- ("SundayMarch", -4.197201947661808),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.197201947661808),- ("MondayFebruary", -3.791736839553644),- ("Fridayintersect", -4.197201947661808),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.791736839553644),- ("dayminute", -2.810907586541918),- ("SaturdaySeptember", -4.197201947661808),- ("intersectSeptember", -3.2809112157876537),- ("MondayMarch", -4.197201947661808),- ("on <date>September", -3.791736839553644),- ("intersectintersect", -4.197201947661808),- ("Tuesdayintersect", -4.197201947661808),- ("Sundayintersect", -4.197201947661808)],- n = 34}}),- ("last <time>",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("Father's Day", -2.6741486494265287),- ("Martin Luther King's Day", -2.6741486494265287),- ("Memorial Day", -2.6741486494265287),- ("Mother's Day", -2.6741486494265287),- ("day", -1.2878542883066382), ("Sunday", -2.6741486494265287),- ("Thanksgiving Day", -2.6741486494265287),- ("hour", -2.6741486494265287), ("Tuesday", -2.6741486494265287),- ("week-end", -2.6741486494265287)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("intersect", -3.0204248861443626),- ("Monday", -3.0204248861443626), ("day", -2.1041341542702074),- ("Sunday", -3.0204248861443626),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.7676619176489945),- ("hour", -1.3156767939059373),- ("week-end", -1.9218125974762528)],- n = 14}}),- ("March",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<named-month>|<named-day> <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.11778303565638351,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("Octoberordinal (digits)", -2.0794415416798357),- ("Thursdayordinal (digits)", -2.4849066497880004),- ("day", -2.0794415416798357),- ("Augustordinal (digits)", -2.4849066497880004),- ("Marchordinals (first..twentieth,thirtieth,...)",- -2.0794415416798357),- ("Tuesdayordinal (digits)", -2.4849066497880004),- ("month", -1.2321436812926323),- ("Marchordinal (digits)", -2.4849066497880004)],- n = 8},- koData =- ClassData{prior = -2.1972245773362196,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Augustordinal (digits)", -1.6094379124341003),- ("month", -1.6094379124341003)],- n = 1}}),- ("Labor Day weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Christmas",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("until <time-of-day>",- Classifier{okData =- ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -2.3025850929940455),- ("<time-of-day> am|pm", -1.6094379124341003),- ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),- ("minute", -1.3862943611198906)],- n = 6},- koData =- ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("intersect", -1.7227665977411035),- ("yesterday", -2.2335922215070942),- ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),- ("hour", -2.639057329615259), ("minute", -1.252762968495368)],- n = 10}}),- ("<duration> after|before|from <time>",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("a <unit-of-duration>now", -2.70805020110221),- ("a <unit-of-duration>Christmas", -2.70805020110221),- ("<integer> <unit-of-duration>today", -2.70805020110221),- ("daysecond", -2.70805020110221),- ("a <unit-of-duration>right now", -2.70805020110221),- ("minutenograin", -2.70805020110221),- ("<integer> <unit-of-duration>Christmas", -2.70805020110221),- ("secondnograin", -2.70805020110221),- ("yearday", -2.0149030205422647),- ("daynograin", -2.70805020110221),- ("<integer> <unit-of-duration>now", -2.3025850929940455)],- n = 7},- koData =- ClassData{prior = -1.2039728043259361,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("dayhour", -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal)",- -2.3978952727983707),- ("dayday", -1.9924301646902063),- ("<integer> <unit-of-duration>time-of-day (latent)",- -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -2.3978952727983707)],- n = 3}}),- ("Independence Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("decimal number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("next <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5263605246161616,- likelihoods =- HashMap.fromList- [("Martin Luther King's Day", -2.803360380906535),- ("Halloween", -2.803360380906535),- ("Wednesday", -2.803360380906535),- ("Memorial Day", -2.803360380906535),- ("Monday", -2.803360380906535),- ("Mother's Day", -2.803360380906535),- ("day", -1.0986122886681098),- ("Thanksgiving Day", -2.803360380906535),- ("March", -2.803360380906535), ("month", -2.803360380906535),- ("Tuesday", -2.1102132003465894)],- n = 11},- koData =- ClassData{prior = -infinity, unseen = -2.4849066497880004,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> sharp|exactly",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -2.1400661634962708),- ("time-of-day (latent)", -2.1400661634962708),- ("hhmm (latent)", -2.1400661634962708),- ("<time-of-day> am|pm", -2.1400661634962708),- ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),- ("minute", -1.4469189829363254)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day Weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("negative numbers",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 24}}),- ("about|exactly <duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("half an hour", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time> before last|after next",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("Wednesday", -1.8718021769015913),- ("Friday", -1.466337068793427), ("day", -1.1786549963416462),- ("March", -1.8718021769015913), ("month", -1.8718021769015913)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("by the end of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("this|last|next <cycle>", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hhmm (military) am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -0.48550781578170077,- unseen = -3.891820298110627,- likelihoods =- HashMap.fromList- [("minuteminute", -1.4733057381095205),- ("hh:mmhh:mm", -1.6739764335716716),- ("dayday", -2.772588722239781),- ("hourhour", -2.2617630984737906),- ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -3.1780538303479458),- ("<time-of-day> am|pm<time-of-day> am|pm",- -2.4849066497880004)],- n = 16},- koData =- ClassData{prior = -0.9555114450274363,- unseen = -3.6109179126442243,- likelihoods =- HashMap.fromList- [("<named-month> <day-of-month> (non ordinal)July",- -2.890371757896165),- ("daymonth", -2.4849066497880004),- ("<time-of-day> am|pmintersect", -2.890371757896165),- ("hh:mm<time-of-day> am|pm", -2.4849066497880004),- ("minuteminute", -1.9740810260220096),- ("hourhour", -2.4849066497880004),- ("minutehour", -2.4849066497880004),- ("hh:mmintersect", -1.9740810260220096),- ("<named-month> <day-of-month> (non ordinal)August",- -2.890371757896165),- ("about|exactly <time-of-day><time-of-day> am|pm",- -2.890371757896165)],- n = 10}}),- ("Tuesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Day",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),- ("fortnight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> and an half hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <named-month>",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -1.252762968495368), ("March", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -0.8472978603872037),- ("month", -0.8472978603872037)],- n = 2}}),- ("<time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.8873031950009028,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("minuteminute", -1.5163474893680884),- ("hh:mmhh:mm", -1.5163474893680884),- ("<time-of-day> am|pmtime-of-day (latent)", -2.327277705584417),- ("hourhour", -1.7676619176489945),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.327277705584417)],- n = 14},- koData =- ClassData{prior = -0.5306282510621704,- unseen = -3.9889840465642745,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>time-of-day (latent)",- -3.2771447329921766),- ("hh:mmtime-of-day (latent)", -1.5723966407537513),- ("hh:mm<time-of-day> am|pm", -2.871679624884012),- ("<time-of-day> am|pmtime-of-day (latent)",- -3.2771447329921766),- ("at <time-of-day><time-of-day> am|pm", -3.2771447329921766),- ("hourhour", -2.0243817644968085),- ("minutehour", -1.262241712449912),- ("about|exactly <time-of-day><time-of-day> am|pm",- -3.2771447329921766),- ("at <time-of-day>time-of-day (latent)", -2.871679624884012),- ("<integer> to|till|before <hour-of-day>time-of-day (latent)",- -2.871679624884012)],- n = 20}}),- ("nth <time> after <time>",- Classifier{okData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -0.916290731874155)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",- -0.916290731874155)],- n = 1}}),- ("<named-month> <day-of-month> (non ordinal)",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.9318256327243257,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.5257286443082556),- ("Marchinteger (numeric)", -2.8134107167600364),- ("Aprilinteger (numeric)", -3.2188758248682006),- ("month", -0.8209805520698302),- ("Februaryinteger (numeric)", -1.9661128563728327),- ("Septemberinteger (numeric)", -2.8134107167600364),- ("Octoberinteger (numeric)", -2.8134107167600364),- ("Julyinteger (numeric)", -2.120263536200091)],- n = 21},- koData =- ClassData{prior = -1.2039728043259361, unseen = -3.295836866004329,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.159484249353372),- ("Marchinteger (numeric)", -2.5649493574615367),- ("Aprilinteger (numeric)", -2.5649493574615367),- ("month", -0.9555114450274363),- ("Julyinteger (numeric)", -1.466337068793427)],- n = 9}}),- ("this|next <day-of-week>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods =- HashMap.fromList- [("Thursday", -2.2512917986064953),- ("Wednesday", -2.2512917986064953),- ("Monday", -1.845826690498331), ("day", -0.8649974374866046),- ("Tuesday", -1.55814461804655)],- n = 7},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinal (digits)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5553480614894135,- likelihoods = HashMap.fromList [("", 0.0)], n = 33},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter (grain)",- Classifier{okData =- ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("last <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("day (grain)October", -1.791759469228055),- ("daymonth", -1.2809338454620642),- ("day (grain)intersect", -1.791759469228055),- ("weekmonth", -1.791759469228055),- ("week (grain)intersect", -2.1972245773362196),- ("week (grain)September", -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("seasons",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month>(ordinal) <named-month> year",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)April", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Labor Day",- Classifier{okData =- ClassData{prior = -0.2876820724517809,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -1.3862943611198906,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("week-end",- Classifier{okData =- ClassData{prior = -1.5040773967762742,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.25131442828090605,- unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),- ("after <time-of-day>",- Classifier{okData =- ClassData{prior = -1.6094379124341003,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hour", -1.2992829841302609)],- n = 2},- koData =- ClassData{prior = -0.2231435513142097,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("intersect", -2.03688192726104),- ("tomorrow", -2.03688192726104), ("day", -1.3437347467010947),- ("time-of-day (latent)", -2.4423470353692043),- ("<time-of-day> am|pm", -2.4423470353692043),- ("Christmas", -2.03688192726104), ("hour", -1.749199854809259)],- n = 8}}),- ("day (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.2188758248682006,- likelihoods = HashMap.fromList [("", 0.0)], n = 23},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("black friday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("right now",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("for <duration> from <time>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("<integer> <unit-of-duration><day-of-month> (ordinal)",- -1.5040773967762742),- ("dayday", -1.0986122886681098),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -1.5040773967762742)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("dayhour", -1.252762968495368),- ("<integer> <unit-of-duration>time-of-day (latent)",- -1.252762968495368)],- n = 1}}),- ("between <time> and <time>",- Classifier{okData =- ClassData{prior = -1.0986122886681098,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("minuteminute", -1.0116009116784799),- ("hh:mmhh:mm", -1.0116009116784799)],- n = 3},- koData =- ClassData{prior = -0.40546510810816444,- unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.4469189829363254),- ("minuteminute", -1.4469189829363254),- ("minutehour", -1.4469189829363254),- ("hh:mmintersect", -1.4469189829363254)],- n = 6}}),- ("<month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.2992829841302609),- ("Augustordinal (digits)integer (numeric)",- -1.9924301646902063),- ("month", -0.7884573603642702),- ("Augustordinal (digits)ordinal (digits)",- -1.9924301646902063)],- n = 9},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of days",- Classifier{okData =- ClassData{prior = -4.0821994520255166e-2,- unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("", 0.0)], n = 24},- koData =- ClassData{prior = -3.2188758248682006,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("dd-dd <month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)September",- -1.791759469228055),- ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),- ("ordinal (digits)ordinal (digits)October",- -2.1972245773362196),- ("integer (numeric)integer (numeric)July", -2.1972245773362196),- ("month", -0.9444616088408514),- ("ordinal (digits)ordinal (digits)August",- -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("this <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("Thursday", -2.6026896854443837),- ("Martin Luther King's Day", -2.6026896854443837),- ("intersect", -2.6026896854443837),- ("Monday", -2.6026896854443837), ("day", -1.2163953243244932),- ("Thanksgiving Day", -2.6026896854443837),- ("hour", -2.1972245773362196), ("seasons", -1.9095425048844386),- ("week-end", -2.6026896854443837)],- n = 9},+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.824549292051046),+ ("<time-of-day> am|pm", -1.6422277352570913),+ ("hh:mm", -1.824549292051046), ("hour", -1.1314021114911006),+ ("minute", -1.824549292051046)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.7889513094975535, unseen = -5.225746673713201,+ likelihoods = HashMap.fromList [("", 0.0)], n = 184},+ koData =+ ClassData{prior = -0.6057243655887863, unseen = -5.407171771460119,+ likelihoods = HashMap.fromList [("", 0.0)], n = 221}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.784189633918261,+ likelihoods =+ HashMap.fromList+ [("week", -1.563975538357343), ("day", -1.8152899666382492),+ ("year", -2.662587827025453),+ ("<integer> <unit-of-duration>", -1.0531499145913523),+ ("a <unit-of-duration>", -2.662587827025453),+ ("month", -2.662587827025453),+ ("fortnight", -2.662587827025453)],+ n = 18},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("noon|midnight|EOD|end of day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter to|till|before <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.6094379124341003),+ ("dayday", -1.0986122886681098),+ ("day (grain)yesterday", -1.6094379124341003)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.466337068793427),+ ("year (grain)Christmas", -1.8718021769015913),+ ("day (grain)intersect", -1.466337068793427),+ ("yearday", -1.8718021769015913)],+ n = 3}}),+ ("Martin Luther King's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("mm/yyyy",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("integer after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("hour", -0.8109302162163288),+ ("integer (numeric)time-of-day (latent)", -1.0986122886681098),+ ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)December", -2.1400661634962708),+ ("ordinal (digits)February", -2.1400661634962708),+ ("integer (numeric)April", -2.1400661634962708),+ ("month", -1.4469189829363254)],+ n = 3},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)October", -2.6741486494265287),+ ("ordinal (digits)July", -2.6741486494265287),+ ("integer (numeric)September", -2.268683541318364),+ ("ordinal (digits)August", -2.6741486494265287),+ ("integer (numeric)August", -2.6741486494265287),+ ("ordinal (digits)April", -2.6741486494265287),+ ("month", -1.0647107369924282),+ ("integer (numeric)July", -2.268683541318364)],+ n = 9}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -9.844007281325252e-2,+ unseen = -4.430816798843313,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("dayhour", -1.5284688499004333),+ ("Mondayearly morning", -3.3202283191284883),+ ("time-of-day (latent)tonight", -3.3202283191284883),+ ("hourhour", -2.339399066116762),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -3.7256934272366524),+ ("todaypart of days", -3.7256934272366524),+ ("minutehour", -2.627081138568543),+ ("at <time-of-day>in|during the <part-of-day>",+ -3.3202283191284883),+ ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),+ ("Mondayin|during the <part-of-day>", -3.7256934272366524),+ ("intersectpart of days", -3.7256934272366524),+ ("intersectin|during the <part-of-day>", -3.7256934272366524),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -3.7256934272366524),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("tomorrowpart of days", -2.339399066116762),+ ("hh:mmin|during the <part-of-day>", -3.0325462466767075),+ ("time-of-day (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("hhmm (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("yesterdaypart of days", -3.7256934272366524),+ ("Mondaypart of days", -3.7256934272366524)],+ n = 29},+ koData =+ ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("yearhour", -2.740840023925201),+ ("monthhour", -2.740840023925201),+ ("hourhour", -2.740840023925201),+ ("past year (latent)in|during the <part-of-day>",+ -2.740840023925201),+ ("Februaryin|during the <part-of-day>", -2.740840023925201),+ ("time-of-day (latent)in|during the <part-of-day>",+ -2.740840023925201)],+ n = 3}}),+ ("dd/mm",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -0.2876820724517809, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -9.381875521765486e-2,+ unseen = -4.90527477843843,+ likelihoods =+ HashMap.fromList+ [("<time> timezone", -3.7992275112828016),+ ("noon|midnight|EOD|end of day", -3.7992275112828016),+ ("integer after|past <hour-of-day>", -3.7992275112828016),+ ("half after|past <hour-of-day>", -4.204692619390966),+ ("time-of-day (latent)", -1.7197859696029658),+ ("hhmm (latent)", -3.5115454388310208),+ ("<time-of-day> am|pm", -1.8067973465925955),+ ("hh:mm", -3.288401887516811),+ ("about|exactly <time-of-day>", -3.7992275112828016),+ ("hour", -1.0911773101805915),+ ("<time-of-day> sharp|exactly", -4.204692619390966),+ ("minute", -2.0074680420547466)],+ n = 61},+ koData =+ ClassData{prior = -2.412933150162911, unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.2321436812926323),+ ("hour", -1.2321436812926323)],+ n = 6}}),+ ("December",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("on <date>", -2.1972245773362196),+ ("Wednesday", -2.6026896854443837),+ ("Saturday", -2.6026896854443837),+ ("Monday", -2.1972245773362196),+ ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),+ ("Sunday", -2.6026896854443837)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last|past|next <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("week", -2.456735772821304), ("second", -2.639057329615259),+ ("day", -2.3025850929940455), ("year", -2.639057329615259),+ ("<integer> <unit-of-duration>", -0.7827593392496325),+ ("hour", -2.639057329615259), ("month", -2.639057329615259),+ ("minute", -2.639057329615259)],+ n = 31},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the ides of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,+ likelihoods =+ HashMap.fromList+ [("Thursday", -1.791759469228055), ("dd/mm", -3.295836866004329),+ ("absorption of , after named day", -2.890371757896165),+ ("intersect", -2.890371757896165),+ ("Saturday", -2.6026896854443837),+ ("Friday", -3.295836866004329), ("day", -0.8979415932059586),+ ("the <day-of-month> (ordinal)", -2.890371757896165),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.6026896854443837),+ ("hour", -3.295836866004329)],+ n = 22},+ koData =+ ClassData{prior = -1.8718021769015913,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.791759469228055), ("day", -1.2809338454620642),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -1.791759469228055)],+ n = 4}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.784189633918261,+ likelihoods = HashMap.fromList [("", 0.0)], n = 42},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -0.916290731874155),+ ("hh:mmhh:mm", -0.916290731874155)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -0.916290731874155),+ ("minutehour", -0.916290731874155)],+ n = 3}}),+ ("Halloween",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),+ ("Augustordinal (digits)integer (numeric)",+ -1.6094379124341003),+ ("month", -0.916290731874155),+ ("Augustordinal (digits)ordinal (digits)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from|since|after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("July", -3.3141860046725258),+ ("time-of-day (latent)", -2.3978952727983707),+ ("<time-of-day> am|pm", -2.3978952727983707),+ ("hh:mm", -2.3978952727983707), ("hour", -1.8101086078962516),+ ("month", -2.908720896564361), ("minute", -2.3978952727983707),+ ("August", -3.3141860046725258)],+ n = 14},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -4.836281906951478,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.7297014486341915),+ ("week", -4.135166556742356),+ ("<day-of-month> (ordinal or number) <named-month>",+ -4.135166556742356),+ ("today", -4.135166556742356),+ ("intersect", -2.7488721956224653),+ ("second", -4.135166556742356), ("now", -3.4420193761824103),+ ("tomorrow", -3.7297014486341915),+ ("this|last|next <cycle>", -4.135166556742356),+ ("day", -1.995100393246085),+ ("time-of-day (latent)", -4.135166556742356),+ ("<time-of-day> am|pm", -3.7297014486341915),+ ("nograin", -3.4420193761824103),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ -4.135166556742356),+ ("Christmas", -3.4420193761824103),+ ("hour", -2.8824035882469876),+ ("<datetime> - <datetime> (interval)", -2.7488721956224653),+ ("<time-of-day> - <time-of-day> (interval)",+ -2.430418464503931),+ ("<named-month> <day-of-month> (non ordinal)",+ -3.7297014486341915),+ ("minute", -1.6928195213731514),+ ("right now", -4.135166556742356),+ ("<month> dd-dd (interval)", -3.4420193761824103),+ ("dd-dd <month> (interval)", -3.7297014486341915)],+ n = 49}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> more <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)minute (grain)", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in|within|after <duration>",+ Classifier{okData =+ ClassData{prior = -4.652001563489282e-2,+ unseen = -4.61512051684126,+ likelihoods =+ HashMap.fromList+ [("week", -3.2188758248682006),+ ("<integer> more <unit-of-duration>", -3.912023005428146),+ ("three-quarters of an hour", -2.995732273553991),+ ("<integer> + '\"", -3.2188758248682006),+ ("number.number hours", -3.912023005428146),+ ("second", -3.506557897319982), ("day", -3.2188758248682006),+ ("half an hour", -2.995732273553991),+ ("<integer> <unit-of-duration>", -1.6094379124341003),+ ("a <unit-of-duration>", -2.995732273553991),+ ("quarter of an hour", -2.995732273553991),+ ("hour", -2.5257286443082556),+ ("about|exactly <duration>", -3.912023005428146),+ ("<integer> and an half hour", -3.912023005428146),+ ("minute", -1.2729656758128873)],+ n = 42},+ koData =+ ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("quarter", -1.8971199848858813),+ ("<integer> <unit-of-duration>", -2.3025850929940455),+ ("a <unit-of-duration>", -2.3025850929940455)],+ n = 2}}),+ ("three-quarters of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half <integer> (UK style hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -0.8209805520698302,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -1.1786549963416462),+ ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",+ -1.466337068793427),+ ("quarter", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.8109302162163288),+ ("quarter", -0.8109302162163288)],+ n = 3}}),+ ("one twenty two",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.4957877464014501, unseen = -6.293419278846481,+ likelihoods =+ HashMap.fromList+ [("<datetime> - <datetime> (interval)on <date>",+ -4.345658990503007),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -4.345658990503007),+ ("hourday", -3.8936738667599493),+ ("dayhour", -2.765208614942159),+ ("daymonth", -4.90527477843843),+ ("monthday", -5.19295685089021),+ ("monthyear", -3.9889840465642745),+ ("Tuesdaythe <day-of-month> (ordinal)", -5.598421958998375),+ ("Christmasyear", -5.598421958998375),+ ("from <datetime> - <datetime> (interval)July",+ -5.598421958998375),+ ("houryear", -5.598421958998375),+ ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.90527477843843),+ ("<time-of-day> am|pmintersect", -4.345658990503007),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -5.598421958998375),+ ("Marchyear", -5.598421958998375),+ ("<named-month>|<named-day> <day-of-month> (ordinal)year",+ -5.19295685089021),+ ("intersect<time-of-day> am|pm", -5.598421958998375),+ ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.598421958998375),+ ("monthhour", -5.19295685089021),+ ("last <day-of-week> of <time>year", -5.598421958998375),+ ("todayat <time-of-day>", -5.598421958998375),+ ("Thursday<time> timezone", -3.8936738667599493),+ ("dd/mm<time-of-day> am|pm", -5.598421958998375),+ ("this <time>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("dayday", -3.58351893845611),+ ("Thanksgiving Dayyear", -4.499809670330265),+ ("dd/mmat <time-of-day>", -5.598421958998375),+ ("<time> <part-of-day>at <time-of-day>", -5.598421958998375),+ ("Tuesdayin <named-month>", -5.598421958998375),+ ("tonightat <time-of-day>", -5.598421958998375),+ ("<time-of-day> am|pmabsorption of , after named day",+ -4.90527477843843),+ ("today<time-of-day> am|pm", -5.598421958998375),+ ("Februarythe <day-of-month> (ordinal)", -5.19295685089021),+ ("at <time-of-day><time> <part-of-day>", -5.598421958998375),+ ("hourhour", -4.345658990503007),+ ("<time-of-day> am|pmon <date>", -3.58351893845611),+ ("Wednesdaythis|last|next <cycle>", -5.598421958998375),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -4.0943445622221),+ ("dayyear", -3.1560749236291703),+ ("last weekend of <named-month>year", -5.598421958998375),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -5.598421958998375),+ ("Thursdayat <time-of-day>", -5.19295685089021),+ ("<time-of-day> am|pmtomorrow", -4.90527477843843),+ ("minutehour", -4.68213122712422),+ ("Mother's Dayyear", -5.598421958998375),+ ("at <time-of-day>in|during the <part-of-day>",+ -5.19295685089021),+ ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",+ -3.8936738667599493),+ ("for <duration> from <time>December", -5.598421958998375),+ ("tomorrow<time-of-day> sharp|exactly", -5.598421958998375),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -5.19295685089021),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.68213122712422),+ ("Mondayin|during the <part-of-day>", -5.598421958998375),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.19295685089021),+ ("intersectin|during the <part-of-day>", -5.598421958998375),+ ("Thursday<datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -5.598421958998375),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.345658990503007),+ ("from <time-of-day> - <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -4.68213122712422),+ ("at <time-of-day>intersect", -5.19295685089021),+ ("<time-of-day> - <time-of-day> (interval)tomorrow",+ -5.598421958998375),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.598421958998375),+ ("dayminute", -2.924273309571846),+ ("from <datetime> - <datetime> (interval)on <date>",+ -5.19295685089021),+ ("<datetime> - <datetime> (interval)tomorrow",+ -5.598421958998375),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.19295685089021),+ ("<ordinal> <cycle> of <time>year", -5.598421958998375),+ ("minuteday", -2.132686056198648),+ ("absorption of , after named dayintersect",+ -5.598421958998375),+ ("Octoberyear", -4.345658990503007),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -5.598421958998375),+ ("at <time-of-day>absorption of , after named day",+ -5.598421958998375),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -5.598421958998375),+ ("year<time-of-day> am|pm", -5.598421958998375),+ ("Septemberyear", -5.19295685089021),+ ("at <time-of-day>on <date>", -4.499809670330265),+ ("between <time-of-day> and <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("Halloweenyear", -5.598421958998375),+ ("dayweek", -5.598421958998375),+ ("Thursday<time-of-day> am|pm", -5.598421958998375),+ ("weekyear", -5.19295685089021),+ ("hh:mmin|during the <part-of-day>", -4.90527477843843),+ ("Father's Dayyear", -5.598421958998375),+ ("<cycle> after|before <time><time-of-day> am|pm",+ -5.19295685089021),+ ("February<time> <part-of-day>", -5.598421958998375),+ ("Martin Luther King's Dayyear", -5.19295685089021),+ ("tomorrowat <time-of-day>", -4.90527477843843),+ ("between <time> and <time>on <date>", -4.90527477843843),+ ("Thursdayfrom|since|after <time-of-day>", -4.90527477843843),+ ("at <time-of-day>tomorrow", -5.19295685089021),+ ("tomorrow<time-of-day> am|pm", -5.598421958998375),+ ("in|during the <part-of-day>at <time-of-day>",+ -5.598421958998375),+ ("Labor Dayyear", -5.598421958998375),+ ("Februaryintersect", -5.598421958998375),+ ("last <cycle> of <time>year", -4.90527477843843),+ ("<named-month> <day-of-month> (non ordinal)year",+ -5.598421958998375),+ ("yearminute", -5.598421958998375),+ ("Black Fridayyear", -5.19295685089021)],+ n = 201},+ koData =+ ClassData{prior = -0.9392802500988537, unseen = -5.983936280687191,+ likelihoods =+ HashMap.fromList+ [("in <named-month>year", -5.288267030694535),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -5.288267030694535),+ ("hourday", -5.288267030694535),+ ("<named-month> <day-of-month> (non ordinal)July",+ -5.288267030694535),+ ("dayhour", -2.890371757896165),+ ("daymonth", -3.2088254890146994),+ ("monthday", -4.882801922586371),+ ("monthyear", -4.59511985013459),+ ("intersecthh:mm", -5.288267030694535),+ ("from <datetime> - <datetime> (interval)July",+ -5.288267030694535),+ ("houryear", -5.288267030694535),+ ("from <time-of-day> - <time-of-day> (interval)July",+ -5.288267030694535),+ ("until <time-of-day><time-of-day> am|pm", -5.288267030694535),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.59511985013459),+ ("<time-of-day> am|pmintersect", -4.035504062199167),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.37197629882038),+ ("from|since|after <time-of-day>on <date>", -4.37197629882038),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("absorption of , after named dayJuly", -4.882801922586371),+ ("monthhour", -5.288267030694535),+ ("hourmonth", -4.59511985013459),+ ("todayat <time-of-day>", -5.288267030694535),+ ("from|since|after <time-of-day>July", -5.288267030694535),+ ("dayday", -4.882801922586371),+ ("dd/mmat <time-of-day>", -4.882801922586371),+ ("<time-of-day> am|pmon <date>", -4.035504062199167),+ ("Thursdaydd/mm", -5.288267030694535),+ ("dayyear", -4.035504062199167),+ ("Thursdayat <time-of-day>", -4.035504062199167),+ ("<integer> to|till|before <hour-of-day>September",+ -5.288267030694535),+ ("monthminute", -5.288267030694535),+ ("<time-of-day> am|pmtomorrow", -5.288267030694535),+ ("Thursdayhh:mm", -4.37197629882038),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("Fridayyear", -4.882801922586371),+ ("minutemonth", -3.4965075614664802),+ ("Sundayfrom|since|after <time-of-day>", -5.288267030694535),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.882801922586371),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("Aprilyear", -5.288267030694535),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.288267030694535),+ ("dd/mm<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("<duration> after|before|from <time>December",+ -5.288267030694535),+ ("yesterday<time-of-day> am|pm", -5.288267030694535),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -4.37197629882038),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("<named-month> <day-of-month> (non ordinal)August",+ -5.288267030694535),+ ("until <time-of-day>on <date>", -4.59511985013459),+ ("at <time-of-day>intersect", -4.882801922586371),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("dayminute", -2.7625383863862796),+ ("intersectSeptember", -3.784189633918261),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("minuteday", -2.3704962986102562),+ ("absorption of , after named dayintersect",+ -5.288267030694535),+ ("Februaryin|during the <part-of-day>", -5.288267030694535),+ ("week-endin <named-month>", -5.288267030694535),+ ("Octoberyear", -5.288267030694535),+ ("from|since|after <time-of-day>year", -5.288267030694535),+ ("yearhh:mm", -5.288267030694535),+ ("hh:mmon <date>", -3.784189633918261),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -5.288267030694535),+ ("absorption of , after named daySeptember", -4.37197629882038),+ ("on <date>September", -4.882801922586371),+ ("at <time-of-day>on <date>", -4.882801922586371),+ ("dayweek", -5.288267030694535),+ ("Thursday<time-of-day> am|pm", -4.882801922586371),+ ("absorption of , after named dayFebruary", -4.37197629882038),+ ("July<integer> to|till|before <hour-of-day>",+ -5.288267030694535),+ ("tomorrowat <time-of-day>", -5.288267030694535),+ ("<integer> to|till|before <hour-of-day>July",+ -5.288267030694535),+ ("Thursdayfrom|since|after <time-of-day>", -3.6788291182604347),+ ("tomorrow<time-of-day> am|pm", -5.288267030694535),+ ("Tuesdayfrom|since|after <time-of-day>", -5.288267030694535),+ ("yearminute", -5.288267030694535)],+ n = 129}}),+ ("one eleven",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("after lunch/work/school",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("early morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <number> (implicit minutes)",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.3184537311185346),+ ("integer (0..19)", -1.2992829841302609)],+ n = 9},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.16251892949777494),+ ("integer (0..19)", -1.8971199848858813)],+ n = 18}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.0149030205422647),+ ("quarteryear", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)day (grain)October",+ -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",+ -2.0149030205422647),+ ("weekmonth", -1.6094379124341003),+ ("ordinal (digits)quarter (grain)year", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)October",+ -2.0149030205422647)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods = HashMap.fromList [("", 0.0)], n = 21},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -1.0116009116784799,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -2.001480000210124),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("hh:mmhh:mm", -2.001480000210124),+ ("dayday", -2.512305623976115),+ ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),+ ("hourhour", -2.512305623976115),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],+ n = 8},+ koData =+ ClassData{prior = -0.45198512374305727,+ unseen = -3.912023005428146,+ likelihoods =+ HashMap.fromList+ [("hourday", -3.1986731175506815),+ ("dayhour", -2.793208009442517),+ ("<day-of-month> (ordinal)time-of-day (latent)",+ -3.1986731175506815),+ ("hh:mmtime-of-day (latent)", -2.2823823856765264),+ ("minuteminute", -2.793208009442517),+ ("time-of-day (latent)time-of-day (latent)",+ -2.793208009442517),+ ("dayday", -3.1986731175506815),+ ("hourhour", -2.505525936990736),+ ("dayyear", -3.1986731175506815),+ ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",+ -3.1986731175506815),+ ("minutehour", -2.2823823856765264),+ ("hh:mmintersect", -2.793208009442517),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("time-of-day (latent)<time-of-day> am|pm",+ -3.1986731175506815),+ ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",+ -3.1986731175506815)],+ n = 14}}),+ ("Saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",+ -1.7346010553881064),+ ("weekmonth", -1.7346010553881064),+ ("week (grain)October", -1.7346010553881064),+ ("week (grain)<named-month> <day-of-month> (non ordinal)",+ -1.7346010553881064),+ ("weekday", -1.2237754316221157)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number.number hours",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.6094379124341003),+ ("hh:mmhh:mm", -1.6094379124341003),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),+ ("hourhour", -2.3025850929940455),+ ("hourminute", -2.3025850929940455),+ ("time-of-day (latent)<time-of-day> sharp|exactly",+ -2.70805020110221),+ ("time-of-day (latent)hh:mm", -2.70805020110221),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],+ n = 9},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.6094379124341003),+ ("time-of-day (latent)time-of-day (latent)",+ -2.0149030205422647),+ ("hourhour", -1.791759469228055),+ ("minutehour", -1.6094379124341003),+ ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],+ n = 9}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)", -0.6931471805599453),+ ("integer (20..90)integer (0..19)", -0.6931471805599453)],+ n = 4}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("Monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd/mm/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (20..90)", -1.3862943611198906),+ ("hour", -0.9808292530117262),+ ("at <time-of-day>integer (numeric)", -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>integer (numeric)",+ -1.0986122886681098),+ ("hour", -1.0986122886681098)],+ n = 1}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.9808292530117262),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -2.0794415416798357),+ ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",+ -1.6739764335716716),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0986122886681098),+ ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",+ -1.791759469228055),+ ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",+ -1.3862943611198906)],+ n = 3}}),+ ("Valentine's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("end of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = -8.004270767353637e-2,+ unseen = -3.6375861597263857,+ likelihoods = HashMap.fromList [("", 0.0)], n = 36},+ koData =+ ClassData{prior = -2.5649493574615367,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",+ -1.6094379124341003),+ ("hourday", -0.916290731874155),+ ("part of daysthe <day-of-month> (ordinal)",+ -1.6094379124341003),+ ("part of daysthe <day-of-month> (number)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("past year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 2}}),+ ("six thirty six a.m.",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.252762968495368),+ ("one twenty two", -0.8472978603872037),+ ("one eleven", -1.252762968495368)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.9459101490553135,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -2.3513752571634776),+ ("ordinals (first..twentieth,thirtieth,...)March",+ -2.3513752571634776),+ ("ordinal (digits)February", -2.3513752571634776),+ ("integer (numeric)February", -1.9459101490553135),+ ("month", -0.9650808960435872),+ ("ordinal (digits)March", -2.3513752571634776),+ ("integer (numeric)July", -2.3513752571634776)],+ n = 7},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)February", -1.5040773967762742),+ ("month", -1.5040773967762742)],+ n = 1}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Friday",+ Classifier{okData =+ ClassData{prior = -0.3677247801253174,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("in|during the <part-of-day>",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("early morning", -2.5257286443082556),+ ("hour", -0.7339691750802004),+ ("part of days", -0.8209805520698302)],+ n = 11},+ koData =+ ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("hour", -0.916290731874155),+ ("part of days", -0.916290731874155)],+ n = 1}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh(:mm) - <time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last|next <cycle>",+ Classifier{okData =+ ClassData{prior = -0.15822400521489416,+ unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("week", -1.5488132906176655),+ ("month (grain)", -2.995732273553991),+ ("year (grain)", -1.817077277212345),+ ("week (grain)", -1.5488132906176655),+ ("quarter", -2.772588722239781), ("year", -1.817077277212345),+ ("month", -2.995732273553991),+ ("quarter (grain)", -2.772588722239781)],+ n = 35},+ koData =+ ClassData{prior = -1.9218125974762528,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("week", -1.4816045409242156),+ ("week (grain)", -1.4816045409242156),+ ("day", -1.9924301646902063),+ ("day (grain)", -1.9924301646902063)],+ n = 6}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -2.1972245773362196),+ ("end of month", -2.1972245773362196),+ ("time-of-day (latent)", -2.1972245773362196),+ ("<time-of-day> am|pm", -2.1972245773362196),+ ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),+ ("month", -2.1972245773362196), ("minute", -1.791759469228055)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2006706954621511,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..twentieth,thirtieth,...)",+ -1.7047480922384253),+ ("ordinal (digits)", -0.2006706954621511)],+ n = 9},+ koData =+ ClassData{prior = -1.7047480922384253,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],+ n = 2}}),+ ("last weekend of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("October", -0.9555114450274363), ("July", -1.8718021769015913),+ ("month", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (number)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),+ ("Sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.5315058290035293,+ unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.12136085700426748),+ ("integer (0..19)", -2.3025850929940455)],+ n = 67},+ koData =+ ClassData{prior = -0.8860508466844369,+ unseen = -3.9318256327243257,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.10536051565782628),+ ("integer (0..19)", -2.8134107167600364),+ ("integer 21..99", -3.2188758248682006)],+ n = 47}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.2578291093020998, unseen = -3.58351893845611,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 34},+ koData =+ ClassData{prior = -1.4816045409242156,+ unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 10}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("SundayMarch", -1.6094379124341003),+ ("MondayMarch", -1.6094379124341003),+ ("Sundayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.1479201300766222,+ unseen = -5.0875963352323845,+ likelihoods =+ HashMap.fromList+ [("week", -2.4423470353692043),+ ("integer (0..19)year (grain)", -3.289644895756408),+ ("integer (numeric)day (grain)", -2.6835090921860925),+ ("integer (0..19)second (grain) ", -3.6951100038645723),+ ("integer (0..19)hour (grain)", -3.001962823304627),+ ("second", -3.289644895756408),+ ("integer (numeric)second (grain) ", -3.982792076316353),+ ("integer (numeric)year (grain)", -3.6951100038645723),+ ("day", -2.4423470353692043), ("year", -2.8841797876482436),+ ("integer (numeric)week (grain)", -3.001962823304627),+ ("integer (0..19)month (grain)", -3.4719664525503626),+ ("hour", -2.5964977151964628), ("month", -3.1354942159291497),+ ("integer (numeric)minute (grain)", -3.1354942159291497),+ ("integer (0..19)minute (grain)", -3.001962823304627),+ ("integer (numeric)month (grain)", -3.982792076316353),+ ("minute", -2.4423470353692043),+ ("integer (numeric)hour (grain)", -3.4719664525503626),+ ("integer (0..19)day (grain)", -3.6951100038645723),+ ("integer (0..19)week (grain)", -3.1354942159291497)],+ n = 69},+ koData =+ ClassData{prior = -1.984131361875511, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("quarter", -3.1135153092103742), ("hour", -1.4087672169719492),+ ("integer (numeric)hour (grain)", -1.4087672169719492),+ ("integer (0..19)quarter (grain)", -3.1135153092103742)],+ n = 11}}),+ ("hhmm (latent)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = -0.2929871246814741,+ unseen = -5.3230099791384085,+ likelihoods =+ HashMap.fromList+ [("integer after|past <hour-of-day>", -3.9318256327243257),+ ("at <time-of-day>", -2.2270775404859005),+ ("from|since|after <time-of-day>", -3.708682081410116),+ ("<time-of-day> o'clock", -4.219507705176107),+ ("half after|past <hour-of-day>", -4.219507705176107),+ ("time-of-day (latent)", -1.7346010553881064),+ ("hhmm (latent)", -4.624972813284271),+ ("hh:mm", -2.2735975561207935),+ ("quarter after|past <hour-of-day>", -4.624972813284271),+ ("about|exactly <time-of-day>", -4.624972813284271),+ ("until <time-of-day>", -3.9318256327243257),+ ("hour", -1.2237754316221157),+ ("<time-of-day> sharp|exactly", -4.624972813284271),+ ("minute", -1.7346010553881064)],+ n = 94},+ koData =+ ClassData{prior = -1.3705460041517514, unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.283414346005772),+ ("from|since|after <time-of-day>", -3.283414346005772),+ ("<hour-of-day> <integer>", -3.6888794541139363),+ ("time-of-day (latent)", -1.0498221244986778),+ ("hour", -1.0147308046874075), ("minute", -2.772588722239781)],+ n = 32}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)ordinal (digits)July", -1.252762968495368),+ ("integer (numeric)integer (numeric)July", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thanksgiving Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("a <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.5753641449035618,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("week", -2.0794415416798357),+ ("year (grain)", -2.772588722239781),+ ("second", -2.772588722239781),+ ("week (grain)", -2.0794415416798357),+ ("day", -2.0794415416798357),+ ("minute (grain)", -2.772588722239781),+ ("year", -2.772588722239781),+ ("second (grain) ", -2.772588722239781),+ ("minute", -2.772588722239781),+ ("day (grain)", -2.0794415416798357)],+ n = 9},+ koData =+ ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -1.7227665977411035),+ ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),+ ("quarter (grain)", -1.9459101490553135)],+ n = 7}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -5.129329438755058e-2,+ unseen = -4.07753744390572,+ likelihoods = HashMap.fromList [("", 0.0)], n = 57},+ koData =+ ClassData{prior = -2.995732273553991, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (first..twentieth,thirtieth,...)",+ Classifier{okData =+ ClassData{prior = -6.899287148695143e-2,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14},+ koData =+ ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("quarter after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.252762968495368),+ ("dayday", -0.8472978603872037),+ ("day (grain)yesterday", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("week", -2.639057329615259),+ ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),+ ("this|last|next <cycle>", -2.639057329615259),+ ("day", -2.2335922215070942),+ ("time-of-day (latent)", -2.639057329615259),+ ("hhmm (latent)", -2.2335922215070942),+ ("<time-of-day> am|pm", -2.639057329615259),+ ("hour", -1.9459101490553135),+ ("next <time>", -2.639057329615259),+ ("this|next <day-of-week>", -2.639057329615259),+ ("minute", -2.2335922215070942)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("dd/mm", -2.0794415416798357), ("day", -2.0794415416798357),+ ("time-of-day (latent)", -2.0794415416798357),+ ("hour", -2.0794415416798357)],+ n = 2}}),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ Classifier{okData =+ ClassData{prior = -0.48130318449966897,+ unseen = -5.170483995038151,+ likelihoods =+ HashMap.fromList+ [("Wednesday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayhour", -3.2188758248682006),+ ("daymonth", -3.2188758248682006),+ ("<named-month> <day-of-month> (non ordinal)Friday",+ -4.471638793363569),+ ("Friday<named-month> <day-of-month> (non ordinal)",+ -3.7784916128036232),+ ("Wednesdayintersect", -4.471638793363569),+ ("Labor Daythis|last|next <cycle>", -4.471638793363569),+ ("Black Fridaythis|last|next <cycle>", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.471638793363569),+ ("<part-of-day> of <time>February", -4.471638793363569),+ ("Saturday<time-of-day> am|pm", -4.471638793363569),+ ("Martin Luther King's Daythis|last|next <cycle>",+ -4.471638793363569),+ ("on <date><time-of-day> am|pm", -4.471638793363569),+ ("hourmonth", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.471638793363569),+ ("dayday", -2.5998366164619773),+ ("the <day-of-month> (ordinal)February", -4.0661736852554045),+ ("WednesdayOctober", -4.471638793363569),+ ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -3.5553480614894135),+ ("dayyear", -2.8622008809294686),+ ("Saturday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.471638793363569),+ ("Thursdayhh:mm", -4.0661736852554045),+ ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),+ ("Memorial Daythis|last|next <cycle>", -4.471638793363569),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("TuesdayOctober", -4.471638793363569),+ ("the <day-of-month> (ordinal)March", -4.471638793363569),+ ("Mondaythis|last|next <cycle>", -4.471638793363569),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.0661736852554045),+ ("Fridayintersect", -4.471638793363569),+ ("Thursday<datetime> - <datetime> (interval)",+ -3.7784916128036232),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.5553480614894135),+ ("Tuesdaythis|last|next <cycle>", -4.471638793363569),+ ("Sunday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayminute", -2.6798793241355137),+ ("intersectyear", -4.471638793363569),+ ("minuteday", -3.5553480614894135),+ ("this|last|next <cycle>Sunday", -4.471638793363569),+ ("Sundaythis|last|next <cycle>", -4.471638793363569),+ ("intersectintersect", -4.471638793363569),+ ("weekday", -4.471638793363569),+ ("dayweek", -3.373026504695459),+ ("Thursday<time-of-day> am|pm", -4.471638793363569),+ ("Monday<named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("<named-month> <day-of-month> (non ordinal)year",+ -4.0661736852554045)],+ n = 55},+ koData =+ ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,+ likelihoods =+ HashMap.fromList+ [("week-endJuly", -4.197201947661808),+ ("week-endOctober", -3.5040547671018634),+ ("daymonth", -1.9999773703255892),+ ("TuesdaySeptember", -4.197201947661808),+ ("Wednesdayintersect", -4.197201947661808),+ ("hourmonth", -3.0985896589936988),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.197201947661808),+ ("Fridaythis|last|next <cycle>", -4.197201947661808),+ ("SundayFebruary", -4.197201947661808),+ ("WednesdayOctober", -4.197201947661808),+ ("week-endintersect", -4.197201947661808),+ ("dayyear", -4.197201947661808),+ ("FridayJuly", -3.791736839553644),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.197201947661808),+ ("FridaySeptember", -4.197201947661808),+ ("WednesdayFebruary", -4.197201947661808),+ ("minutemonth", -3.2809112157876537),+ ("SundayMarch", -4.197201947661808),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.197201947661808),+ ("MondayFebruary", -3.791736839553644),+ ("Fridayintersect", -4.197201947661808),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.791736839553644),+ ("dayminute", -2.810907586541918),+ ("SaturdaySeptember", -4.197201947661808),+ ("intersectSeptember", -3.2809112157876537),+ ("MondayMarch", -4.197201947661808),+ ("on <date>September", -3.791736839553644),+ ("intersectintersect", -4.197201947661808),+ ("Tuesdayintersect", -4.197201947661808),+ ("Sundayintersect", -4.197201947661808)],+ n = 34}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -0.6286086594223742, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("Father's Day", -2.6026896854443837),+ ("Martin Luther King's Day", -2.6026896854443837),+ ("Memorial Day", -2.6026896854443837),+ ("Mother's Day", -2.6026896854443837),+ ("day", -1.2163953243244932), ("Sunday", -2.6026896854443837),+ ("Thanksgiving Day", -2.6026896854443837),+ ("hour", -2.6026896854443837), ("Tuesday", -2.6026896854443837),+ ("week-end", -2.6026896854443837)],+ n = 8},+ koData =+ ClassData{prior = -0.7621400520468967, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Monday", -2.5257286443082556), ("day", -2.120263536200091),+ ("Sunday", -2.5257286443082556), ("hour", -1.4271163556401458),+ ("week-end", -1.4271163556401458)],+ n = 7}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Octoberordinal (digits)", -2.120263536200091),+ ("Thursdayordinal (digits)", -2.5257286443082556),+ ("day", -2.120263536200091),+ ("Augustordinal (digits)", -2.5257286443082556),+ ("Marchordinals (first..twentieth,thirtieth,...)",+ -2.120263536200091),+ ("Tuesdayordinal (digits)", -2.5257286443082556),+ ("month", -1.2729656758128873),+ ("Marchordinal (digits)", -2.5257286443082556)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("from|since|after <time-of-day>ordinal (digits)",+ -1.8718021769015913),+ ("Augustordinal (digits)", -1.8718021769015913),+ ("month", -1.466337068793427)],+ n = 2}}),+ ("Labor Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -2.3025850929940455),+ ("<time-of-day> am|pm", -1.6094379124341003),+ ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),+ ("minute", -1.3862943611198906)],+ n = 6},+ koData =+ ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.7227665977411035),+ ("yesterday", -2.2335922215070942),+ ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),+ ("hour", -2.639057329615259), ("minute", -1.252762968495368)],+ n = 10}}),+ ("dd.mm.yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after|before|from <time>",+ Classifier{okData =+ ClassData{prior = -0.35667494393873245,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("a <unit-of-duration>now", -2.70805020110221),+ ("a <unit-of-duration>Christmas", -2.70805020110221),+ ("<integer> <unit-of-duration>today", -2.70805020110221),+ ("daysecond", -2.70805020110221),+ ("a <unit-of-duration>right now", -2.70805020110221),+ ("minutenograin", -2.70805020110221),+ ("<integer> <unit-of-duration>Christmas", -2.70805020110221),+ ("secondnograin", -2.70805020110221),+ ("yearday", -2.0149030205422647),+ ("daynograin", -2.70805020110221),+ ("<integer> <unit-of-duration>now", -2.3025850929940455)],+ n = 7},+ koData =+ ClassData{prior = -1.2039728043259361,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -2.3978952727983707),+ ("dayday", -1.9924301646902063),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -2.3978952727983707)],+ n = 3}}),+ ("Independence Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("Martin Luther King's Day", -2.803360380906535),+ ("Halloween", -2.803360380906535),+ ("Wednesday", -2.803360380906535),+ ("Memorial Day", -2.803360380906535),+ ("Monday", -2.803360380906535),+ ("Mother's Day", -2.803360380906535),+ ("day", -1.0986122886681098),+ ("Thanksgiving Day", -2.803360380906535),+ ("March", -2.803360380906535), ("month", -2.803360380906535),+ ("Tuesday", -2.1102132003465894)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> sharp|exactly",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.1400661634962708),+ ("time-of-day (latent)", -2.1400661634962708),+ ("hhmm (latent)", -2.1400661634962708),+ ("<time-of-day> am|pm", -2.1400661634962708),+ ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),+ ("minute", -1.4469189829363254)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -7.696104113612832e-2),+ ("integer (0..19)", -2.6026896854443837)],+ n = 25}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("half an hour", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> before last|after next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("Wednesday", -1.8718021769015913),+ ("Friday", -1.466337068793427), ("day", -1.1786549963416462),+ ("March", -1.8718021769015913), ("month", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("this|last|next <cycle>", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hhmm (military) am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.3794896217049037, unseen = -4.304065093204169,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -3.1918471524802814),+ ("intersect<time-of-day> am|pm", -3.1918471524802814),+ ("minuteminute", -1.457246097092175),+ ("hh:mmhh:mm", -2.093234863812172),+ ("dayday", -3.1918471524802814),+ ("hourhour", -2.093234863812172),+ ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -3.597312260588446),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.597312260588446),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.681021528714291),+ ("from|since|after <time-of-day>hh:mm", -2.681021528714291)],+ n = 26},+ koData =+ ClassData{prior = -1.1526795099383855, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -3.1135153092103742),+ ("daymonth", -2.70805020110221),+ ("from|since|after <time-of-day>intersect", -2.70805020110221),+ ("<time-of-day> am|pmintersect", -3.1135153092103742),+ ("hh:mm<time-of-day> am|pm", -2.70805020110221),+ ("minuteminute", -1.8607523407150064),+ ("hourhour", -2.70805020110221),+ ("minutehour", -2.70805020110221),+ ("hh:mmintersect", -2.1972245773362196),+ ("<named-month> <day-of-month> (non ordinal)August",+ -3.1135153092103742),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.1135153092103742)],+ n = 12}}),+ ("Tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Day",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("fortnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> and an half hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <named-month>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -1.252762968495368), ("March", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -0.8472978603872037),+ ("month", -0.8472978603872037)],+ n = 2}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.7375989431307791, unseen = -4.110873864173311,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.529395204760564),+ ("hh:mmhh:mm", -1.8971199848858813),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -2.4849066497880004),+ ("hourhour", -1.6964492894237302),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -3.4011973816621555),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.4011973816621555),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.4849066497880004),+ ("from|since|after <time-of-day>hh:mm", -2.4849066497880004)],+ n = 22},+ koData =+ ClassData{prior = -0.6505875661411494, unseen = -4.174387269895637,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>time-of-day (latent)",+ -3.4657359027997265),+ ("hh:mmtime-of-day (latent)", -1.7609878105613013),+ ("hh:mm<time-of-day> am|pm", -3.0602707946915624),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -3.4657359027997265),+ ("at <time-of-day><time-of-day> am|pm", -3.4657359027997265),+ ("hourhour", -2.2129729343043585),+ ("minutehour", -1.2144441041932315),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.4657359027997265),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -2.5494451709255714),+ ("at <time-of-day>time-of-day (latent)", -3.0602707946915624),+ ("<integer> to|till|before <hour-of-day>time-of-day (latent)",+ -3.0602707946915624)],+ n = 24}}),+ ("military spelled out numbers am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods =+ HashMap.fromList [("integer (0..19)integer (20..90)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",+ -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -0.42121346507630353,+ unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.5455312716044354),+ ("Marchinteger (numeric)", -2.833213344056216),+ ("Aprilinteger (numeric)", -3.2386784521643803),+ ("month", -0.8407831793660099),+ ("Februaryinteger (numeric)", -1.9859154836690123),+ ("Septemberinteger (numeric)", -2.833213344056216),+ ("Octoberinteger (numeric)", -2.833213344056216),+ ("Julyinteger (numeric)", -2.1400661634962708)],+ n = 21},+ koData =+ ClassData{prior = -1.067840630001356, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.3353749158170367),+ ("Marchinteger (numeric)", -2.740840023925201),+ ("Aprilinteger (numeric)", -2.740840023925201),+ ("month", -0.9490805546971459),+ ("from|since|after <time-of-day>integer (numeric)",+ -2.3353749158170367),+ ("Julyinteger (numeric)", -1.6422277352570913)],+ n = 11}}),+ ("this|next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.2512917986064953),+ ("Wednesday", -2.2512917986064953),+ ("Monday", -1.845826690498331), ("day", -0.8649974374866046),+ ("Tuesday", -1.55814461804655)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5553480614894135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 33},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.791759469228055),+ ("daymonth", -1.2809338454620642),+ ("day (grain)intersect", -1.791759469228055),+ ("weekmonth", -1.791759469228055),+ ("week (grain)intersect", -2.1972245773362196),+ ("week (grain)September", -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)April", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Black Friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Labor Day",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("right now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -1.5040773967762742),+ ("dayday", -1.0986122886681098),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -1.5040773967762742)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.252762968495368),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -1.252762968495368)],+ n = 1}}),+ ("between <time> and <time>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0116009116784799),+ ("hh:mmhh:mm", -1.0116009116784799)],+ n = 3},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.4469189829363254),+ ("minuteminute", -1.4469189829363254),+ ("minutehour", -1.4469189829363254),+ ("hh:mmintersect", -1.4469189829363254)],+ n = 6}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6422277352570913),+ ("from|since|after <time-of-day>ordinal (digits)ordinal (digits)",+ -2.740840023925201),+ ("from|since|after <time-of-day>integer (numeric)integer (numeric)",+ -2.740840023925201),+ ("from|since|after <time-of-day>ordinal (digits)integer (numeric)",+ -2.740840023925201),+ ("Augustordinal (digits)integer (numeric)",+ -2.3353749158170367),+ ("month", -0.8690378470236094),+ ("Augustordinal (digits)ordinal (digits)",+ -2.3353749158170367)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of days",+ Classifier{okData =+ ClassData{prior = -4.0821994520255166e-2,+ unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -3.2188758248682006,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)September",+ -1.791759469228055),+ ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),+ ("ordinal (digits)ordinal (digits)October",+ -2.1972245773362196),+ ("integer (numeric)integer (numeric)July", -2.1972245773362196),+ ("month", -0.9444616088408514),+ ("ordinal (digits)ordinal (digits)August",+ -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.5257286443082556),+ ("Martin Luther King's Day", -2.5257286443082556),+ ("Monday", -2.5257286443082556), ("day", -1.1394342831883648),+ ("Thanksgiving Day", -2.5257286443082556),+ ("hour", -2.5257286443082556), ("winter", -2.5257286443082556),+ ("week-end", -2.5257286443082556),+ ("summer", -2.120263536200091)],+ n = 8}, koData = ClassData{prior = -infinity, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [], n = 0}}),
Duckling/Ranking/Classifiers/EN_US.hs view
@@ -40,2306 +40,2371 @@ n = 7}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hh:mm", -1.7047480922384253), ("hour", -1.2992829841302609),- ("minute", -1.7047480922384253)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thursday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods = HashMap.fromList [("", 0.0)], n = 18},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (numeric)",- Classifier{okData =- ClassData{prior = -0.7740538191727457, unseen = -5.19295685089021,- likelihoods = HashMap.fromList [("", 0.0)], n = 178},- koData =- ClassData{prior = -0.6182992897635128,- unseen = -5.3471075307174685,- likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),- ("<duration> hence|ago",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.784189633918261,- likelihoods =- HashMap.fromList- [("week", -1.563975538357343), ("day", -1.8152899666382492),- ("year", -2.662587827025453),- ("<integer> <unit-of-duration>", -1.0531499145913523),- ("a <unit-of-duration>", -2.662587827025453),- ("month", -2.662587827025453),- ("fortnight", -2.662587827025453)],- n = 18},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("noon|midnight|EOD|end of day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter to|till|before <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Father's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<cycle> after|before <time>",- Classifier{okData =- ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.6094379124341003),- ("dayday", -1.0986122886681098),- ("day (grain)yesterday", -1.6094379124341003)],- n = 4},- koData =- ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("dayhour", -1.466337068793427),- ("year (grain)Christmas", -1.8718021769015913),- ("day (grain)intersect", -1.466337068793427),- ("yearday", -1.8718021769015913)],- n = 3}}),- ("Martin Luther King's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (20..90)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/yyyy",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("integer after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("hour", -0.8109302162163288),- ("integer (numeric)time-of-day (latent)", -1.0986122886681098),- ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal or number) <named-month>",- Classifier{okData =- ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("ordinal (digits)December", -2.1400661634962708),- ("ordinal (digits)February", -2.1400661634962708),- ("integer (numeric)April", -2.1400661634962708),- ("month", -1.4469189829363254)],- n = 3},- koData =- ClassData{prior = -0.2876820724517809,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("ordinal (digits)October", -2.6741486494265287),- ("ordinal (digits)July", -2.6741486494265287),- ("integer (numeric)September", -2.268683541318364),- ("ordinal (digits)August", -2.6741486494265287),- ("integer (numeric)August", -2.6741486494265287),- ("ordinal (digits)April", -2.6741486494265287),- ("month", -1.0647107369924282),- ("integer (numeric)July", -2.268683541318364)],- n = 9}}),- ("<time> <part-of-day>",- Classifier{okData =- ClassData{prior = -9.844007281325252e-2,- unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("<day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("dayhour", -1.5284688499004333),- ("Mondayearly morning", -3.3202283191284883),- ("time-of-day (latent)tonight", -3.3202283191284883),- ("hourhour", -2.339399066116762),- ("<time-of-day> o'clockin|during the <part-of-day>",- -3.7256934272366524),- ("todaypart of days", -3.7256934272366524),- ("minutehour", -2.627081138568543),- ("at <time-of-day>in|during the <part-of-day>",- -3.3202283191284883),- ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),- ("Mondayin|during the <part-of-day>", -3.7256934272366524),- ("intersectpart of days", -3.7256934272366524),- ("intersectin|during the <part-of-day>", -3.7256934272366524),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -3.7256934272366524),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("tomorrowpart of days", -2.339399066116762),- ("hh:mmin|during the <part-of-day>", -3.0325462466767075),- ("time-of-day (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("hhmm (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("yesterdaypart of days", -3.7256934272366524),- ("Mondaypart of days", -3.7256934272366524)],- n = 29},- koData =- ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,- likelihoods =- HashMap.fromList- [("yearhour", -2.740840023925201),- ("monthhour", -2.740840023925201),- ("hourhour", -2.740840023925201),- ("past year (latent)in|during the <part-of-day>",- -2.740840023925201),- ("Februaryin|during the <part-of-day>", -2.740840023925201),- ("time-of-day (latent)in|during the <part-of-day>",- -2.740840023925201)],- n = 3}}),- ("today",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd",- Classifier{okData =- ClassData{prior = -1.4271163556401458,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,- likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),- ("at <time-of-day>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -4.787491742782046,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -3.6805112044434196),- ("integer after|past <hour-of-day>", -3.6805112044434196),- ("half after|past <hour-of-day>", -4.085976312551584),- ("time-of-day (latent)", -1.7346010553881064),- ("hhmm (latent)", -3.392829131991639),- ("<time-of-day> am|pm", -1.7833912195575383),- ("hh:mm", -3.169685580677429),- ("about|exactly <time-of-day>", -3.6805112044434196),- ("hour", -1.1415373333851437),- ("<time-of-day> sharp|exactly", -4.085976312551584),- ("minute", -1.8887517352153647)],- n = 54},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.1895840668738362),- ("hour", -1.1895840668738362)],- n = 6}}),- ("December",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("absorption of , after named day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("on <date>", -2.1972245773362196),- ("Wednesday", -2.6026896854443837),- ("Saturday", -2.6026896854443837),- ("Monday", -2.1972245773362196),- ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),- ("Sunday", -2.6026896854443837)],- n = 10},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("September",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("tonight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the ides of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("on <date>",- Classifier{okData =- ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,- likelihoods =- HashMap.fromList- [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),- ("absorption of , after named day", -2.890371757896165),- ("intersect", -2.890371757896165),- ("Saturday", -2.6026896854443837),- ("Friday", -3.295836866004329), ("day", -0.8979415932059586),- ("the <day-of-month> (ordinal)", -2.890371757896165),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -2.6026896854443837),- ("hour", -3.295836866004329)],- n = 22},- koData =- ClassData{prior = -1.8718021769015913,- unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("intersect", -1.791759469228055), ("day", -1.2809338454620642),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.791759469228055)],- n = 4}}),- ("integer (0..19)",- Classifier{okData =- ClassData{prior = -2.409755157906053e-2,- unseen = -3.7612001156935624,- likelihoods = HashMap.fromList [("", 0.0)], n = 41},- koData =- ClassData{prior = -3.7376696182833684,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("between <time-of-day> and <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("minuteminute", -0.916290731874155),- ("hh:mmhh:mm", -0.916290731874155)],- n = 3},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -0.916290731874155),- ("minutehour", -0.916290731874155)],- n = 3}}),- ("Halloween",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),- ("Augustordinal (digits)integer (numeric)",- -1.6094379124341003),- ("month", -0.916290731874155),- ("Augustordinal (digits)ordinal (digits)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("October",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("month (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> more <unit-of-duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("integer (numeric)minute (grain)", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> o'clock",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("in|within|after <duration>",- Classifier{okData =- ClassData{prior = -4.652001563489282e-2,- unseen = -4.61512051684126,- likelihoods =- HashMap.fromList- [("week", -3.2188758248682006),- ("<integer> more <unit-of-duration>", -3.912023005428146),- ("three-quarters of an hour", -2.995732273553991),- ("<integer> + '\"", -3.2188758248682006),- ("number.number hours", -3.912023005428146),- ("second", -3.506557897319982), ("day", -3.2188758248682006),- ("half an hour", -2.995732273553991),- ("<integer> <unit-of-duration>", -1.6094379124341003),- ("a <unit-of-duration>", -2.995732273553991),- ("quarter of an hour", -2.995732273553991),- ("hour", -2.5257286443082556),- ("about|exactly <duration>", -3.912023005428146),- ("<integer> and an half hour", -3.912023005428146),- ("minute", -1.2729656758128873)],- n = 42},- koData =- ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("quarter", -1.8971199848858813),- ("<integer> <unit-of-duration>", -2.3025850929940455),- ("a <unit-of-duration>", -2.3025850929940455)],- n = 2}}),- ("three-quarters of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Wednesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> + '\"",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half <integer> (UK style hour-of-day)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("July",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hour (grain)",- Classifier{okData =- ClassData{prior = -0.8209805520698302,- unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),- ("<ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -1.1786549963416462),- ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",- -1.466337068793427),- ("quarter", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.8109302162163288),- ("quarter", -0.8109302162163288)],- n = 3}}),- ("one twenty two",- Classifier{okData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)", -0.3364722366212129),- ("integer (0..19)integer (20..90)", -1.252762968495368)],- n = 5}}),- ("intersect",- Classifier{okData =- ClassData{prior = -0.4634795031687923, unseen = -6.169610732491456,- likelihoods =- HashMap.fromList- [("<datetime> - <datetime> (interval)on <date>",- -4.558078578454241),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.558078578454241),- ("hourday", -3.769621218089971),- ("dayhour", -3.223077511721901),- ("daymonth", -4.781222129768451),- ("monthday", -5.0689042022202315),- ("monthyear", -3.8649313978942956),- ("Tuesdaythe <day-of-month> (ordinal)", -5.474369310328396),- ("Christmasyear", -5.474369310328396),- ("from <datetime> - <datetime> (interval)July",- -5.474369310328396),- ("houryear", -5.474369310328396),- ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.781222129768451),- ("<time-of-day> am|pmintersect", -4.221606341833028),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -5.474369310328396),- ("Marchyear", -5.474369310328396),- ("<named-month>|<named-day> <day-of-month> (ordinal)year",- -5.0689042022202315),- ("intersect<time-of-day> am|pm", -5.474369310328396),- ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.474369310328396),- ("monthhour", -5.0689042022202315),- ("last <day-of-week> of <time>year", -5.474369310328396),- ("todayat <time-of-day>", -5.474369310328396),- ("Thursday<time> timezone", -5.0689042022202315),- ("this <time>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("dayday", -3.459466289786131),- ("Thanksgiving Dayyear", -4.375757021660286),- ("<time> <part-of-day>at <time-of-day>", -5.474369310328396),- ("Tuesdayin <named-month>", -5.474369310328396),- ("mm/ddat <time-of-day>", -5.474369310328396),- ("tonightat <time-of-day>", -5.474369310328396),- ("<time-of-day> am|pmabsorption of , after named day",- -4.781222129768451),- ("today<time-of-day> am|pm", -5.474369310328396),- ("Februarythe <day-of-month> (ordinal)", -5.0689042022202315),- ("at <time-of-day><time> <part-of-day>", -5.474369310328396),- ("mm/dd<time-of-day> am|pm", -5.474369310328396),- ("hourhour", -4.221606341833028),- ("<time-of-day> am|pmon <date>", -3.459466289786131),- ("Wednesdaythis|last|next <cycle>", -5.474369310328396),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.970291913552122),- ("dayyear", -3.0320222749591914),- ("last weekend of <named-month>year", -5.474369310328396),- ("<time-of-day> o'clockin|during the <part-of-day>",- -5.474369310328396),- ("<time-of-day> am|pmtomorrow", -4.781222129768451),- ("minutehour", -4.558078578454241),- ("Mother's Dayyear", -5.474369310328396),- ("at <time-of-day>in|during the <part-of-day>",- -5.0689042022202315),- ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -3.769621218089971),- ("for <duration> from <time>December", -5.474369310328396),- ("tomorrow<time-of-day> sharp|exactly", -5.474369310328396),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.558078578454241),- ("on <date><named-month> <day-of-month> (non ordinal)",- -5.0689042022202315),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.558078578454241),- ("Mondayin|during the <part-of-day>", -5.474369310328396),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.0689042022202315),- ("intersectin|during the <part-of-day>", -5.474369310328396),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -5.474369310328396),- ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.781222129768451),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -4.558078578454241),- ("at <time-of-day>intersect", -5.0689042022202315),- ("<time-of-day> - <time-of-day> (interval)tomorrow",- -5.474369310328396),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.474369310328396),- ("dayminute", -3.1717842173343502),- ("from <datetime> - <datetime> (interval)on <date>",- -5.0689042022202315),- ("<datetime> - <datetime> (interval)tomorrow",- -5.474369310328396),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.0689042022202315),- ("<ordinal> <cycle> of <time>year", -5.474369310328396),- ("minuteday", -2.0731719286662407),- ("absorption of , after named dayintersect",- -5.474369310328396),- ("Octoberyear", -4.221606341833028),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -5.474369310328396),- ("at <time-of-day>absorption of , after named day",- -5.474369310328396),- ("<day-of-month> (ordinal or number) <named-month>year",- -5.474369310328396),- ("year<time-of-day> am|pm", -5.474369310328396),- ("Septemberyear", -5.0689042022202315),- ("at <time-of-day>on <date>", -4.375757021660286),- ("between <time-of-day> and <time-of-day> (interval)on <date>",- -4.781222129768451),- ("Halloweenyear", -5.474369310328396),- ("dayweek", -5.474369310328396),- ("weekyear", -5.0689042022202315),- ("hh:mmin|during the <part-of-day>", -4.781222129768451),- ("Father's Dayyear", -5.474369310328396),- ("<cycle> after|before <time><time-of-day> am|pm",- -5.0689042022202315),- ("February<time> <part-of-day>", -5.474369310328396),- ("Martin Luther King's Dayyear", -5.0689042022202315),- ("tomorrowat <time-of-day>", -4.781222129768451),- ("between <time> and <time>on <date>", -4.781222129768451),- ("at <time-of-day>tomorrow", -5.0689042022202315),- ("tomorrow<time-of-day> am|pm", -5.474369310328396),- ("in|during the <part-of-day>at <time-of-day>",- -5.474369310328396),- ("black fridayyear", -5.0689042022202315),- ("Labor Dayyear", -5.474369310328396),- ("Februaryintersect", -5.474369310328396),- ("last <cycle> of <time>year", -4.781222129768451),- ("<named-month> <day-of-month> (non ordinal)year",- -5.474369310328396),- ("yearminute", -5.474369310328396)],- n = 173},- koData =- ClassData{prior = -0.9917982843823002, unseen = -5.817111159963204,- likelihoods =- HashMap.fromList- [("in <named-month>year", -5.120983351265121),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -5.120983351265121),- ("hourday", -5.120983351265121),- ("<named-month> <day-of-month> (non ordinal)July",- -5.120983351265121),- ("dayhour", -3.329223882037066),- ("daymonth", -3.041541809585285),- ("monthday", -4.715518243156957),- ("monthyear", -4.427836170705175),- ("intersecthh:mm", -5.120983351265121),- ("from <datetime> - <datetime> (interval)July",- -5.120983351265121),- ("houryear", -5.120983351265121),- ("from <time-of-day> - <time-of-day> (interval)July",- -5.120983351265121),- ("until <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.427836170705175),- ("<time-of-day> am|pmintersect", -3.868220382769753),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.204692619390966),- ("Tuesdayafter <time-of-day>", -5.120983351265121),- ("July<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("absorption of , after named dayJuly", -4.715518243156957),- ("monthhour", -5.120983351265121),- ("hourmonth", -4.427836170705175),- ("todayat <time-of-day>", -5.120983351265121),- ("dayday", -4.715518243156957),- ("mm/ddat <time-of-day>", -4.715518243156957),- ("<time-of-day> am|pmon <date>", -3.868220382769753),- ("dayyear", -3.868220382769753),- ("Thursdaymm/dd", -5.120983351265121),- ("Thursdayat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>September",- -5.120983351265121),- ("monthminute", -5.120983351265121),- ("<time-of-day> am|pmtomorrow", -5.120983351265121),- ("Thursdayhh:mm", -5.120983351265121),- ("August<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("Fridayyear", -4.715518243156957),- ("minutemonth", -3.416235259026696),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.715518243156957),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("Aprilyear", -5.120983351265121),- ("mm/dd<time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.120983351265121),- ("<duration> after|before|from <time>December",- -5.120983351265121),- ("yesterday<time-of-day> am|pm", -5.120983351265121),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -4.204692619390966),- ("<named-month> <day-of-month> (non ordinal)August",- -5.120983351265121),- ("until <time-of-day>on <date>", -4.427836170705175),- ("at <time-of-day>intersect", -4.715518243156957),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("dayminute", -3.175073202209808),- ("intersectSeptember", -3.616905954488847),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("minuteday", -2.317622970358586),- ("absorption of , after named dayintersect",- -5.120983351265121),- ("Februaryin|during the <part-of-day>", -5.120983351265121),- ("week-endin <named-month>", -5.120983351265121),- ("Octoberyear", -5.120983351265121),- ("yearhh:mm", -5.120983351265121),- ("hh:mmon <date>", -3.616905954488847),- ("absorption of , after named daySeptember",- -4.204692619390966),- ("on <date>September", -4.715518243156957),- ("at <time-of-day>on <date>", -4.715518243156957),- ("absorption of , after named dayFebruary", -4.204692619390966),- ("July<integer> to|till|before <hour-of-day>",- -5.120983351265121),- ("tomorrowat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>July",- -5.120983351265121),- ("tomorrow<time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day>year", -5.120983351265121),- ("yearminute", -5.120983351265121)],- n = 102}}),- ("after lunch/work/school",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("early morning",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <number> (implicit minutes)",- Classifier{okData =- ClassData{prior = -1.041453874828161, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.5596157879354228),- ("integer (0..19)", -0.8472978603872037)],- n = 12},- koData =- ClassData{prior = -0.4353180712578455,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.3448404862917295),- ("integer (0..19)", -1.2321436812926323)],- n = 22}}),- ("<ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("daymonth", -2.0149030205422647),- ("quarteryear", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)day (grain)October",- -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",- -2.0149030205422647),- ("weekmonth", -1.6094379124341003),- ("ordinal (digits)quarter (grain)year", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)October",- -2.0149030205422647)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("year (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods = HashMap.fromList [("", 0.0)], n = 21},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.6375861597263857,- likelihoods =- HashMap.fromList- [("minuteminute", -2.001480000210124),- ("<day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("hh:mmhh:mm", -2.001480000210124),- ("dayday", -2.512305623976115),- ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),- ("hourhour", -2.512305623976115),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.912023005428146,- likelihoods =- HashMap.fromList- [("hourday", -3.1986731175506815),- ("dayhour", -2.793208009442517),- ("<day-of-month> (ordinal)time-of-day (latent)",- -3.1986731175506815),- ("hh:mmtime-of-day (latent)", -2.2823823856765264),- ("minuteminute", -2.793208009442517),- ("time-of-day (latent)time-of-day (latent)",- -2.793208009442517),- ("dayday", -3.1986731175506815),- ("hourhour", -2.505525936990736),- ("dayyear", -3.1986731175506815),- ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",- -3.1986731175506815),- ("minutehour", -2.2823823856765264),- ("hh:mmintersect", -2.793208009442517),- ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("time-of-day (latent)<time-of-day> am|pm",- -3.1986731175506815),- ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",- -3.1986731175506815)],- n = 14}}),- ("Saturday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",- -1.7346010553881064),- ("weekmonth", -1.7346010553881064),- ("week (grain)October", -1.7346010553881064),- ("week (grain)<named-month> <day-of-month> (non ordinal)",- -1.7346010553881064),- ("weekday", -1.2237754316221157)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("number.number hours",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("minuteminute", -1.6094379124341003),- ("hh:mmhh:mm", -1.6094379124341003),- ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),- ("hourhour", -2.3025850929940455),- ("hourminute", -2.3025850929940455),- ("time-of-day (latent)<time-of-day> sharp|exactly",- -2.70805020110221),- ("time-of-day (latent)hh:mm", -2.70805020110221),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],- n = 9},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.6094379124341003),- ("time-of-day (latent)time-of-day (latent)",- -2.0149030205422647),- ("hourhour", -1.791759469228055),- ("minutehour", -1.6094379124341003),- ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],- n = 9}}),- ("integer 21..99",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods =- HashMap.fromList [("integer (numeric)integer (numeric)", 0.0)],- n = 2}}),- ("last|next n <cycle>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("week", -2.627081138568543),- ("integer (0..19)year (grain)", -3.3202283191284883),- ("integer (numeric)day (grain)", -3.0325462466767075),- ("integer (0..19)second (grain) ", -3.3202283191284883),- ("integer (0..19)hour (grain)", -3.3202283191284883),- ("second", -2.8094026953624978),- ("integer (numeric)second (grain) ", -3.3202283191284883),- ("integer (numeric)year (grain)", -3.3202283191284883),- ("day", -2.472930458741285), ("year", -2.8094026953624978),- ("integer (numeric)week (grain)", -3.0325462466767075),- ("integer (0..19)month (grain)", -3.3202283191284883),- ("hour", -2.8094026953624978), ("month", -2.8094026953624978),- ("integer (numeric)minute (grain)", -3.3202283191284883),- ("integer (0..19)minute (grain)", -3.3202283191284883),- ("integer (numeric)month (grain)", -3.3202283191284883),- ("minute", -2.8094026953624978),- ("integer (numeric)hour (grain)", -3.3202283191284883),- ("integer (0..19)day (grain)", -3.0325462466767075),- ("integer (0..19)week (grain)", -3.3202283191284883)],- n = 31},- koData =- ClassData{prior = -infinity, unseen = -3.0910424533583156,- likelihoods = HashMap.fromList [], n = 0}}),- ("yyyy-mm-dd",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd/yyyy",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -1.6094379124341003,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("Monday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("yesterday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<ordinal> quarter <year>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh:mm:ss",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<hour-of-day> <integer>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("at <time-of-day>integer (20..90)", -1.3862943611198906),- ("hour", -0.9808292530117262),- ("at <time-of-day>integer (numeric)", -1.3862943611198906)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>integer (numeric)",- -1.0986122886681098),- ("hour", -1.0986122886681098)],- n = 1}}),- ("nth <time> of <time>",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("daymonth", -0.9808292530117262),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -2.0794415416798357),- ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",- -1.6739764335716716),- ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",- -1.6739764335716716)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.5649493574615367,- likelihoods =- HashMap.fromList- [("daymonth", -1.0986122886681098),- ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",- -1.791759469228055),- ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",- -1.3862943611198906)],- n = 3}}),- ("Valentine's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("April",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("end of month",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("week (grain)",- Classifier{okData =- ClassData{prior = -8.004270767353637e-2,- unseen = -3.6375861597263857,- likelihoods = HashMap.fromList [("", 0.0)], n = 36},- koData =- ClassData{prior = -2.5649493574615367,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("<part-of-day> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",- -1.6094379124341003),- ("hourday", -0.916290731874155),- ("part of daysthe <day-of-month> (ordinal)",- -1.6094379124341003),- ("part of daysthe <day-of-month> (number)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("past year (latent)",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 2}}),- ("now",- Classifier{okData =- ClassData{prior = -0.15415067982725836,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -1.9459101490553135,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("<day-of-month> (ordinal or number) of <named-month>",- Classifier{okData =- ClassData{prior = -0.13353139262452263,- unseen = -3.0910424533583156,- likelihoods =- HashMap.fromList- [("ordinal (digits)July", -2.3513752571634776),- ("ordinals (first..twentieth,thirtieth,...)March",- -2.3513752571634776),- ("ordinal (digits)February", -2.3513752571634776),- ("integer (numeric)February", -1.9459101490553135),- ("month", -0.9650808960435872),- ("ordinal (digits)March", -2.3513752571634776),- ("integer (numeric)July", -2.3513752571634776)],- n = 7},- koData =- ClassData{prior = -2.0794415416798357,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)February", -1.5040773967762742),- ("month", -1.5040773967762742)],- n = 1}}),- ("this <part-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("hour", -0.6931471805599453),- ("part of days", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Friday",- Classifier{okData =- ClassData{prior = -0.3677247801253174,- unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("in|during the <part-of-day>",- Classifier{okData =- ClassData{prior = -8.701137698962981e-2,- unseen = -3.258096538021482,- likelihoods =- HashMap.fromList- [("early morning", -2.5257286443082556),- ("hour", -0.7339691750802004),- ("part of days", -0.8209805520698302)],- n = 11},- koData =- ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("hour", -0.916290731874155),- ("part of days", -0.916290731874155)],- n = 1}}),- ("tomorrow",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh(:mm) - <time-of-day> am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("this|last|next <cycle>",- Classifier{okData =- ClassData{prior = -0.15822400521489416,- unseen = -4.394449154672439,- likelihoods =- HashMap.fromList- [("week", -1.5488132906176655),- ("month (grain)", -2.995732273553991),- ("year (grain)", -1.817077277212345),- ("week (grain)", -1.5488132906176655),- ("quarter", -2.772588722239781), ("year", -1.817077277212345),- ("month", -2.995732273553991),- ("quarter (grain)", -2.772588722239781)],- n = 35},- koData =- ClassData{prior = -1.9218125974762528,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("week", -1.4816045409242156),- ("week (grain)", -1.4816045409242156),- ("day", -1.9924301646902063),- ("day (grain)", -1.9924301646902063)],- n = 6}}),- ("Mother's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Eve",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("by <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -2.1972245773362196),- ("end of month", -2.1972245773362196),- ("time-of-day (latent)", -2.1972245773362196),- ("<time-of-day> am|pm", -2.1972245773362196),- ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),- ("month", -2.1972245773362196), ("minute", -1.791759469228055)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [], n = 0}}),- ("half an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.2006706954621511,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("ordinals (first..twentieth,thirtieth,...)",- -1.7047480922384253),- ("ordinal (digits)", -0.2006706954621511)],- n = 9},- koData =- ClassData{prior = -1.7047480922384253,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],- n = 2}}),- ("last weekend of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("October", -0.9555114450274363), ("July", -1.8718021769015913),- ("month", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (number)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("fractional number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),- ("Sunday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("February",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods = HashMap.fromList [("", 0.0)], n = 13},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("minute (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1}}),- ("time-of-day (latent)",- Classifier{okData =- ClassData{prior = -0.5363047090669756, unseen = -4.174387269895637,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.1158318155251217),- ("integer (0..19)", -2.2129729343043585)],- n = 62},- koData =- ClassData{prior = -0.8792494601938059,- unseen = -3.8501476017100584,- likelihoods =- HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)],- n = 44}}),- ("year",- Classifier{okData =- ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 34},- koData =- ClassData{prior = -1.6582280766035324,- unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 8}}),- ("last <day-of-week> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("daymonth", -0.916290731874155),- ("SundayMarch", -1.6094379124341003),- ("MondayMarch", -1.6094379124341003),- ("Sundayintersect", -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.7444404749474959, unseen = -4.605170185988091,- likelihoods =- HashMap.fromList- [("week", -2.3978952727983707),- ("integer (0..19)year (grain)", -3.2088254890146994),- ("integer (numeric)day (grain)", -2.515678308454754),- ("integer (0..19)second (grain) ", -3.9019726695746444),- ("integer (0..19)hour (grain)", -2.803360380906535),- ("second", -3.9019726695746444),- ("integer (numeric)year (grain)", -3.9019726695746444),- ("day", -2.515678308454754), ("year", -2.9856819377004897),- ("integer (numeric)week (grain)", -2.9856819377004897),- ("integer (0..19)month (grain)", -3.4965075614664802),- ("hour", -2.515678308454754), ("month", -3.4965075614664802),- ("integer (numeric)minute (grain)", -2.9856819377004897),- ("integer (0..19)minute (grain)", -2.803360380906535),- ("minute", -2.2925347571405443),- ("integer (numeric)hour (grain)", -3.4965075614664802),- ("integer (0..19)week (grain)", -2.9856819377004897)],- n = 38},- koData =- ClassData{prior = -0.6443570163905132, unseen = -4.68213122712422,- likelihoods =- HashMap.fromList- [("week", -2.8810693652338513),- ("integer (0..19)year (grain)", -3.5742165457937967),- ("integer (numeric)day (grain)", -3.2865344733420154),- ("integer (0..19)second (grain) ", -3.5742165457937967),- ("integer (0..19)hour (grain)", -3.5742165457937967),- ("second", -3.0633909220278057),- ("integer (numeric)second (grain) ", -3.5742165457937967),- ("integer (numeric)year (grain)", -3.5742165457937967),- ("day", -2.7269186854065928), ("quarter", -3.979681653901961),- ("year", -3.0633909220278057),- ("integer (numeric)week (grain)", -3.2865344733420154),- ("integer (0..19)month (grain)", -3.5742165457937967),- ("hour", -1.9647786333596962), ("month", -3.0633909220278057),- ("integer (numeric)minute (grain)", -3.5742165457937967),- ("integer (0..19)minute (grain)", -3.5742165457937967),- ("integer (numeric)month (grain)", -3.5742165457937967),- ("minute", -3.0633909220278057),- ("integer (numeric)hour (grain)", -2.1078794770003695),- ("integer (0..19)day (grain)", -3.2865344733420154),- ("integer (0..19)week (grain)", -3.5742165457937967),- ("integer (0..19)quarter (grain)", -3.979681653901961)],- n = 42}}),- ("hhmm (latent)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> am|pm",- Classifier{okData =- ClassData{prior = -0.2847365622220242, unseen = -5.231108616854587,- likelihoods =- HashMap.fromList- [("integer after|past <hour-of-day>", -3.8394523125933104),- ("at <time-of-day>", -2.2300144001592104),- ("<time-of-day> o'clock", -4.127134385045092),- ("half after|past <hour-of-day>", -4.127134385045092),- ("time-of-day (latent)", -1.7600107709134747),- ("hhmm (latent)", -4.532599493153256),- ("hh:mm", -2.181224235989778),- ("quarter after|past <hour-of-day>", -4.532599493153256),- ("about|exactly <time-of-day>", -4.532599493153256),- ("until <time-of-day>", -3.8394523125933104),- ("hour", -1.2939210409888755),- ("<time-of-day> sharp|exactly", -4.532599493153256),- ("minute", -1.6422277352570913),- ("after <time-of-day>", -4.532599493153256)],- n = 85},- koData =- ClassData{prior = -1.3951833085371366, unseen = -4.290459441148391,- likelihoods =- HashMap.fromList- [("<integer> to|till|before <hour-of-day>", -3.1780538303479458),- ("<hour-of-day> <integer>", -3.58351893845611),- ("time-of-day (latent)", -1.0577902941478545),- ("hour", -1.0185695809945732), ("minute", -2.890371757896165),- ("after <time-of-day>", -3.58351893845611)],- n = 28}}),- ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("ordinal (digits)ordinal (digits)July", -1.252762968495368),- ("integer (numeric)integer (numeric)July", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thanksgiving Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("a <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.5753641449035618,- unseen = -3.4965075614664802,- likelihoods =- HashMap.fromList- [("week", -2.0794415416798357),- ("year (grain)", -2.772588722239781),- ("second", -2.772588722239781),- ("week (grain)", -2.0794415416798357),- ("day", -2.0794415416798357),- ("minute (grain)", -2.772588722239781),- ("year", -2.772588722239781),- ("second (grain) ", -2.772588722239781),- ("minute", -2.772588722239781),- ("day (grain)", -2.0794415416798357)],- n = 9},- koData =- ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("hour (grain)", -1.7227665977411035),- ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),- ("quarter (grain)", -1.9459101490553135)],- n = 7}}),- ("hh:mm",- Classifier{okData =- ClassData{prior = -5.406722127027582e-2,- unseen = -4.02535169073515,- likelihoods = HashMap.fromList [("", 0.0)], n = 54},- koData =- ClassData{prior = -2.9444389791664407,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("quarter of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("second (grain) ",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinals (first..twentieth,thirtieth,...)",- Classifier{okData =- ClassData{prior = -6.899287148695143e-2,- unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14},- koData =- ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("quarter after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> after|before <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.252762968495368),- ("dayday", -0.8472978603872037),- ("day (grain)yesterday", -1.252762968495368)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("about|exactly <time-of-day>",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("week", -2.639057329615259),- ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),- ("this|last|next <cycle>", -2.639057329615259),- ("day", -2.2335922215070942),- ("time-of-day (latent)", -2.639057329615259),- ("hhmm (latent)", -2.2335922215070942),- ("<time-of-day> am|pm", -2.639057329615259),- ("hour", -1.9459101490553135),- ("next <time>", -2.639057329615259),- ("this|next <day-of-week>", -2.639057329615259),- ("minute", -2.2335922215070942)],- n = 8},- koData =- ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),- ("time-of-day (latent)", -2.0794415416798357),- ("hour", -2.0794415416798357)],- n = 2}}),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- Classifier{okData =- ClassData{prior = -0.48130318449966897,- unseen = -5.170483995038151,- likelihoods =- HashMap.fromList- [("Wednesday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayhour", -3.2188758248682006),- ("daymonth", -3.2188758248682006),- ("<named-month> <day-of-month> (non ordinal)Friday",- -4.471638793363569),- ("Friday<named-month> <day-of-month> (non ordinal)",- -3.7784916128036232),- ("Wednesdayintersect", -4.471638793363569),- ("Labor Daythis|last|next <cycle>", -4.471638793363569),- ("black fridaythis|last|next <cycle>", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.471638793363569),- ("<part-of-day> of <time>February", -4.471638793363569),- ("Saturday<time-of-day> am|pm", -4.471638793363569),- ("Martin Luther King's Daythis|last|next <cycle>",- -4.471638793363569),- ("on <date><time-of-day> am|pm", -4.471638793363569),- ("hourmonth", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.471638793363569),- ("dayday", -2.5998366164619773),- ("the <day-of-month> (ordinal)February", -4.0661736852554045),- ("WednesdayOctober", -4.471638793363569),- ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.5553480614894135),- ("dayyear", -2.8622008809294686),- ("Saturday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.471638793363569),- ("Thursdayhh:mm", -4.0661736852554045),- ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),- ("Memorial Daythis|last|next <cycle>", -4.471638793363569),- ("on <date><named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("TuesdayOctober", -4.471638793363569),- ("the <day-of-month> (ordinal)March", -4.471638793363569),- ("Mondaythis|last|next <cycle>", -4.471638793363569),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.0661736852554045),- ("Fridayintersect", -4.471638793363569),- ("Thursday<datetime> - <datetime> (interval)",- -3.7784916128036232),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.5553480614894135),- ("Tuesdaythis|last|next <cycle>", -4.471638793363569),- ("Sunday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayminute", -2.6798793241355137),- ("intersectyear", -4.471638793363569),- ("minuteday", -3.5553480614894135),- ("this|last|next <cycle>Sunday", -4.471638793363569),- ("Sundaythis|last|next <cycle>", -4.471638793363569),- ("intersectintersect", -4.471638793363569),- ("weekday", -4.471638793363569),- ("dayweek", -3.373026504695459),- ("Thursday<time-of-day> am|pm", -4.471638793363569),- ("Monday<named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("<named-month> <day-of-month> (non ordinal)year",- -4.0661736852554045)],- n = 55},- koData =- ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,- likelihoods =- HashMap.fromList- [("week-endJuly", -4.197201947661808),- ("week-endOctober", -3.5040547671018634),- ("daymonth", -1.9999773703255892),- ("TuesdaySeptember", -4.197201947661808),- ("Wednesdayintersect", -4.197201947661808),- ("hourmonth", -3.0985896589936988),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.197201947661808),- ("Fridaythis|last|next <cycle>", -4.197201947661808),- ("SundayFebruary", -4.197201947661808),- ("WednesdayOctober", -4.197201947661808),- ("week-endintersect", -4.197201947661808),- ("dayyear", -4.197201947661808),- ("FridayJuly", -3.791736839553644),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.197201947661808),- ("FridaySeptember", -4.197201947661808),- ("WednesdayFebruary", -4.197201947661808),- ("minutemonth", -3.2809112157876537),- ("SundayMarch", -4.197201947661808),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.197201947661808),- ("MondayFebruary", -3.791736839553644),- ("Fridayintersect", -4.197201947661808),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.791736839553644),- ("dayminute", -2.810907586541918),- ("SaturdaySeptember", -4.197201947661808),- ("intersectSeptember", -3.2809112157876537),- ("MondayMarch", -4.197201947661808),- ("on <date>September", -3.791736839553644),- ("intersectintersect", -4.197201947661808),- ("Tuesdayintersect", -4.197201947661808),- ("Sundayintersect", -4.197201947661808)],- n = 34}}),- ("last <time>",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("Father's Day", -2.6741486494265287),- ("Martin Luther King's Day", -2.6741486494265287),- ("Memorial Day", -2.6741486494265287),- ("Mother's Day", -2.6741486494265287),- ("day", -1.2878542883066382), ("Sunday", -2.6741486494265287),- ("Thanksgiving Day", -2.6741486494265287),- ("hour", -2.6741486494265287), ("Tuesday", -2.6741486494265287),- ("week-end", -2.6741486494265287)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("intersect", -3.0204248861443626),- ("Monday", -3.0204248861443626), ("day", -2.1041341542702074),- ("Sunday", -3.0204248861443626),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.7676619176489945),- ("hour", -1.3156767939059373),- ("week-end", -1.9218125974762528)],- n = 14}}),- ("March",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<named-month>|<named-day> <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.11778303565638351,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("Octoberordinal (digits)", -2.0794415416798357),- ("Thursdayordinal (digits)", -2.4849066497880004),- ("day", -2.0794415416798357),- ("Augustordinal (digits)", -2.4849066497880004),- ("Marchordinals (first..twentieth,thirtieth,...)",- -2.0794415416798357),- ("Tuesdayordinal (digits)", -2.4849066497880004),- ("month", -1.2321436812926323),- ("Marchordinal (digits)", -2.4849066497880004)],- n = 8},- koData =- ClassData{prior = -2.1972245773362196,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Augustordinal (digits)", -1.6094379124341003),- ("month", -1.6094379124341003)],- n = 1}}),- ("Labor Day weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Christmas",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("until <time-of-day>",- Classifier{okData =- ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -2.3025850929940455),- ("<time-of-day> am|pm", -1.6094379124341003),- ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),- ("minute", -1.3862943611198906)],- n = 6},- koData =- ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("intersect", -1.7227665977411035),- ("yesterday", -2.2335922215070942),- ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),- ("hour", -2.639057329615259), ("minute", -1.252762968495368)],- n = 10}}),- ("<duration> after|before|from <time>",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("a <unit-of-duration>now", -2.70805020110221),- ("a <unit-of-duration>Christmas", -2.70805020110221),- ("<integer> <unit-of-duration>today", -2.70805020110221),- ("daysecond", -2.70805020110221),- ("a <unit-of-duration>right now", -2.70805020110221),- ("minutenograin", -2.70805020110221),- ("<integer> <unit-of-duration>Christmas", -2.70805020110221),- ("secondnograin", -2.70805020110221),- ("yearday", -2.0149030205422647),- ("daynograin", -2.70805020110221),- ("<integer> <unit-of-duration>now", -2.3025850929940455)],- n = 7},- koData =- ClassData{prior = -1.2039728043259361,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("dayhour", -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal)",- -2.3978952727983707),- ("dayday", -1.9924301646902063),- ("<integer> <unit-of-duration>time-of-day (latent)",- -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -2.3978952727983707)],- n = 3}}),- ("Independence Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("decimal number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("next <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5263605246161616,- likelihoods =- HashMap.fromList- [("Martin Luther King's Day", -2.803360380906535),- ("Halloween", -2.803360380906535),- ("Wednesday", -2.803360380906535),- ("Memorial Day", -2.803360380906535),- ("Monday", -2.803360380906535),- ("Mother's Day", -2.803360380906535),- ("day", -1.0986122886681098),- ("Thanksgiving Day", -2.803360380906535),- ("March", -2.803360380906535), ("month", -2.803360380906535),- ("Tuesday", -2.1102132003465894)],- n = 11},- koData =- ClassData{prior = -infinity, unseen = -2.4849066497880004,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> sharp|exactly",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -2.1400661634962708),- ("time-of-day (latent)", -2.1400661634962708),- ("hhmm (latent)", -2.1400661634962708),- ("<time-of-day> am|pm", -2.1400661634962708),- ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),- ("minute", -1.4469189829363254)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day Weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("negative numbers",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 24}}),- ("about|exactly <duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("half an hour", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time> before last|after next",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("Wednesday", -1.8718021769015913),- ("Friday", -1.466337068793427), ("day", -1.1786549963416462),- ("March", -1.8718021769015913), ("month", -1.8718021769015913)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("by the end of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("this|last|next <cycle>", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hhmm (military) am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -0.48550781578170077,- unseen = -3.891820298110627,- likelihoods =- HashMap.fromList- [("minuteminute", -1.4733057381095205),- ("hh:mmhh:mm", -1.6739764335716716),- ("dayday", -2.772588722239781),- ("hourhour", -2.2617630984737906),- ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -3.1780538303479458),- ("<time-of-day> am|pm<time-of-day> am|pm",- -2.4849066497880004)],- n = 16},- koData =- ClassData{prior = -0.9555114450274363,- unseen = -3.6109179126442243,- likelihoods =- HashMap.fromList- [("<named-month> <day-of-month> (non ordinal)July",- -2.890371757896165),- ("daymonth", -2.4849066497880004),- ("<time-of-day> am|pmintersect", -2.890371757896165),- ("hh:mm<time-of-day> am|pm", -2.4849066497880004),- ("minuteminute", -1.9740810260220096),- ("hourhour", -2.4849066497880004),- ("minutehour", -2.4849066497880004),- ("hh:mmintersect", -1.9740810260220096),- ("<named-month> <day-of-month> (non ordinal)August",- -2.890371757896165),- ("about|exactly <time-of-day><time-of-day> am|pm",- -2.890371757896165)],- n = 10}}),- ("Tuesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Day",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),- ("fortnight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> and an half hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <named-month>",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -1.252762968495368), ("March", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -0.8472978603872037),- ("month", -0.8472978603872037)],- n = 2}}),- ("<time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.8873031950009028,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("minuteminute", -1.5163474893680884),- ("hh:mmhh:mm", -1.5163474893680884),- ("<time-of-day> am|pmtime-of-day (latent)", -2.327277705584417),- ("hourhour", -1.7676619176489945),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.327277705584417)],- n = 14},- koData =- ClassData{prior = -0.5306282510621704,- unseen = -3.9889840465642745,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>time-of-day (latent)",- -3.2771447329921766),- ("hh:mmtime-of-day (latent)", -1.5723966407537513),- ("hh:mm<time-of-day> am|pm", -2.871679624884012),- ("<time-of-day> am|pmtime-of-day (latent)",- -3.2771447329921766),- ("at <time-of-day><time-of-day> am|pm", -3.2771447329921766),- ("hourhour", -2.0243817644968085),- ("minutehour", -1.262241712449912),- ("about|exactly <time-of-day><time-of-day> am|pm",- -3.2771447329921766),- ("at <time-of-day>time-of-day (latent)", -2.871679624884012),- ("<integer> to|till|before <hour-of-day>time-of-day (latent)",- -2.871679624884012)],- n = 20}}),- ("nth <time> after <time>",- Classifier{okData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -0.916290731874155)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",- -0.916290731874155)],- n = 1}}),- ("<named-month> <day-of-month> (non ordinal)",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.9318256327243257,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.5257286443082556),- ("Marchinteger (numeric)", -2.8134107167600364),- ("Aprilinteger (numeric)", -3.2188758248682006),- ("month", -0.8209805520698302),- ("Februaryinteger (numeric)", -1.9661128563728327),- ("Septemberinteger (numeric)", -2.8134107167600364),- ("Octoberinteger (numeric)", -2.8134107167600364),- ("Julyinteger (numeric)", -2.120263536200091)],- n = 21},- koData =- ClassData{prior = -1.2039728043259361, unseen = -3.295836866004329,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.159484249353372),- ("Marchinteger (numeric)", -2.5649493574615367),- ("Aprilinteger (numeric)", -2.5649493574615367),- ("month", -0.9555114450274363),- ("Julyinteger (numeric)", -1.466337068793427)],- n = 9}}),- ("this|next <day-of-week>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods =- HashMap.fromList- [("Thursday", -2.2512917986064953),- ("Wednesday", -2.2512917986064953),- ("Monday", -1.845826690498331), ("day", -0.8649974374866046),- ("Tuesday", -1.55814461804655)],- n = 7},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinal (digits)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5553480614894135,- likelihoods = HashMap.fromList [("", 0.0)], n = 33},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter (grain)",- Classifier{okData =- ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("last <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("day (grain)October", -1.791759469228055),- ("daymonth", -1.2809338454620642),- ("day (grain)intersect", -1.791759469228055),- ("weekmonth", -1.791759469228055),- ("week (grain)intersect", -2.1972245773362196),- ("week (grain)September", -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("seasons",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month>(ordinal) <named-month> year",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)April", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Labor Day",- Classifier{okData =- ClassData{prior = -0.2876820724517809,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -1.3862943611198906,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("week-end",- Classifier{okData =- ClassData{prior = -1.5040773967762742,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.25131442828090605,- unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),- ("after <time-of-day>",- Classifier{okData =- ClassData{prior = -1.6094379124341003,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hour", -1.2992829841302609)],- n = 2},- koData =- ClassData{prior = -0.2231435513142097,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("intersect", -2.03688192726104),- ("tomorrow", -2.03688192726104), ("day", -1.3437347467010947),- ("time-of-day (latent)", -2.4423470353692043),- ("<time-of-day> am|pm", -2.4423470353692043),- ("Christmas", -2.03688192726104), ("hour", -1.749199854809259)],- n = 8}}),- ("day (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.2188758248682006,- likelihoods = HashMap.fromList [("", 0.0)], n = 23},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("black friday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("right now",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("for <duration> from <time>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("<integer> <unit-of-duration><day-of-month> (ordinal)",- -1.5040773967762742),- ("dayday", -1.0986122886681098),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -1.5040773967762742)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("dayhour", -1.252762968495368),- ("<integer> <unit-of-duration>time-of-day (latent)",- -1.252762968495368)],- n = 1}}),- ("between <time> and <time>",- Classifier{okData =- ClassData{prior = -1.0986122886681098,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("minuteminute", -1.0116009116784799),- ("hh:mmhh:mm", -1.0116009116784799)],- n = 3},- koData =- ClassData{prior = -0.40546510810816444,- unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.4469189829363254),- ("minuteminute", -1.4469189829363254),- ("minutehour", -1.4469189829363254),- ("hh:mmintersect", -1.4469189829363254)],- n = 6}}),- ("<month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.2992829841302609),- ("Augustordinal (digits)integer (numeric)",- -1.9924301646902063),- ("month", -0.7884573603642702),- ("Augustordinal (digits)ordinal (digits)",- -1.9924301646902063)],- n = 9},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of days",- Classifier{okData =- ClassData{prior = -4.0821994520255166e-2,- unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("", 0.0)], n = 24},- koData =- ClassData{prior = -3.2188758248682006,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("dd-dd <month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)September",- -1.791759469228055),- ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),- ("ordinal (digits)ordinal (digits)October",- -2.1972245773362196),- ("integer (numeric)integer (numeric)July", -2.1972245773362196),- ("month", -0.9444616088408514),- ("ordinal (digits)ordinal (digits)August",- -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("this <time>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("Thursday", -2.6026896854443837),- ("Martin Luther King's Day", -2.6026896854443837),- ("intersect", -2.6026896854443837),- ("Monday", -2.6026896854443837), ("day", -1.2163953243244932),- ("Thanksgiving Day", -2.6026896854443837),- ("hour", -2.1972245773362196), ("seasons", -1.9095425048844386),- ("week-end", -2.6026896854443837)],- n = 9},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("intersect", -1.7047480922384253),- ("day", -1.7047480922384253)],- n = 1}}),+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.824549292051046),+ ("<time-of-day> am|pm", -1.6422277352570913),+ ("hh:mm", -1.824549292051046), ("hour", -1.1314021114911006),+ ("minute", -1.824549292051046)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.7765287894989963, unseen = -5.225746673713201,+ likelihoods = HashMap.fromList [("", 0.0)], n = 184},+ koData =+ ClassData{prior = -0.616186139423817, unseen = -5.384495062789089,+ likelihoods = HashMap.fromList [("", 0.0)], n = 216}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.784189633918261,+ likelihoods =+ HashMap.fromList+ [("week", -1.563975538357343), ("day", -1.8152899666382492),+ ("year", -2.662587827025453),+ ("<integer> <unit-of-duration>", -1.0531499145913523),+ ("a <unit-of-duration>", -2.662587827025453),+ ("month", -2.662587827025453),+ ("fortnight", -2.662587827025453)],+ n = 18},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("noon|midnight|EOD|end of day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter to|till|before <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.6094379124341003),+ ("dayday", -1.0986122886681098),+ ("day (grain)yesterday", -1.6094379124341003)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.466337068793427),+ ("year (grain)Christmas", -1.8718021769015913),+ ("day (grain)intersect", -1.466337068793427),+ ("yearday", -1.8718021769015913)],+ n = 3}}),+ ("Martin Luther King's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("mm/yyyy",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("integer after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("hour", -0.8109302162163288),+ ("integer (numeric)time-of-day (latent)", -1.0986122886681098),+ ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)December", -2.1400661634962708),+ ("ordinal (digits)February", -2.1400661634962708),+ ("integer (numeric)April", -2.1400661634962708),+ ("month", -1.4469189829363254)],+ n = 3},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)October", -2.6741486494265287),+ ("ordinal (digits)July", -2.6741486494265287),+ ("integer (numeric)September", -2.268683541318364),+ ("ordinal (digits)August", -2.6741486494265287),+ ("integer (numeric)August", -2.6741486494265287),+ ("ordinal (digits)April", -2.6741486494265287),+ ("month", -1.0647107369924282),+ ("integer (numeric)July", -2.268683541318364)],+ n = 9}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -9.844007281325252e-2,+ unseen = -4.430816798843313,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("dayhour", -1.5284688499004333),+ ("Mondayearly morning", -3.3202283191284883),+ ("time-of-day (latent)tonight", -3.3202283191284883),+ ("hourhour", -2.339399066116762),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -3.7256934272366524),+ ("todaypart of days", -3.7256934272366524),+ ("minutehour", -2.627081138568543),+ ("at <time-of-day>in|during the <part-of-day>",+ -3.3202283191284883),+ ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),+ ("Mondayin|during the <part-of-day>", -3.7256934272366524),+ ("intersectpart of days", -3.7256934272366524),+ ("intersectin|during the <part-of-day>", -3.7256934272366524),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -3.7256934272366524),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("tomorrowpart of days", -2.339399066116762),+ ("hh:mmin|during the <part-of-day>", -3.0325462466767075),+ ("time-of-day (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("hhmm (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("yesterdaypart of days", -3.7256934272366524),+ ("Mondaypart of days", -3.7256934272366524)],+ n = 29},+ koData =+ ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("yearhour", -2.740840023925201),+ ("monthhour", -2.740840023925201),+ ("hourhour", -2.740840023925201),+ ("past year (latent)in|during the <part-of-day>",+ -2.740840023925201),+ ("Februaryin|during the <part-of-day>", -2.740840023925201),+ ("time-of-day (latent)in|during the <part-of-day>",+ -2.740840023925201)],+ n = 3}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd",+ Classifier{okData =+ ClassData{prior = -1.4271163556401458,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -9.381875521765486e-2,+ unseen = -4.90527477843843,+ likelihoods =+ HashMap.fromList+ [("<time> timezone", -3.7992275112828016),+ ("noon|midnight|EOD|end of day", -3.7992275112828016),+ ("integer after|past <hour-of-day>", -3.7992275112828016),+ ("half after|past <hour-of-day>", -4.204692619390966),+ ("time-of-day (latent)", -1.7197859696029658),+ ("hhmm (latent)", -3.5115454388310208),+ ("<time-of-day> am|pm", -1.8067973465925955),+ ("hh:mm", -3.288401887516811),+ ("about|exactly <time-of-day>", -3.7992275112828016),+ ("hour", -1.0911773101805915),+ ("<time-of-day> sharp|exactly", -4.204692619390966),+ ("minute", -2.0074680420547466)],+ n = 61},+ koData =+ ClassData{prior = -2.412933150162911, unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.2321436812926323),+ ("hour", -1.2321436812926323)],+ n = 6}}),+ ("December",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("on <date>", -2.1972245773362196),+ ("Wednesday", -2.6026896854443837),+ ("Saturday", -2.6026896854443837),+ ("Monday", -2.1972245773362196),+ ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),+ ("Sunday", -2.6026896854443837)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last|past|next <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("week", -2.456735772821304), ("second", -2.639057329615259),+ ("day", -2.3025850929940455), ("year", -2.639057329615259),+ ("<integer> <unit-of-duration>", -0.7827593392496325),+ ("hour", -2.639057329615259), ("month", -2.639057329615259),+ ("minute", -2.639057329615259)],+ n = 31},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the ides of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,+ likelihoods =+ HashMap.fromList+ [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),+ ("absorption of , after named day", -2.890371757896165),+ ("intersect", -2.890371757896165),+ ("Saturday", -2.6026896854443837),+ ("Friday", -3.295836866004329), ("day", -0.8979415932059586),+ ("the <day-of-month> (ordinal)", -2.890371757896165),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.6026896854443837),+ ("hour", -3.295836866004329)],+ n = 22},+ koData =+ ClassData{prior = -1.8718021769015913,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.791759469228055), ("day", -1.2809338454620642),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -1.791759469228055)],+ n = 4}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.784189633918261,+ likelihoods = HashMap.fromList [("", 0.0)], n = 42},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -0.916290731874155),+ ("hh:mmhh:mm", -0.916290731874155)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -0.916290731874155),+ ("minutehour", -0.916290731874155)],+ n = 3}}),+ ("Halloween",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),+ ("Augustordinal (digits)integer (numeric)",+ -1.6094379124341003),+ ("month", -0.916290731874155),+ ("Augustordinal (digits)ordinal (digits)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from|since|after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("July", -3.3141860046725258),+ ("time-of-day (latent)", -2.3978952727983707),+ ("<time-of-day> am|pm", -2.3978952727983707),+ ("hh:mm", -2.3978952727983707), ("hour", -1.8101086078962516),+ ("month", -2.908720896564361), ("minute", -2.3978952727983707),+ ("August", -3.3141860046725258)],+ n = 14},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -4.836281906951478,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.7297014486341915),+ ("week", -4.135166556742356),+ ("<day-of-month> (ordinal or number) <named-month>",+ -4.135166556742356),+ ("today", -4.135166556742356),+ ("intersect", -2.7488721956224653),+ ("second", -4.135166556742356), ("now", -3.4420193761824103),+ ("tomorrow", -3.7297014486341915),+ ("this|last|next <cycle>", -4.135166556742356),+ ("day", -1.995100393246085),+ ("time-of-day (latent)", -4.135166556742356),+ ("<time-of-day> am|pm", -3.7297014486341915),+ ("nograin", -3.4420193761824103),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ -4.135166556742356),+ ("Christmas", -3.4420193761824103),+ ("hour", -2.8824035882469876),+ ("<datetime> - <datetime> (interval)", -2.7488721956224653),+ ("<time-of-day> - <time-of-day> (interval)",+ -2.430418464503931),+ ("<named-month> <day-of-month> (non ordinal)",+ -3.7297014486341915),+ ("minute", -1.6928195213731514),+ ("right now", -4.135166556742356),+ ("<month> dd-dd (interval)", -3.4420193761824103),+ ("dd-dd <month> (interval)", -3.7297014486341915)],+ n = 49}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> more <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)minute (grain)", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in|within|after <duration>",+ Classifier{okData =+ ClassData{prior = -4.652001563489282e-2,+ unseen = -4.61512051684126,+ likelihoods =+ HashMap.fromList+ [("week", -3.2188758248682006),+ ("<integer> more <unit-of-duration>", -3.912023005428146),+ ("three-quarters of an hour", -2.995732273553991),+ ("<integer> + '\"", -3.2188758248682006),+ ("number.number hours", -3.912023005428146),+ ("second", -3.506557897319982), ("day", -3.2188758248682006),+ ("half an hour", -2.995732273553991),+ ("<integer> <unit-of-duration>", -1.6094379124341003),+ ("a <unit-of-duration>", -2.995732273553991),+ ("quarter of an hour", -2.995732273553991),+ ("hour", -2.5257286443082556),+ ("about|exactly <duration>", -3.912023005428146),+ ("<integer> and an half hour", -3.912023005428146),+ ("minute", -1.2729656758128873)],+ n = 42},+ koData =+ ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("quarter", -1.8971199848858813),+ ("<integer> <unit-of-duration>", -2.3025850929940455),+ ("a <unit-of-duration>", -2.3025850929940455)],+ n = 2}}),+ ("three-quarters of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half <integer> (UK style hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -0.8209805520698302,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -1.1786549963416462),+ ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",+ -1.466337068793427),+ ("quarter", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.8109302162163288),+ ("quarter", -0.8109302162163288)],+ n = 3}}),+ ("one twenty two",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.4957877464014501, unseen = -6.293419278846481,+ likelihoods =+ HashMap.fromList+ [("<datetime> - <datetime> (interval)on <date>",+ -4.345658990503007),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -4.345658990503007),+ ("hourday", -3.8936738667599493),+ ("dayhour", -2.765208614942159),+ ("daymonth", -4.90527477843843),+ ("monthday", -5.19295685089021),+ ("monthyear", -3.9889840465642745),+ ("Tuesdaythe <day-of-month> (ordinal)", -5.598421958998375),+ ("Christmasyear", -5.598421958998375),+ ("from <datetime> - <datetime> (interval)July",+ -5.598421958998375),+ ("houryear", -5.598421958998375),+ ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.90527477843843),+ ("<time-of-day> am|pmintersect", -4.345658990503007),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -5.598421958998375),+ ("Marchyear", -5.598421958998375),+ ("<named-month>|<named-day> <day-of-month> (ordinal)year",+ -5.19295685089021),+ ("intersect<time-of-day> am|pm", -5.598421958998375),+ ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.598421958998375),+ ("monthhour", -5.19295685089021),+ ("last <day-of-week> of <time>year", -5.598421958998375),+ ("todayat <time-of-day>", -5.598421958998375),+ ("Thursday<time> timezone", -3.8936738667599493),+ ("this <time>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("dayday", -3.58351893845611),+ ("Thanksgiving Dayyear", -4.499809670330265),+ ("<time> <part-of-day>at <time-of-day>", -5.598421958998375),+ ("Tuesdayin <named-month>", -5.598421958998375),+ ("mm/ddat <time-of-day>", -5.598421958998375),+ ("tonightat <time-of-day>", -5.598421958998375),+ ("<time-of-day> am|pmabsorption of , after named day",+ -4.90527477843843),+ ("today<time-of-day> am|pm", -5.598421958998375),+ ("Februarythe <day-of-month> (ordinal)", -5.19295685089021),+ ("at <time-of-day><time> <part-of-day>", -5.598421958998375),+ ("mm/dd<time-of-day> am|pm", -5.598421958998375),+ ("hourhour", -4.345658990503007),+ ("<time-of-day> am|pmon <date>", -3.58351893845611),+ ("Wednesdaythis|last|next <cycle>", -5.598421958998375),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -4.0943445622221),+ ("dayyear", -3.1560749236291703),+ ("last weekend of <named-month>year", -5.598421958998375),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -5.598421958998375),+ ("Thursdayat <time-of-day>", -5.19295685089021),+ ("<time-of-day> am|pmtomorrow", -4.90527477843843),+ ("minutehour", -4.68213122712422),+ ("Mother's Dayyear", -5.598421958998375),+ ("at <time-of-day>in|during the <part-of-day>",+ -5.19295685089021),+ ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",+ -3.8936738667599493),+ ("for <duration> from <time>December", -5.598421958998375),+ ("tomorrow<time-of-day> sharp|exactly", -5.598421958998375),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -5.19295685089021),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.68213122712422),+ ("Mondayin|during the <part-of-day>", -5.598421958998375),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.19295685089021),+ ("intersectin|during the <part-of-day>", -5.598421958998375),+ ("Thursday<datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -5.598421958998375),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.345658990503007),+ ("from <time-of-day> - <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -4.68213122712422),+ ("at <time-of-day>intersect", -5.19295685089021),+ ("<time-of-day> - <time-of-day> (interval)tomorrow",+ -5.598421958998375),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.598421958998375),+ ("dayminute", -2.924273309571846),+ ("from <datetime> - <datetime> (interval)on <date>",+ -5.19295685089021),+ ("<datetime> - <datetime> (interval)tomorrow",+ -5.598421958998375),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.19295685089021),+ ("<ordinal> <cycle> of <time>year", -5.598421958998375),+ ("minuteday", -2.132686056198648),+ ("absorption of , after named dayintersect",+ -5.598421958998375),+ ("Octoberyear", -4.345658990503007),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -5.598421958998375),+ ("at <time-of-day>absorption of , after named day",+ -5.598421958998375),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -5.598421958998375),+ ("year<time-of-day> am|pm", -5.598421958998375),+ ("Septemberyear", -5.19295685089021),+ ("at <time-of-day>on <date>", -4.499809670330265),+ ("between <time-of-day> and <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("Halloweenyear", -5.598421958998375),+ ("dayweek", -5.598421958998375),+ ("Thursday<time-of-day> am|pm", -5.598421958998375),+ ("weekyear", -5.19295685089021),+ ("hh:mmin|during the <part-of-day>", -4.90527477843843),+ ("Father's Dayyear", -5.598421958998375),+ ("<cycle> after|before <time><time-of-day> am|pm",+ -5.19295685089021),+ ("February<time> <part-of-day>", -5.598421958998375),+ ("Martin Luther King's Dayyear", -5.19295685089021),+ ("tomorrowat <time-of-day>", -4.90527477843843),+ ("between <time> and <time>on <date>", -4.90527477843843),+ ("Thursdayfrom|since|after <time-of-day>", -4.90527477843843),+ ("at <time-of-day>tomorrow", -5.19295685089021),+ ("tomorrow<time-of-day> am|pm", -5.598421958998375),+ ("in|during the <part-of-day>at <time-of-day>",+ -5.598421958998375),+ ("Labor Dayyear", -5.598421958998375),+ ("Februaryintersect", -5.598421958998375),+ ("last <cycle> of <time>year", -4.90527477843843),+ ("<named-month> <day-of-month> (non ordinal)year",+ -5.598421958998375),+ ("yearminute", -5.598421958998375),+ ("Black Fridayyear", -5.19295685089021)],+ n = 201},+ koData =+ ClassData{prior = -0.9392802500988537, unseen = -5.983936280687191,+ likelihoods =+ HashMap.fromList+ [("in <named-month>year", -5.288267030694535),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -5.288267030694535),+ ("hourday", -5.288267030694535),+ ("<named-month> <day-of-month> (non ordinal)July",+ -5.288267030694535),+ ("dayhour", -2.890371757896165),+ ("daymonth", -3.2088254890146994),+ ("monthday", -4.882801922586371),+ ("monthyear", -4.59511985013459),+ ("intersecthh:mm", -5.288267030694535),+ ("from <datetime> - <datetime> (interval)July",+ -5.288267030694535),+ ("houryear", -5.288267030694535),+ ("from <time-of-day> - <time-of-day> (interval)July",+ -5.288267030694535),+ ("until <time-of-day><time-of-day> am|pm", -5.288267030694535),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.59511985013459),+ ("<time-of-day> am|pmintersect", -4.035504062199167),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.37197629882038),+ ("from|since|after <time-of-day>on <date>", -4.37197629882038),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("absorption of , after named dayJuly", -4.882801922586371),+ ("monthhour", -5.288267030694535),+ ("hourmonth", -4.59511985013459),+ ("todayat <time-of-day>", -5.288267030694535),+ ("from|since|after <time-of-day>July", -5.288267030694535),+ ("dayday", -4.882801922586371),+ ("mm/ddat <time-of-day>", -4.882801922586371),+ ("<time-of-day> am|pmon <date>", -4.035504062199167),+ ("dayyear", -4.035504062199167),+ ("Thursdaymm/dd", -5.288267030694535),+ ("Thursdayat <time-of-day>", -4.035504062199167),+ ("<integer> to|till|before <hour-of-day>September",+ -5.288267030694535),+ ("monthminute", -5.288267030694535),+ ("<time-of-day> am|pmtomorrow", -5.288267030694535),+ ("Thursdayhh:mm", -4.37197629882038),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("Fridayyear", -4.882801922586371),+ ("minutemonth", -3.4965075614664802),+ ("Sundayfrom|since|after <time-of-day>", -5.288267030694535),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.882801922586371),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("Aprilyear", -5.288267030694535),+ ("mm/dd<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.288267030694535),+ ("<duration> after|before|from <time>December",+ -5.288267030694535),+ ("yesterday<time-of-day> am|pm", -5.288267030694535),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -4.37197629882038),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("<named-month> <day-of-month> (non ordinal)August",+ -5.288267030694535),+ ("until <time-of-day>on <date>", -4.59511985013459),+ ("at <time-of-day>intersect", -4.882801922586371),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("dayminute", -2.7625383863862796),+ ("intersectSeptember", -3.784189633918261),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("minuteday", -2.3704962986102562),+ ("absorption of , after named dayintersect",+ -5.288267030694535),+ ("Februaryin|during the <part-of-day>", -5.288267030694535),+ ("week-endin <named-month>", -5.288267030694535),+ ("Octoberyear", -5.288267030694535),+ ("from|since|after <time-of-day>year", -5.288267030694535),+ ("yearhh:mm", -5.288267030694535),+ ("hh:mmon <date>", -3.784189633918261),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -5.288267030694535),+ ("absorption of , after named daySeptember", -4.37197629882038),+ ("on <date>September", -4.882801922586371),+ ("at <time-of-day>on <date>", -4.882801922586371),+ ("dayweek", -5.288267030694535),+ ("Thursday<time-of-day> am|pm", -4.882801922586371),+ ("absorption of , after named dayFebruary", -4.37197629882038),+ ("July<integer> to|till|before <hour-of-day>",+ -5.288267030694535),+ ("tomorrowat <time-of-day>", -5.288267030694535),+ ("<integer> to|till|before <hour-of-day>July",+ -5.288267030694535),+ ("Thursdayfrom|since|after <time-of-day>", -3.6788291182604347),+ ("tomorrow<time-of-day> am|pm", -5.288267030694535),+ ("Tuesdayfrom|since|after <time-of-day>", -5.288267030694535),+ ("yearminute", -5.288267030694535)],+ n = 129}}),+ ("one eleven",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("after lunch/work/school",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("early morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <number> (implicit minutes)",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.3184537311185346),+ ("integer (0..19)", -1.2992829841302609)],+ n = 9},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.16251892949777494),+ ("integer (0..19)", -1.8971199848858813)],+ n = 18}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.0149030205422647),+ ("quarteryear", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)day (grain)October",+ -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",+ -2.0149030205422647),+ ("weekmonth", -1.6094379124341003),+ ("ordinal (digits)quarter (grain)year", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)October",+ -2.0149030205422647)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods = HashMap.fromList [("", 0.0)], n = 21},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -1.0116009116784799,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -2.001480000210124),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("hh:mmhh:mm", -2.001480000210124),+ ("dayday", -2.512305623976115),+ ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),+ ("hourhour", -2.512305623976115),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],+ n = 8},+ koData =+ ClassData{prior = -0.45198512374305727,+ unseen = -3.912023005428146,+ likelihoods =+ HashMap.fromList+ [("hourday", -3.1986731175506815),+ ("dayhour", -2.793208009442517),+ ("<day-of-month> (ordinal)time-of-day (latent)",+ -3.1986731175506815),+ ("hh:mmtime-of-day (latent)", -2.2823823856765264),+ ("minuteminute", -2.793208009442517),+ ("time-of-day (latent)time-of-day (latent)",+ -2.793208009442517),+ ("dayday", -3.1986731175506815),+ ("hourhour", -2.505525936990736),+ ("dayyear", -3.1986731175506815),+ ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",+ -3.1986731175506815),+ ("minutehour", -2.2823823856765264),+ ("hh:mmintersect", -2.793208009442517),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("time-of-day (latent)<time-of-day> am|pm",+ -3.1986731175506815),+ ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",+ -3.1986731175506815)],+ n = 14}}),+ ("Saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",+ -1.7346010553881064),+ ("weekmonth", -1.7346010553881064),+ ("week (grain)October", -1.7346010553881064),+ ("week (grain)<named-month> <day-of-month> (non ordinal)",+ -1.7346010553881064),+ ("weekday", -1.2237754316221157)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number.number hours",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.6094379124341003),+ ("hh:mmhh:mm", -1.6094379124341003),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),+ ("hourhour", -2.3025850929940455),+ ("hourminute", -2.3025850929940455),+ ("time-of-day (latent)<time-of-day> sharp|exactly",+ -2.70805020110221),+ ("time-of-day (latent)hh:mm", -2.70805020110221),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],+ n = 9},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.6094379124341003),+ ("time-of-day (latent)time-of-day (latent)",+ -2.0149030205422647),+ ("hourhour", -1.791759469228055),+ ("minutehour", -1.6094379124341003),+ ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],+ n = 9}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)", -0.6931471805599453),+ ("integer (20..90)integer (0..19)", -0.6931471805599453)],+ n = 4}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("Monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (20..90)", -1.3862943611198906),+ ("hour", -0.9808292530117262),+ ("at <time-of-day>integer (numeric)", -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>integer (numeric)",+ -1.0986122886681098),+ ("hour", -1.0986122886681098)],+ n = 1}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.9808292530117262),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -2.0794415416798357),+ ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",+ -1.6739764335716716),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0986122886681098),+ ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",+ -1.791759469228055),+ ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",+ -1.3862943611198906)],+ n = 3}}),+ ("Valentine's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("end of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = -8.004270767353637e-2,+ unseen = -3.6375861597263857,+ likelihoods = HashMap.fromList [("", 0.0)], n = 36},+ koData =+ ClassData{prior = -2.5649493574615367,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",+ -1.6094379124341003),+ ("hourday", -0.916290731874155),+ ("part of daysthe <day-of-month> (ordinal)",+ -1.6094379124341003),+ ("part of daysthe <day-of-month> (number)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("past year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 2}}),+ ("six thirty six a.m.",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.252762968495368),+ ("one twenty two", -0.8472978603872037),+ ("one eleven", -1.252762968495368)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.9459101490553135,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -2.3513752571634776),+ ("ordinals (first..twentieth,thirtieth,...)March",+ -2.3513752571634776),+ ("ordinal (digits)February", -2.3513752571634776),+ ("integer (numeric)February", -1.9459101490553135),+ ("month", -0.9650808960435872),+ ("ordinal (digits)March", -2.3513752571634776),+ ("integer (numeric)July", -2.3513752571634776)],+ n = 7},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)February", -1.5040773967762742),+ ("month", -1.5040773967762742)],+ n = 1}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Friday",+ Classifier{okData =+ ClassData{prior = -0.3677247801253174,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("in|during the <part-of-day>",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("early morning", -2.5257286443082556),+ ("hour", -0.7339691750802004),+ ("part of days", -0.8209805520698302)],+ n = 11},+ koData =+ ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("hour", -0.916290731874155),+ ("part of days", -0.916290731874155)],+ n = 1}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh(:mm) - <time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last|next <cycle>",+ Classifier{okData =+ ClassData{prior = -0.15822400521489416,+ unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("week", -1.5488132906176655),+ ("month (grain)", -2.995732273553991),+ ("year (grain)", -1.817077277212345),+ ("week (grain)", -1.5488132906176655),+ ("quarter", -2.772588722239781), ("year", -1.817077277212345),+ ("month", -2.995732273553991),+ ("quarter (grain)", -2.772588722239781)],+ n = 35},+ koData =+ ClassData{prior = -1.9218125974762528,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("week", -1.4816045409242156),+ ("week (grain)", -1.4816045409242156),+ ("day", -1.9924301646902063),+ ("day (grain)", -1.9924301646902063)],+ n = 6}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -2.1972245773362196),+ ("end of month", -2.1972245773362196),+ ("time-of-day (latent)", -2.1972245773362196),+ ("<time-of-day> am|pm", -2.1972245773362196),+ ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),+ ("month", -2.1972245773362196), ("minute", -1.791759469228055)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2006706954621511,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..twentieth,thirtieth,...)",+ -1.7047480922384253),+ ("ordinal (digits)", -0.2006706954621511)],+ n = 9},+ koData =+ ClassData{prior = -1.7047480922384253,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],+ n = 2}}),+ ("last weekend of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("October", -0.9555114450274363), ("July", -1.8718021769015913),+ ("month", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (number)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),+ ("Sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.5315058290035293,+ unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.12136085700426748),+ ("integer (0..19)", -2.3025850929940455)],+ n = 67},+ koData =+ ClassData{prior = -0.8860508466844369,+ unseen = -3.9318256327243257,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.10536051565782628),+ ("integer (0..19)", -2.8134107167600364),+ ("integer 21..99", -3.2188758248682006)],+ n = 47}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.23483959107740107, unseen = -3.58351893845611,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 34},+ koData =+ ClassData{prior = -1.563975538357343, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 9}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("SundayMarch", -1.6094379124341003),+ ("MondayMarch", -1.6094379124341003),+ ("Sundayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.1479201300766222,+ unseen = -5.0875963352323845,+ likelihoods =+ HashMap.fromList+ [("week", -2.4423470353692043),+ ("integer (0..19)year (grain)", -3.289644895756408),+ ("integer (numeric)day (grain)", -2.6835090921860925),+ ("integer (0..19)second (grain) ", -3.6951100038645723),+ ("integer (0..19)hour (grain)", -3.001962823304627),+ ("second", -3.289644895756408),+ ("integer (numeric)second (grain) ", -3.982792076316353),+ ("integer (numeric)year (grain)", -3.6951100038645723),+ ("day", -2.4423470353692043), ("year", -2.8841797876482436),+ ("integer (numeric)week (grain)", -3.001962823304627),+ ("integer (0..19)month (grain)", -3.4719664525503626),+ ("hour", -2.5964977151964628), ("month", -3.1354942159291497),+ ("integer (numeric)minute (grain)", -3.1354942159291497),+ ("integer (0..19)minute (grain)", -3.001962823304627),+ ("integer (numeric)month (grain)", -3.982792076316353),+ ("minute", -2.4423470353692043),+ ("integer (numeric)hour (grain)", -3.4719664525503626),+ ("integer (0..19)day (grain)", -3.6951100038645723),+ ("integer (0..19)week (grain)", -3.1354942159291497)],+ n = 69},+ koData =+ ClassData{prior = -1.984131361875511, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("quarter", -3.1135153092103742), ("hour", -1.4087672169719492),+ ("integer (numeric)hour (grain)", -1.4087672169719492),+ ("integer (0..19)quarter (grain)", -3.1135153092103742)],+ n = 11}}),+ ("hhmm (latent)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = -0.2929871246814741,+ unseen = -5.3230099791384085,+ likelihoods =+ HashMap.fromList+ [("integer after|past <hour-of-day>", -3.9318256327243257),+ ("at <time-of-day>", -2.2270775404859005),+ ("from|since|after <time-of-day>", -3.708682081410116),+ ("<time-of-day> o'clock", -4.219507705176107),+ ("half after|past <hour-of-day>", -4.219507705176107),+ ("time-of-day (latent)", -1.7346010553881064),+ ("hhmm (latent)", -4.624972813284271),+ ("hh:mm", -2.2735975561207935),+ ("quarter after|past <hour-of-day>", -4.624972813284271),+ ("about|exactly <time-of-day>", -4.624972813284271),+ ("until <time-of-day>", -3.9318256327243257),+ ("hour", -1.2237754316221157),+ ("<time-of-day> sharp|exactly", -4.624972813284271),+ ("minute", -1.7346010553881064)],+ n = 94},+ koData =+ ClassData{prior = -1.3705460041517514, unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.283414346005772),+ ("from|since|after <time-of-day>", -3.283414346005772),+ ("<hour-of-day> <integer>", -3.6888794541139363),+ ("time-of-day (latent)", -1.0498221244986778),+ ("hour", -1.0147308046874075), ("minute", -2.772588722239781)],+ n = 32}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)ordinal (digits)July", -1.252762968495368),+ ("integer (numeric)integer (numeric)July", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thanksgiving Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("a <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.5753641449035618,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("week", -2.0794415416798357),+ ("year (grain)", -2.772588722239781),+ ("second", -2.772588722239781),+ ("week (grain)", -2.0794415416798357),+ ("day", -2.0794415416798357),+ ("minute (grain)", -2.772588722239781),+ ("year", -2.772588722239781),+ ("second (grain) ", -2.772588722239781),+ ("minute", -2.772588722239781),+ ("day (grain)", -2.0794415416798357)],+ n = 9},+ koData =+ ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -1.7227665977411035),+ ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),+ ("quarter (grain)", -1.9459101490553135)],+ n = 7}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -6.782259633876106e-2,+ unseen = -4.07753744390572,+ likelihoods = HashMap.fromList [("", 0.0)], n = 57},+ koData =+ ClassData{prior = -2.7245795030534206, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (first..twentieth,thirtieth,...)",+ Classifier{okData =+ ClassData{prior = -6.899287148695143e-2,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14},+ koData =+ ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("quarter after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.252762968495368),+ ("dayday", -0.8472978603872037),+ ("day (grain)yesterday", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("week", -2.639057329615259),+ ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),+ ("this|last|next <cycle>", -2.639057329615259),+ ("day", -2.2335922215070942),+ ("time-of-day (latent)", -2.639057329615259),+ ("hhmm (latent)", -2.2335922215070942),+ ("<time-of-day> am|pm", -2.639057329615259),+ ("hour", -1.9459101490553135),+ ("next <time>", -2.639057329615259),+ ("this|next <day-of-week>", -2.639057329615259),+ ("minute", -2.2335922215070942)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),+ ("time-of-day (latent)", -2.0794415416798357),+ ("hour", -2.0794415416798357)],+ n = 2}}),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ Classifier{okData =+ ClassData{prior = -0.48130318449966897,+ unseen = -5.170483995038151,+ likelihoods =+ HashMap.fromList+ [("Wednesday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayhour", -3.2188758248682006),+ ("daymonth", -3.2188758248682006),+ ("<named-month> <day-of-month> (non ordinal)Friday",+ -4.471638793363569),+ ("Friday<named-month> <day-of-month> (non ordinal)",+ -3.7784916128036232),+ ("Wednesdayintersect", -4.471638793363569),+ ("Labor Daythis|last|next <cycle>", -4.471638793363569),+ ("Black Fridaythis|last|next <cycle>", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.471638793363569),+ ("<part-of-day> of <time>February", -4.471638793363569),+ ("Saturday<time-of-day> am|pm", -4.471638793363569),+ ("Martin Luther King's Daythis|last|next <cycle>",+ -4.471638793363569),+ ("on <date><time-of-day> am|pm", -4.471638793363569),+ ("hourmonth", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.471638793363569),+ ("dayday", -2.5998366164619773),+ ("the <day-of-month> (ordinal)February", -4.0661736852554045),+ ("WednesdayOctober", -4.471638793363569),+ ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -3.5553480614894135),+ ("dayyear", -2.8622008809294686),+ ("Saturday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.471638793363569),+ ("Thursdayhh:mm", -4.0661736852554045),+ ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),+ ("Memorial Daythis|last|next <cycle>", -4.471638793363569),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("TuesdayOctober", -4.471638793363569),+ ("the <day-of-month> (ordinal)March", -4.471638793363569),+ ("Mondaythis|last|next <cycle>", -4.471638793363569),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.0661736852554045),+ ("Fridayintersect", -4.471638793363569),+ ("Thursday<datetime> - <datetime> (interval)",+ -3.7784916128036232),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.5553480614894135),+ ("Tuesdaythis|last|next <cycle>", -4.471638793363569),+ ("Sunday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayminute", -2.6798793241355137),+ ("intersectyear", -4.471638793363569),+ ("minuteday", -3.5553480614894135),+ ("this|last|next <cycle>Sunday", -4.471638793363569),+ ("Sundaythis|last|next <cycle>", -4.471638793363569),+ ("intersectintersect", -4.471638793363569),+ ("weekday", -4.471638793363569),+ ("dayweek", -3.373026504695459),+ ("Thursday<time-of-day> am|pm", -4.471638793363569),+ ("Monday<named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("<named-month> <day-of-month> (non ordinal)year",+ -4.0661736852554045)],+ n = 55},+ koData =+ ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,+ likelihoods =+ HashMap.fromList+ [("week-endJuly", -4.197201947661808),+ ("week-endOctober", -3.5040547671018634),+ ("daymonth", -1.9999773703255892),+ ("TuesdaySeptember", -4.197201947661808),+ ("Wednesdayintersect", -4.197201947661808),+ ("hourmonth", -3.0985896589936988),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.197201947661808),+ ("Fridaythis|last|next <cycle>", -4.197201947661808),+ ("SundayFebruary", -4.197201947661808),+ ("WednesdayOctober", -4.197201947661808),+ ("week-endintersect", -4.197201947661808),+ ("dayyear", -4.197201947661808),+ ("FridayJuly", -3.791736839553644),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.197201947661808),+ ("FridaySeptember", -4.197201947661808),+ ("WednesdayFebruary", -4.197201947661808),+ ("minutemonth", -3.2809112157876537),+ ("SundayMarch", -4.197201947661808),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.197201947661808),+ ("MondayFebruary", -3.791736839553644),+ ("Fridayintersect", -4.197201947661808),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.791736839553644),+ ("dayminute", -2.810907586541918),+ ("SaturdaySeptember", -4.197201947661808),+ ("intersectSeptember", -3.2809112157876537),+ ("MondayMarch", -4.197201947661808),+ ("on <date>September", -3.791736839553644),+ ("intersectintersect", -4.197201947661808),+ ("Tuesdayintersect", -4.197201947661808),+ ("Sundayintersect", -4.197201947661808)],+ n = 34}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -0.6286086594223742, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("Father's Day", -2.6026896854443837),+ ("Martin Luther King's Day", -2.6026896854443837),+ ("Memorial Day", -2.6026896854443837),+ ("Mother's Day", -2.6026896854443837),+ ("day", -1.2163953243244932), ("Sunday", -2.6026896854443837),+ ("Thanksgiving Day", -2.6026896854443837),+ ("hour", -2.6026896854443837), ("Tuesday", -2.6026896854443837),+ ("week-end", -2.6026896854443837)],+ n = 8},+ koData =+ ClassData{prior = -0.7621400520468967, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Monday", -2.5257286443082556), ("day", -2.120263536200091),+ ("Sunday", -2.5257286443082556), ("hour", -1.4271163556401458),+ ("week-end", -1.4271163556401458)],+ n = 7}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Octoberordinal (digits)", -2.120263536200091),+ ("Thursdayordinal (digits)", -2.5257286443082556),+ ("day", -2.120263536200091),+ ("Augustordinal (digits)", -2.5257286443082556),+ ("Marchordinals (first..twentieth,thirtieth,...)",+ -2.120263536200091),+ ("Tuesdayordinal (digits)", -2.5257286443082556),+ ("month", -1.2729656758128873),+ ("Marchordinal (digits)", -2.5257286443082556)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("from|since|after <time-of-day>ordinal (digits)",+ -1.8718021769015913),+ ("Augustordinal (digits)", -1.8718021769015913),+ ("month", -1.466337068793427)],+ n = 2}}),+ ("Labor Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -2.3025850929940455),+ ("<time-of-day> am|pm", -1.6094379124341003),+ ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),+ ("minute", -1.3862943611198906)],+ n = 6},+ koData =+ ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.7227665977411035),+ ("yesterday", -2.2335922215070942),+ ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),+ ("hour", -2.639057329615259), ("minute", -1.252762968495368)],+ n = 10}}),+ ("mm.dd.yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after|before|from <time>",+ Classifier{okData =+ ClassData{prior = -0.35667494393873245,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("a <unit-of-duration>now", -2.70805020110221),+ ("a <unit-of-duration>Christmas", -2.70805020110221),+ ("<integer> <unit-of-duration>today", -2.70805020110221),+ ("daysecond", -2.70805020110221),+ ("a <unit-of-duration>right now", -2.70805020110221),+ ("minutenograin", -2.70805020110221),+ ("<integer> <unit-of-duration>Christmas", -2.70805020110221),+ ("secondnograin", -2.70805020110221),+ ("yearday", -2.0149030205422647),+ ("daynograin", -2.70805020110221),+ ("<integer> <unit-of-duration>now", -2.3025850929940455)],+ n = 7},+ koData =+ ClassData{prior = -1.2039728043259361,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -2.3978952727983707),+ ("dayday", -1.9924301646902063),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -2.3978952727983707)],+ n = 3}}),+ ("Independence Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("Martin Luther King's Day", -2.803360380906535),+ ("Halloween", -2.803360380906535),+ ("Wednesday", -2.803360380906535),+ ("Memorial Day", -2.803360380906535),+ ("Monday", -2.803360380906535),+ ("Mother's Day", -2.803360380906535),+ ("day", -1.0986122886681098),+ ("Thanksgiving Day", -2.803360380906535),+ ("March", -2.803360380906535), ("month", -2.803360380906535),+ ("Tuesday", -2.1102132003465894)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> sharp|exactly",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.1400661634962708),+ ("time-of-day (latent)", -2.1400661634962708),+ ("hhmm (latent)", -2.1400661634962708),+ ("<time-of-day> am|pm", -2.1400661634962708),+ ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),+ ("minute", -1.4469189829363254)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -7.696104113612832e-2),+ ("integer (0..19)", -2.6026896854443837)],+ n = 25}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("half an hour", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> before last|after next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("Wednesday", -1.8718021769015913),+ ("Friday", -1.466337068793427), ("day", -1.1786549963416462),+ ("March", -1.8718021769015913), ("month", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("this|last|next <cycle>", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hhmm (military) am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.3794896217049037, unseen = -4.304065093204169,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -3.1918471524802814),+ ("intersect<time-of-day> am|pm", -3.1918471524802814),+ ("minuteminute", -1.457246097092175),+ ("hh:mmhh:mm", -2.093234863812172),+ ("dayday", -3.1918471524802814),+ ("hourhour", -2.093234863812172),+ ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -3.597312260588446),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.597312260588446),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.681021528714291),+ ("from|since|after <time-of-day>hh:mm", -2.681021528714291)],+ n = 26},+ koData =+ ClassData{prior = -1.1526795099383855, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -3.1135153092103742),+ ("daymonth", -2.70805020110221),+ ("from|since|after <time-of-day>intersect", -2.70805020110221),+ ("<time-of-day> am|pmintersect", -3.1135153092103742),+ ("hh:mm<time-of-day> am|pm", -2.70805020110221),+ ("minuteminute", -1.8607523407150064),+ ("hourhour", -2.70805020110221),+ ("minutehour", -2.70805020110221),+ ("hh:mmintersect", -2.1972245773362196),+ ("<named-month> <day-of-month> (non ordinal)August",+ -3.1135153092103742),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.1135153092103742)],+ n = 12}}),+ ("Tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Day",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("fortnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> and an half hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <named-month>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -1.252762968495368), ("March", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -0.8472978603872037),+ ("month", -0.8472978603872037)],+ n = 2}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.7375989431307791, unseen = -4.110873864173311,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.529395204760564),+ ("hh:mmhh:mm", -1.8971199848858813),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -2.4849066497880004),+ ("hourhour", -1.6964492894237302),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -3.4011973816621555),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.4011973816621555),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.4849066497880004),+ ("from|since|after <time-of-day>hh:mm", -2.4849066497880004)],+ n = 22},+ koData =+ ClassData{prior = -0.6505875661411494, unseen = -4.174387269895637,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>time-of-day (latent)",+ -3.4657359027997265),+ ("hh:mmtime-of-day (latent)", -1.7609878105613013),+ ("hh:mm<time-of-day> am|pm", -3.0602707946915624),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -3.4657359027997265),+ ("at <time-of-day><time-of-day> am|pm", -3.4657359027997265),+ ("hourhour", -2.2129729343043585),+ ("minutehour", -1.2144441041932315),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.4657359027997265),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -2.5494451709255714),+ ("at <time-of-day>time-of-day (latent)", -3.0602707946915624),+ ("<integer> to|till|before <hour-of-day>time-of-day (latent)",+ -3.0602707946915624)],+ n = 24}}),+ ("military spelled out numbers am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods =+ HashMap.fromList [("integer (0..19)integer (20..90)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",+ -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -0.42121346507630353,+ unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.5455312716044354),+ ("Marchinteger (numeric)", -2.833213344056216),+ ("Aprilinteger (numeric)", -3.2386784521643803),+ ("month", -0.8407831793660099),+ ("Februaryinteger (numeric)", -1.9859154836690123),+ ("Septemberinteger (numeric)", -2.833213344056216),+ ("Octoberinteger (numeric)", -2.833213344056216),+ ("Julyinteger (numeric)", -2.1400661634962708)],+ n = 21},+ koData =+ ClassData{prior = -1.067840630001356, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.3353749158170367),+ ("Marchinteger (numeric)", -2.740840023925201),+ ("Aprilinteger (numeric)", -2.740840023925201),+ ("month", -0.9490805546971459),+ ("from|since|after <time-of-day>integer (numeric)",+ -2.3353749158170367),+ ("Julyinteger (numeric)", -1.6422277352570913)],+ n = 11}}),+ ("this|next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.2512917986064953),+ ("Wednesday", -2.2512917986064953),+ ("Monday", -1.845826690498331), ("day", -0.8649974374866046),+ ("Tuesday", -1.55814461804655)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5553480614894135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 33},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.791759469228055),+ ("daymonth", -1.2809338454620642),+ ("day (grain)intersect", -1.791759469228055),+ ("weekmonth", -1.791759469228055),+ ("week (grain)intersect", -2.1972245773362196),+ ("week (grain)September", -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)April", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Black Friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Labor Day",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("right now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -1.5040773967762742),+ ("dayday", -1.0986122886681098),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -1.5040773967762742)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.252762968495368),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -1.252762968495368)],+ n = 1}}),+ ("between <time> and <time>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0116009116784799),+ ("hh:mmhh:mm", -1.0116009116784799)],+ n = 3},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.4469189829363254),+ ("minuteminute", -1.4469189829363254),+ ("minutehour", -1.4469189829363254),+ ("hh:mmintersect", -1.4469189829363254)],+ n = 6}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6422277352570913),+ ("from|since|after <time-of-day>ordinal (digits)ordinal (digits)",+ -2.740840023925201),+ ("from|since|after <time-of-day>integer (numeric)integer (numeric)",+ -2.740840023925201),+ ("from|since|after <time-of-day>ordinal (digits)integer (numeric)",+ -2.740840023925201),+ ("Augustordinal (digits)integer (numeric)",+ -2.3353749158170367),+ ("month", -0.8690378470236094),+ ("Augustordinal (digits)ordinal (digits)",+ -2.3353749158170367)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of days",+ Classifier{okData =+ ClassData{prior = -4.0821994520255166e-2,+ unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -3.2188758248682006,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)September",+ -1.791759469228055),+ ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),+ ("ordinal (digits)ordinal (digits)October",+ -2.1972245773362196),+ ("integer (numeric)integer (numeric)July", -2.1972245773362196),+ ("month", -0.9444616088408514),+ ("ordinal (digits)ordinal (digits)August",+ -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.5257286443082556),+ ("Martin Luther King's Day", -2.5257286443082556),+ ("Monday", -2.5257286443082556), ("day", -1.1394342831883648),+ ("Thanksgiving Day", -2.5257286443082556),+ ("hour", -2.5257286443082556), ("winter", -2.5257286443082556),+ ("week-end", -2.5257286443082556),+ ("summer", -2.120263536200091)],+ n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [], n = 0}}), ("August", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357,
Duckling/Ranking/Classifiers/EN_XX.hs view
@@ -40,2306 +40,2371 @@ n = 7}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hh:mm", -1.7047480922384253), ("hour", -1.2992829841302609),- ("minute", -1.7047480922384253)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thursday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods = HashMap.fromList [("", 0.0)], n = 18},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (numeric)",- Classifier{okData =- ClassData{prior = -0.7740538191727457, unseen = -5.19295685089021,- likelihoods = HashMap.fromList [("", 0.0)], n = 178},- koData =- ClassData{prior = -0.6182992897635128,- unseen = -5.3471075307174685,- likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),- ("<duration> hence|ago",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.784189633918261,- likelihoods =- HashMap.fromList- [("week", -1.563975538357343), ("day", -1.8152899666382492),- ("year", -2.662587827025453),- ("<integer> <unit-of-duration>", -1.0531499145913523),- ("a <unit-of-duration>", -2.662587827025453),- ("month", -2.662587827025453),- ("fortnight", -2.662587827025453)],- n = 18},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("noon|midnight|EOD|end of day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter to|till|before <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Father's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<cycle> after|before <time>",- Classifier{okData =- ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.6094379124341003),- ("dayday", -1.0986122886681098),- ("day (grain)yesterday", -1.6094379124341003)],- n = 4},- koData =- ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("dayhour", -1.466337068793427),- ("year (grain)Christmas", -1.8718021769015913),- ("day (grain)intersect", -1.466337068793427),- ("yearday", -1.8718021769015913)],- n = 3}}),- ("Martin Luther King's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("integer (20..90)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/yyyy",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("integer after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("hour", -0.8109302162163288),- ("integer (numeric)time-of-day (latent)", -1.0986122886681098),- ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal or number) <named-month>",- Classifier{okData =- ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("ordinal (digits)December", -2.1400661634962708),- ("ordinal (digits)February", -2.1400661634962708),- ("integer (numeric)April", -2.1400661634962708),- ("month", -1.4469189829363254)],- n = 3},- koData =- ClassData{prior = -0.2876820724517809,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("ordinal (digits)October", -2.6741486494265287),- ("ordinal (digits)July", -2.6741486494265287),- ("integer (numeric)September", -2.268683541318364),- ("ordinal (digits)August", -2.6741486494265287),- ("integer (numeric)August", -2.6741486494265287),- ("ordinal (digits)April", -2.6741486494265287),- ("month", -1.0647107369924282),- ("integer (numeric)July", -2.268683541318364)],- n = 9}}),- ("<time> <part-of-day>",- Classifier{okData =- ClassData{prior = -9.844007281325252e-2,- unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("<day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("dayhour", -1.5284688499004333),- ("Mondayearly morning", -3.3202283191284883),- ("time-of-day (latent)tonight", -3.3202283191284883),- ("hourhour", -2.339399066116762),- ("<time-of-day> o'clockin|during the <part-of-day>",- -3.7256934272366524),- ("todaypart of days", -3.7256934272366524),- ("minutehour", -2.627081138568543),- ("at <time-of-day>in|during the <part-of-day>",- -3.3202283191284883),- ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),- ("Mondayin|during the <part-of-day>", -3.7256934272366524),- ("intersectpart of days", -3.7256934272366524),- ("intersectin|during the <part-of-day>", -3.7256934272366524),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -3.7256934272366524),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -3.7256934272366524),- ("tomorrowpart of days", -2.339399066116762),- ("hh:mmin|during the <part-of-day>", -3.0325462466767075),- ("time-of-day (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("hhmm (latent)in|during the <part-of-day>",- -3.7256934272366524),- ("yesterdaypart of days", -3.7256934272366524),- ("Mondaypart of days", -3.7256934272366524)],- n = 29},- koData =- ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,- likelihoods =- HashMap.fromList- [("yearhour", -2.740840023925201),- ("monthhour", -2.740840023925201),- ("hourhour", -2.740840023925201),- ("past year (latent)in|during the <part-of-day>",- -2.740840023925201),- ("Februaryin|during the <part-of-day>", -2.740840023925201),- ("time-of-day (latent)in|during the <part-of-day>",- -2.740840023925201)],- n = 3}}),- ("today",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd",- Classifier{okData =- ClassData{prior = -1.4271163556401458,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,- likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),- ("at <time-of-day>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -4.787491742782046,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -3.6805112044434196),- ("integer after|past <hour-of-day>", -3.6805112044434196),- ("half after|past <hour-of-day>", -4.085976312551584),- ("time-of-day (latent)", -1.7346010553881064),- ("hhmm (latent)", -3.392829131991639),- ("<time-of-day> am|pm", -1.7833912195575383),- ("hh:mm", -3.169685580677429),- ("about|exactly <time-of-day>", -3.6805112044434196),- ("hour", -1.1415373333851437),- ("<time-of-day> sharp|exactly", -4.085976312551584),- ("minute", -1.8887517352153647)],- n = 54},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.1895840668738362),- ("hour", -1.1895840668738362)],- n = 6}}),- ("December",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("absorption of , after named day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("on <date>", -2.1972245773362196),- ("Wednesday", -2.6026896854443837),- ("Saturday", -2.6026896854443837),- ("Monday", -2.1972245773362196),- ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),- ("Sunday", -2.6026896854443837)],- n = 10},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("September",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("tonight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the ides of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("on <date>",- Classifier{okData =- ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,- likelihoods =- HashMap.fromList- [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),- ("absorption of , after named day", -2.890371757896165),- ("intersect", -2.890371757896165),- ("Saturday", -2.6026896854443837),- ("Friday", -3.295836866004329), ("day", -0.8979415932059586),- ("the <day-of-month> (ordinal)", -2.890371757896165),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -2.6026896854443837),- ("hour", -3.295836866004329)],- n = 22},- koData =- ClassData{prior = -1.8718021769015913,- unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("intersect", -1.791759469228055), ("day", -1.2809338454620642),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.791759469228055)],- n = 4}}),- ("integer (0..19)",- Classifier{okData =- ClassData{prior = -2.409755157906053e-2,- unseen = -3.7612001156935624,- likelihoods = HashMap.fromList [("", 0.0)], n = 41},- koData =- ClassData{prior = -3.7376696182833684,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("between <time-of-day> and <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("minuteminute", -0.916290731874155),- ("hh:mmhh:mm", -0.916290731874155)],- n = 3},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -0.916290731874155),- ("minutehour", -0.916290731874155)],- n = 3}}),- ("Halloween",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),- ("Augustordinal (digits)integer (numeric)",- -1.6094379124341003),- ("month", -0.916290731874155),- ("Augustordinal (digits)ordinal (digits)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("October",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("month (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> more <unit-of-duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("integer (numeric)minute (grain)", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> o'clock",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("in|within|after <duration>",- Classifier{okData =- ClassData{prior = -4.652001563489282e-2,- unseen = -4.61512051684126,- likelihoods =- HashMap.fromList- [("week", -3.2188758248682006),- ("<integer> more <unit-of-duration>", -3.912023005428146),- ("three-quarters of an hour", -2.995732273553991),- ("<integer> + '\"", -3.2188758248682006),- ("number.number hours", -3.912023005428146),- ("second", -3.506557897319982), ("day", -3.2188758248682006),- ("half an hour", -2.995732273553991),- ("<integer> <unit-of-duration>", -1.6094379124341003),- ("a <unit-of-duration>", -2.995732273553991),- ("quarter of an hour", -2.995732273553991),- ("hour", -2.5257286443082556),- ("about|exactly <duration>", -3.912023005428146),- ("<integer> and an half hour", -3.912023005428146),- ("minute", -1.2729656758128873)],- n = 42},- koData =- ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("quarter", -1.8971199848858813),- ("<integer> <unit-of-duration>", -2.3025850929940455),- ("a <unit-of-duration>", -2.3025850929940455)],- n = 2}}),- ("three-quarters of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Wednesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> + '\"",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("half <integer> (UK style hour-of-day)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("July",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hour (grain)",- Classifier{okData =- ClassData{prior = -0.8209805520698302,- unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),- ("<ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -1.1786549963416462),- ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",- -1.466337068793427),- ("quarter", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.8109302162163288),- ("quarter", -0.8109302162163288)],- n = 3}}),- ("one twenty two",- Classifier{okData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)", -0.3364722366212129),- ("integer (0..19)integer (20..90)", -1.252762968495368)],- n = 5}}),- ("intersect",- Classifier{okData =- ClassData{prior = -0.4634795031687923, unseen = -6.169610732491456,- likelihoods =- HashMap.fromList- [("<datetime> - <datetime> (interval)on <date>",- -4.558078578454241),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.558078578454241),- ("hourday", -3.769621218089971),- ("dayhour", -3.223077511721901),- ("daymonth", -4.781222129768451),- ("monthday", -5.0689042022202315),- ("monthyear", -3.8649313978942956),- ("Tuesdaythe <day-of-month> (ordinal)", -5.474369310328396),- ("Christmasyear", -5.474369310328396),- ("from <datetime> - <datetime> (interval)July",- -5.474369310328396),- ("houryear", -5.474369310328396),- ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.781222129768451),- ("<time-of-day> am|pmintersect", -4.221606341833028),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -5.474369310328396),- ("Marchyear", -5.474369310328396),- ("<named-month>|<named-day> <day-of-month> (ordinal)year",- -5.0689042022202315),- ("intersect<time-of-day> am|pm", -5.474369310328396),- ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.474369310328396),- ("monthhour", -5.0689042022202315),- ("last <day-of-week> of <time>year", -5.474369310328396),- ("todayat <time-of-day>", -5.474369310328396),- ("Thursday<time> timezone", -5.0689042022202315),- ("this <time>hh(:mm) - <time-of-day> am|pm",- -5.474369310328396),- ("dayday", -3.459466289786131),- ("Thanksgiving Dayyear", -4.375757021660286),- ("<time> <part-of-day>at <time-of-day>", -5.474369310328396),- ("Tuesdayin <named-month>", -5.474369310328396),- ("mm/ddat <time-of-day>", -5.474369310328396),- ("tonightat <time-of-day>", -5.474369310328396),- ("<time-of-day> am|pmabsorption of , after named day",- -4.781222129768451),- ("today<time-of-day> am|pm", -5.474369310328396),- ("Februarythe <day-of-month> (ordinal)", -5.0689042022202315),- ("at <time-of-day><time> <part-of-day>", -5.474369310328396),- ("mm/dd<time-of-day> am|pm", -5.474369310328396),- ("hourhour", -4.221606341833028),- ("<time-of-day> am|pmon <date>", -3.459466289786131),- ("Wednesdaythis|last|next <cycle>", -5.474369310328396),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.970291913552122),- ("dayyear", -3.0320222749591914),- ("last weekend of <named-month>year", -5.474369310328396),- ("<time-of-day> o'clockin|during the <part-of-day>",- -5.474369310328396),- ("<time-of-day> am|pmtomorrow", -4.781222129768451),- ("minutehour", -4.558078578454241),- ("Mother's Dayyear", -5.474369310328396),- ("at <time-of-day>in|during the <part-of-day>",- -5.0689042022202315),- ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -3.769621218089971),- ("for <duration> from <time>December", -5.474369310328396),- ("tomorrow<time-of-day> sharp|exactly", -5.474369310328396),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.558078578454241),- ("on <date><named-month> <day-of-month> (non ordinal)",- -5.0689042022202315),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.558078578454241),- ("Mondayin|during the <part-of-day>", -5.474369310328396),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.0689042022202315),- ("intersectin|during the <part-of-day>", -5.474369310328396),- ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",- -5.474369310328396),- ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.781222129768451),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -4.558078578454241),- ("at <time-of-day>intersect", -5.0689042022202315),- ("<time-of-day> - <time-of-day> (interval)tomorrow",- -5.474369310328396),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.474369310328396),- ("dayminute", -3.1717842173343502),- ("from <datetime> - <datetime> (interval)on <date>",- -5.0689042022202315),- ("<datetime> - <datetime> (interval)tomorrow",- -5.474369310328396),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.0689042022202315),- ("<ordinal> <cycle> of <time>year", -5.474369310328396),- ("minuteday", -2.0731719286662407),- ("absorption of , after named dayintersect",- -5.474369310328396),- ("Octoberyear", -4.221606341833028),- ("the <day-of-month> (ordinal)in|during the <part-of-day>",- -5.474369310328396),- ("at <time-of-day>absorption of , after named day",- -5.474369310328396),- ("<day-of-month> (ordinal or number) <named-month>year",- -5.474369310328396),- ("year<time-of-day> am|pm", -5.474369310328396),- ("Septemberyear", -5.0689042022202315),- ("at <time-of-day>on <date>", -4.375757021660286),- ("between <time-of-day> and <time-of-day> (interval)on <date>",- -4.781222129768451),- ("Halloweenyear", -5.474369310328396),- ("dayweek", -5.474369310328396),- ("weekyear", -5.0689042022202315),- ("hh:mmin|during the <part-of-day>", -4.781222129768451),- ("Father's Dayyear", -5.474369310328396),- ("<cycle> after|before <time><time-of-day> am|pm",- -5.0689042022202315),- ("February<time> <part-of-day>", -5.474369310328396),- ("Martin Luther King's Dayyear", -5.0689042022202315),- ("tomorrowat <time-of-day>", -4.781222129768451),- ("between <time> and <time>on <date>", -4.781222129768451),- ("at <time-of-day>tomorrow", -5.0689042022202315),- ("tomorrow<time-of-day> am|pm", -5.474369310328396),- ("in|during the <part-of-day>at <time-of-day>",- -5.474369310328396),- ("black fridayyear", -5.0689042022202315),- ("Labor Dayyear", -5.474369310328396),- ("Februaryintersect", -5.474369310328396),- ("last <cycle> of <time>year", -4.781222129768451),- ("<named-month> <day-of-month> (non ordinal)year",- -5.474369310328396),- ("yearminute", -5.474369310328396)],- n = 173},- koData =- ClassData{prior = -0.9917982843823002, unseen = -5.817111159963204,- likelihoods =- HashMap.fromList- [("in <named-month>year", -5.120983351265121),- ("<time-of-day> - <time-of-day> (interval)on <date>",- -5.120983351265121),- ("hourday", -5.120983351265121),- ("<named-month> <day-of-month> (non ordinal)July",- -5.120983351265121),- ("dayhour", -3.329223882037066),- ("daymonth", -3.041541809585285),- ("monthday", -4.715518243156957),- ("monthyear", -4.427836170705175),- ("intersecthh:mm", -5.120983351265121),- ("from <datetime> - <datetime> (interval)July",- -5.120983351265121),- ("houryear", -5.120983351265121),- ("from <time-of-day> - <time-of-day> (interval)July",- -5.120983351265121),- ("until <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",- -4.427836170705175),- ("<time-of-day> am|pmintersect", -3.868220382769753),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.204692619390966),- ("Tuesdayafter <time-of-day>", -5.120983351265121),- ("July<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("absorption of , after named dayJuly", -4.715518243156957),- ("monthhour", -5.120983351265121),- ("hourmonth", -4.427836170705175),- ("todayat <time-of-day>", -5.120983351265121),- ("dayday", -4.715518243156957),- ("mm/ddat <time-of-day>", -4.715518243156957),- ("<time-of-day> am|pmon <date>", -3.868220382769753),- ("dayyear", -3.868220382769753),- ("Thursdaymm/dd", -5.120983351265121),- ("Thursdayat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>September",- -5.120983351265121),- ("monthminute", -5.120983351265121),- ("<time-of-day> am|pmtomorrow", -5.120983351265121),- ("Thursdayhh:mm", -5.120983351265121),- ("August<day-of-month> (ordinal or number) <named-month>",- -5.120983351265121),- ("Fridayyear", -4.715518243156957),- ("minutemonth", -3.416235259026696),- ("Thursdayfrom <datetime> - <datetime> (interval)",- -4.715518243156957),- ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("Aprilyear", -5.120983351265121),- ("mm/dd<time-of-day> - <time-of-day> (interval)",- -4.715518243156957),- ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",- -5.120983351265121),- ("<duration> after|before|from <time>December",- -5.120983351265121),- ("yesterday<time-of-day> am|pm", -5.120983351265121),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -4.204692619390966),- ("<named-month> <day-of-month> (non ordinal)August",- -5.120983351265121),- ("until <time-of-day>on <date>", -4.427836170705175),- ("at <time-of-day>intersect", -4.715518243156957),- ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("dayminute", -3.175073202209808),- ("intersectSeptember", -3.616905954488847),- ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",- -5.120983351265121),- ("minuteday", -2.317622970358586),- ("absorption of , after named dayintersect",- -5.120983351265121),- ("Februaryin|during the <part-of-day>", -5.120983351265121),- ("week-endin <named-month>", -5.120983351265121),- ("Octoberyear", -5.120983351265121),- ("yearhh:mm", -5.120983351265121),- ("hh:mmon <date>", -3.616905954488847),- ("absorption of , after named daySeptember",- -4.204692619390966),- ("on <date>September", -4.715518243156957),- ("at <time-of-day>on <date>", -4.715518243156957),- ("absorption of , after named dayFebruary", -4.204692619390966),- ("July<integer> to|till|before <hour-of-day>",- -5.120983351265121),- ("tomorrowat <time-of-day>", -5.120983351265121),- ("<integer> to|till|before <hour-of-day>July",- -5.120983351265121),- ("tomorrow<time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day><time-of-day> am|pm", -5.120983351265121),- ("after <time-of-day>year", -5.120983351265121),- ("yearminute", -5.120983351265121)],- n = 102}}),- ("after lunch/work/school",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("early morning",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <number> (implicit minutes)",- Classifier{okData =- ClassData{prior = -1.041453874828161, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.5596157879354228),- ("integer (0..19)", -0.8472978603872037)],- n = 12},- koData =- ClassData{prior = -0.4353180712578455,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.3448404862917295),- ("integer (0..19)", -1.2321436812926323)],- n = 22}}),- ("<ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.772588722239781,- likelihoods =- HashMap.fromList- [("daymonth", -2.0149030205422647),- ("quarteryear", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)day (grain)October",- -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",- -2.0149030205422647),- ("weekmonth", -1.6094379124341003),- ("ordinal (digits)quarter (grain)year", -2.0149030205422647),- ("ordinals (first..twentieth,thirtieth,...)week (grain)October",- -2.0149030205422647)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("year (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods = HashMap.fromList [("", 0.0)], n = 21},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.6375861597263857,- likelihoods =- HashMap.fromList- [("minuteminute", -2.001480000210124),- ("<day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("hh:mmhh:mm", -2.001480000210124),- ("dayday", -2.512305623976115),- ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",- -2.917770732084279),- ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),- ("hourhour", -2.512305623976115),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.912023005428146,- likelihoods =- HashMap.fromList- [("hourday", -3.1986731175506815),- ("dayhour", -2.793208009442517),- ("<day-of-month> (ordinal)time-of-day (latent)",- -3.1986731175506815),- ("hh:mmtime-of-day (latent)", -2.2823823856765264),- ("minuteminute", -2.793208009442517),- ("time-of-day (latent)time-of-day (latent)",- -2.793208009442517),- ("dayday", -3.1986731175506815),- ("hourhour", -2.505525936990736),- ("dayyear", -3.1986731175506815),- ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",- -3.1986731175506815),- ("minutehour", -2.2823823856765264),- ("hh:mmintersect", -2.793208009442517),- ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("time-of-day (latent)<time-of-day> am|pm",- -3.1986731175506815),- ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",- -3.1986731175506815),- ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",- -3.1986731175506815)],- n = 14}}),- ("Saturday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",- -1.7346010553881064),- ("weekmonth", -1.7346010553881064),- ("week (grain)October", -1.7346010553881064),- ("week (grain)<named-month> <day-of-month> (non ordinal)",- -1.7346010553881064),- ("weekday", -1.2237754316221157)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("number.number hours",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("from <time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("minuteminute", -1.6094379124341003),- ("hh:mmhh:mm", -1.6094379124341003),- ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),- ("hourhour", -2.3025850929940455),- ("hourminute", -2.3025850929940455),- ("time-of-day (latent)<time-of-day> sharp|exactly",- -2.70805020110221),- ("time-of-day (latent)hh:mm", -2.70805020110221),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],- n = 9},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.6094379124341003),- ("time-of-day (latent)time-of-day (latent)",- -2.0149030205422647),- ("hourhour", -1.791759469228055),- ("minutehour", -1.6094379124341003),- ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],- n = 9}}),- ("integer 21..99",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods =- HashMap.fromList [("integer (numeric)integer (numeric)", 0.0)],- n = 2}}),- ("last|next n <cycle>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -4.430816798843313,- likelihoods =- HashMap.fromList- [("week", -2.627081138568543),- ("integer (0..19)year (grain)", -3.3202283191284883),- ("integer (numeric)day (grain)", -3.0325462466767075),- ("integer (0..19)second (grain) ", -3.3202283191284883),- ("integer (0..19)hour (grain)", -3.3202283191284883),- ("second", -2.8094026953624978),- ("integer (numeric)second (grain) ", -3.3202283191284883),- ("integer (numeric)year (grain)", -3.3202283191284883),- ("day", -2.472930458741285), ("year", -2.8094026953624978),- ("integer (numeric)week (grain)", -3.0325462466767075),- ("integer (0..19)month (grain)", -3.3202283191284883),- ("hour", -2.8094026953624978), ("month", -2.8094026953624978),- ("integer (numeric)minute (grain)", -3.3202283191284883),- ("integer (0..19)minute (grain)", -3.3202283191284883),- ("integer (numeric)month (grain)", -3.3202283191284883),- ("minute", -2.8094026953624978),- ("integer (numeric)hour (grain)", -3.3202283191284883),- ("integer (0..19)day (grain)", -3.0325462466767075),- ("integer (0..19)week (grain)", -3.3202283191284883)],- n = 31},- koData =- ClassData{prior = -infinity, unseen = -3.0910424533583156,- likelihoods = HashMap.fromList [], n = 0}}),- ("yyyy-mm-dd",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("mm/dd/yyyy",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -1.6094379124341003,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("Monday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("yesterday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<ordinal> quarter <year>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh:mm:ss",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<hour-of-day> <integer>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("at <time-of-day>integer (20..90)", -1.3862943611198906),- ("hour", -0.9808292530117262),- ("at <time-of-day>integer (numeric)", -1.3862943611198906)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -1.9459101490553135,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>integer (numeric)",- -1.0986122886681098),- ("hour", -1.0986122886681098)],- n = 1}}),- ("nth <time> of <time>",- Classifier{okData =- ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("daymonth", -0.9808292530117262),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -2.0794415416798357),- ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",- -1.6739764335716716),- ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",- -1.6739764335716716)],- n = 5},- koData =- ClassData{prior = -0.9808292530117262,- unseen = -2.5649493574615367,- likelihoods =- HashMap.fromList- [("daymonth", -1.0986122886681098),- ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",- -1.791759469228055),- ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",- -1.3862943611198906)],- n = 3}}),- ("Valentine's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("April",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("end of month",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("week (grain)",- Classifier{okData =- ClassData{prior = -8.004270767353637e-2,- unseen = -3.6375861597263857,- likelihoods = HashMap.fromList [("", 0.0)], n = 36},- koData =- ClassData{prior = -2.5649493574615367,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("<part-of-day> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",- -1.6094379124341003),- ("hourday", -0.916290731874155),- ("part of daysthe <day-of-month> (ordinal)",- -1.6094379124341003),- ("part of daysthe <day-of-month> (number)",- -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("past year (latent)",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 2}}),- ("now",- Classifier{okData =- ClassData{prior = -0.15415067982725836,- unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -1.9459101490553135,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("<day-of-month> (ordinal or number) of <named-month>",- Classifier{okData =- ClassData{prior = -0.13353139262452263,- unseen = -3.0910424533583156,- likelihoods =- HashMap.fromList- [("ordinal (digits)July", -2.3513752571634776),- ("ordinals (first..twentieth,thirtieth,...)March",- -2.3513752571634776),- ("ordinal (digits)February", -2.3513752571634776),- ("integer (numeric)February", -1.9459101490553135),- ("month", -0.9650808960435872),- ("ordinal (digits)March", -2.3513752571634776),- ("integer (numeric)July", -2.3513752571634776)],- n = 7},- koData =- ClassData{prior = -2.0794415416798357,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("ordinal (digits)February", -1.5040773967762742),- ("month", -1.5040773967762742)],- n = 1}}),- ("this <part-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("hour", -0.6931471805599453),- ("part of days", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Friday",- Classifier{okData =- ClassData{prior = -0.3677247801253174,- unseen = -2.3978952727983707,- likelihoods = HashMap.fromList [("", 0.0)], n = 9},- koData =- ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("in|during the <part-of-day>",- Classifier{okData =- ClassData{prior = -8.701137698962981e-2,- unseen = -3.258096538021482,- likelihoods =- HashMap.fromList- [("early morning", -2.5257286443082556),- ("hour", -0.7339691750802004),- ("part of days", -0.8209805520698302)],- n = 11},- koData =- ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("hour", -0.916290731874155),- ("part of days", -0.916290731874155)],- n = 1}}),- ("tomorrow",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("hh(:mm) - <time-of-day> am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("this|last|next <cycle>",- Classifier{okData =- ClassData{prior = -0.15822400521489416,- unseen = -4.394449154672439,- likelihoods =- HashMap.fromList- [("week", -1.5488132906176655),- ("month (grain)", -2.995732273553991),- ("year (grain)", -1.817077277212345),- ("week (grain)", -1.5488132906176655),- ("quarter", -2.772588722239781), ("year", -1.817077277212345),- ("month", -2.995732273553991),- ("quarter (grain)", -2.772588722239781)],- n = 35},- koData =- ClassData{prior = -1.9218125974762528,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("week", -1.4816045409242156),- ("week (grain)", -1.4816045409242156),- ("day", -1.9924301646902063),- ("day (grain)", -1.9924301646902063)],- n = 6}}),- ("Mother's Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Eve",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("quarteryear", -0.6931471805599453),- ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("by <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("noon|midnight|EOD|end of day", -2.1972245773362196),- ("end of month", -2.1972245773362196),- ("time-of-day (latent)", -2.1972245773362196),- ("<time-of-day> am|pm", -2.1972245773362196),- ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),- ("month", -2.1972245773362196), ("minute", -1.791759469228055)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [], n = 0}}),- ("half an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.2006706954621511,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("ordinals (first..twentieth,thirtieth,...)",- -1.7047480922384253),- ("ordinal (digits)", -0.2006706954621511)],- n = 9},- koData =- ClassData{prior = -1.7047480922384253,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],- n = 2}}),- ("last weekend of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("October", -0.9555114450274363), ("July", -1.8718021769015913),- ("month", -0.7731898882334817)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <day-of-month> (number)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("fractional number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),- ("Sunday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("", 0.0)], n = 8},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("February",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.70805020110221,- likelihoods = HashMap.fromList [("", 0.0)], n = 13},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("minute (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.833213344056216,- likelihoods = HashMap.fromList [("", 0.0)], n = 15},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <ordinal> quarter",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)quarter (grain)", -0.6931471805599453),- ("quarter", -0.6931471805599453)],- n = 1}}),- ("time-of-day (latent)",- Classifier{okData =- ClassData{prior = -0.5363047090669756, unseen = -4.174387269895637,- likelihoods =- HashMap.fromList- [("integer (numeric)", -0.1158318155251217),- ("integer (0..19)", -2.2129729343043585)],- n = 62},- koData =- ClassData{prior = -0.8792494601938059,- unseen = -3.8501476017100584,- likelihoods =- HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)],- n = 44}}),- ("year",- Classifier{okData =- ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 34},- koData =- ClassData{prior = -1.6582280766035324,- unseen = -2.3025850929940455,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 8}}),- ("last <day-of-week> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("daymonth", -0.916290731874155),- ("SundayMarch", -1.6094379124341003),- ("MondayMarch", -1.6094379124341003),- ("Sundayintersect", -1.6094379124341003)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.7444404749474959, unseen = -4.605170185988091,- likelihoods =- HashMap.fromList- [("week", -2.3978952727983707),- ("integer (0..19)year (grain)", -3.2088254890146994),- ("integer (numeric)day (grain)", -2.515678308454754),- ("integer (0..19)second (grain) ", -3.9019726695746444),- ("integer (0..19)hour (grain)", -2.803360380906535),- ("second", -3.9019726695746444),- ("integer (numeric)year (grain)", -3.9019726695746444),- ("day", -2.515678308454754), ("year", -2.9856819377004897),- ("integer (numeric)week (grain)", -2.9856819377004897),- ("integer (0..19)month (grain)", -3.4965075614664802),- ("hour", -2.515678308454754), ("month", -3.4965075614664802),- ("integer (numeric)minute (grain)", -2.9856819377004897),- ("integer (0..19)minute (grain)", -2.803360380906535),- ("minute", -2.2925347571405443),- ("integer (numeric)hour (grain)", -3.4965075614664802),- ("integer (0..19)week (grain)", -2.9856819377004897)],- n = 38},- koData =- ClassData{prior = -0.6443570163905132, unseen = -4.68213122712422,- likelihoods =- HashMap.fromList- [("week", -2.8810693652338513),- ("integer (0..19)year (grain)", -3.5742165457937967),- ("integer (numeric)day (grain)", -3.2865344733420154),- ("integer (0..19)second (grain) ", -3.5742165457937967),- ("integer (0..19)hour (grain)", -3.5742165457937967),- ("second", -3.0633909220278057),- ("integer (numeric)second (grain) ", -3.5742165457937967),- ("integer (numeric)year (grain)", -3.5742165457937967),- ("day", -2.7269186854065928), ("quarter", -3.979681653901961),- ("year", -3.0633909220278057),- ("integer (numeric)week (grain)", -3.2865344733420154),- ("integer (0..19)month (grain)", -3.5742165457937967),- ("hour", -1.9647786333596962), ("month", -3.0633909220278057),- ("integer (numeric)minute (grain)", -3.5742165457937967),- ("integer (0..19)minute (grain)", -3.5742165457937967),- ("integer (numeric)month (grain)", -3.5742165457937967),- ("minute", -3.0633909220278057),- ("integer (numeric)hour (grain)", -2.1078794770003695),- ("integer (0..19)day (grain)", -3.2865344733420154),- ("integer (0..19)week (grain)", -3.5742165457937967),- ("integer (0..19)quarter (grain)", -3.979681653901961)],- n = 42}}),- ("hhmm (latent)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> am|pm",- Classifier{okData =- ClassData{prior = -0.2847365622220242, unseen = -5.231108616854587,- likelihoods =- HashMap.fromList- [("integer after|past <hour-of-day>", -3.8394523125933104),- ("at <time-of-day>", -2.2300144001592104),- ("<time-of-day> o'clock", -4.127134385045092),- ("half after|past <hour-of-day>", -4.127134385045092),- ("time-of-day (latent)", -1.7600107709134747),- ("hhmm (latent)", -4.532599493153256),- ("hh:mm", -2.181224235989778),- ("quarter after|past <hour-of-day>", -4.532599493153256),- ("about|exactly <time-of-day>", -4.532599493153256),- ("until <time-of-day>", -3.8394523125933104),- ("hour", -1.2939210409888755),- ("<time-of-day> sharp|exactly", -4.532599493153256),- ("minute", -1.6422277352570913),- ("after <time-of-day>", -4.532599493153256)],- n = 85},- koData =- ClassData{prior = -1.3951833085371366, unseen = -4.290459441148391,- likelihoods =- HashMap.fromList- [("<integer> to|till|before <hour-of-day>", -3.1780538303479458),- ("<hour-of-day> <integer>", -3.58351893845611),- ("time-of-day (latent)", -1.0577902941478545),- ("hour", -1.0185695809945732), ("minute", -2.890371757896165),- ("after <time-of-day>", -3.58351893845611)],- n = 28}}),- ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("ordinal (digits)ordinal (digits)July", -1.252762968495368),- ("integer (numeric)integer (numeric)July", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("Thanksgiving Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.5649493574615367,- likelihoods = HashMap.fromList [("", 0.0)], n = 11},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of <named-month>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,- likelihoods =- HashMap.fromList- [("March", -0.6931471805599453), ("month", -0.6931471805599453)],- n = 3},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("a <unit-of-duration>",- Classifier{okData =- ClassData{prior = -0.5753641449035618,- unseen = -3.4965075614664802,- likelihoods =- HashMap.fromList- [("week", -2.0794415416798357),- ("year (grain)", -2.772588722239781),- ("second", -2.772588722239781),- ("week (grain)", -2.0794415416798357),- ("day", -2.0794415416798357),- ("minute (grain)", -2.772588722239781),- ("year", -2.772588722239781),- ("second (grain) ", -2.772588722239781),- ("minute", -2.772588722239781),- ("day (grain)", -2.0794415416798357)],- n = 9},- koData =- ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("hour (grain)", -1.7227665977411035),- ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),- ("quarter (grain)", -1.9459101490553135)],- n = 7}}),- ("hh:mm",- Classifier{okData =- ClassData{prior = -5.406722127027582e-2,- unseen = -4.02535169073515,- likelihoods = HashMap.fromList [("", 0.0)], n = 54},- koData =- ClassData{prior = -2.9444389791664407,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),- ("quarter of an hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("second (grain) ",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinals (first..twentieth,thirtieth,...)",- Classifier{okData =- ClassData{prior = -6.899287148695143e-2,- unseen = -2.772588722239781,- likelihoods = HashMap.fromList [("", 0.0)], n = 14},- koData =- ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("quarter after|past <hour-of-day>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -0.6931471805599453),- ("hour", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("the <cycle> after|before <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("day (grain)tomorrow", -1.252762968495368),- ("dayday", -0.8472978603872037),- ("day (grain)yesterday", -1.252762968495368)],- n = 2},- koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),- ("about|exactly <time-of-day>",- Classifier{okData =- ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("week", -2.639057329615259),- ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),- ("this|last|next <cycle>", -2.639057329615259),- ("day", -2.2335922215070942),- ("time-of-day (latent)", -2.639057329615259),- ("hhmm (latent)", -2.2335922215070942),- ("<time-of-day> am|pm", -2.639057329615259),- ("hour", -1.9459101490553135),- ("next <time>", -2.639057329615259),- ("this|next <day-of-week>", -2.639057329615259),- ("minute", -2.2335922215070942)],- n = 8},- koData =- ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,- likelihoods =- HashMap.fromList- [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),- ("time-of-day (latent)", -2.0794415416798357),- ("hour", -2.0794415416798357)],- n = 2}}),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- Classifier{okData =- ClassData{prior = -0.48130318449966897,- unseen = -5.170483995038151,- likelihoods =- HashMap.fromList- [("Wednesday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayhour", -3.2188758248682006),- ("daymonth", -3.2188758248682006),- ("<named-month> <day-of-month> (non ordinal)Friday",- -4.471638793363569),- ("Friday<named-month> <day-of-month> (non ordinal)",- -3.7784916128036232),- ("Wednesdayintersect", -4.471638793363569),- ("Labor Daythis|last|next <cycle>", -4.471638793363569),- ("black fridaythis|last|next <cycle>", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"year",- -4.471638793363569),- ("<part-of-day> of <time>February", -4.471638793363569),- ("Saturday<time-of-day> am|pm", -4.471638793363569),- ("Martin Luther King's Daythis|last|next <cycle>",- -4.471638793363569),- ("on <date><time-of-day> am|pm", -4.471638793363569),- ("hourmonth", -4.471638793363569),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.471638793363569),- ("dayday", -2.5998366164619773),- ("the <day-of-month> (ordinal)February", -4.0661736852554045),- ("WednesdayOctober", -4.471638793363569),- ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),- ("intersect<named-month> <day-of-month> (non ordinal)",- -3.5553480614894135),- ("dayyear", -2.8622008809294686),- ("Saturday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.471638793363569),- ("Thursdayhh:mm", -4.0661736852554045),- ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),- ("Memorial Daythis|last|next <cycle>", -4.471638793363569),- ("on <date><named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("TuesdayOctober", -4.471638793363569),- ("the <day-of-month> (ordinal)March", -4.471638793363569),- ("Mondaythis|last|next <cycle>", -4.471638793363569),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.0661736852554045),- ("Fridayintersect", -4.471638793363569),- ("Thursday<datetime> - <datetime> (interval)",- -3.7784916128036232),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.5553480614894135),- ("Tuesdaythis|last|next <cycle>", -4.471638793363569),- ("Sunday<named-month> <day-of-month> (non ordinal)",- -4.471638793363569),- ("dayminute", -2.6798793241355137),- ("intersectyear", -4.471638793363569),- ("minuteday", -3.5553480614894135),- ("this|last|next <cycle>Sunday", -4.471638793363569),- ("Sundaythis|last|next <cycle>", -4.471638793363569),- ("intersectintersect", -4.471638793363569),- ("weekday", -4.471638793363569),- ("dayweek", -3.373026504695459),- ("Thursday<time-of-day> am|pm", -4.471638793363569),- ("Monday<named-month> <day-of-month> (non ordinal)",- -4.0661736852554045),- ("<named-month> <day-of-month> (non ordinal)year",- -4.0661736852554045)],- n = 55},- koData =- ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,- likelihoods =- HashMap.fromList- [("week-endJuly", -4.197201947661808),- ("week-endOctober", -3.5040547671018634),- ("daymonth", -1.9999773703255892),- ("TuesdaySeptember", -4.197201947661808),- ("Wednesdayintersect", -4.197201947661808),- ("hourmonth", -3.0985896589936988),- ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",- -4.197201947661808),- ("Fridaythis|last|next <cycle>", -4.197201947661808),- ("SundayFebruary", -4.197201947661808),- ("WednesdayOctober", -4.197201947661808),- ("week-endintersect", -4.197201947661808),- ("dayyear", -4.197201947661808),- ("FridayJuly", -3.791736839553644),- ("<named-month> <day-of-month> (non ordinal)intersect",- -4.197201947661808),- ("FridaySeptember", -4.197201947661808),- ("WednesdayFebruary", -4.197201947661808),- ("minutemonth", -3.2809112157876537),- ("SundayMarch", -4.197201947661808),- ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",- -4.197201947661808),- ("MondayFebruary", -3.791736839553644),- ("Fridayintersect", -4.197201947661808),- ("Thursday<time-of-day> - <time-of-day> (interval)",- -3.791736839553644),- ("dayminute", -2.810907586541918),- ("SaturdaySeptember", -4.197201947661808),- ("intersectSeptember", -3.2809112157876537),- ("MondayMarch", -4.197201947661808),- ("on <date>September", -3.791736839553644),- ("intersectintersect", -4.197201947661808),- ("Tuesdayintersect", -4.197201947661808),- ("Sundayintersect", -4.197201947661808)],- n = 34}}),- ("last <time>",- Classifier{okData =- ClassData{prior = -1.0116009116784799,- unseen = -3.4011973816621555,- likelihoods =- HashMap.fromList- [("Father's Day", -2.6741486494265287),- ("Martin Luther King's Day", -2.6741486494265287),- ("Memorial Day", -2.6741486494265287),- ("Mother's Day", -2.6741486494265287),- ("day", -1.2878542883066382), ("Sunday", -2.6741486494265287),- ("Thanksgiving Day", -2.6741486494265287),- ("hour", -2.6741486494265287), ("Tuesday", -2.6741486494265287),- ("week-end", -2.6741486494265287)],- n = 8},- koData =- ClassData{prior = -0.45198512374305727,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("intersect", -3.0204248861443626),- ("Monday", -3.0204248861443626), ("day", -2.1041341542702074),- ("Sunday", -3.0204248861443626),- ("intersect by \",\", \"of\", \"from\", \"'s\"",- -1.7676619176489945),- ("hour", -1.3156767939059373),- ("week-end", -1.9218125974762528)],- n = 14}}),- ("March",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods = HashMap.fromList [("", 0.0)], n = 17},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<named-month>|<named-day> <day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = -0.11778303565638351,- unseen = -3.2188758248682006,- likelihoods =- HashMap.fromList- [("Octoberordinal (digits)", -2.0794415416798357),- ("Thursdayordinal (digits)", -2.4849066497880004),- ("day", -2.0794415416798357),- ("Augustordinal (digits)", -2.4849066497880004),- ("Marchordinals (first..twentieth,thirtieth,...)",- -2.0794415416798357),- ("Tuesdayordinal (digits)", -2.4849066497880004),- ("month", -1.2321436812926323),- ("Marchordinal (digits)", -2.4849066497880004)],- n = 8},- koData =- ClassData{prior = -2.1972245773362196,- unseen = -2.3978952727983707,- likelihoods =- HashMap.fromList- [("Augustordinal (digits)", -1.6094379124341003),- ("month", -1.6094379124341003)],- n = 1}}),- ("Labor Day weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month> (ordinal)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("Christmas",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("", 0.0)], n = 6},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("until <time-of-day>",- Classifier{okData =- ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -2.3025850929940455),- ("<time-of-day> am|pm", -1.6094379124341003),- ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),- ("minute", -1.3862943611198906)],- n = 6},- koData =- ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,- likelihoods =- HashMap.fromList- [("intersect", -1.7227665977411035),- ("yesterday", -2.2335922215070942),- ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),- ("hour", -2.639057329615259), ("minute", -1.252762968495368)],- n = 10}}),- ("<duration> after|before|from <time>",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.4339872044851463,- likelihoods =- HashMap.fromList- [("a <unit-of-duration>now", -2.70805020110221),- ("a <unit-of-duration>Christmas", -2.70805020110221),- ("<integer> <unit-of-duration>today", -2.70805020110221),- ("daysecond", -2.70805020110221),- ("a <unit-of-duration>right now", -2.70805020110221),- ("minutenograin", -2.70805020110221),- ("<integer> <unit-of-duration>Christmas", -2.70805020110221),- ("secondnograin", -2.70805020110221),- ("yearday", -2.0149030205422647),- ("daynograin", -2.70805020110221),- ("<integer> <unit-of-duration>now", -2.3025850929940455)],- n = 7},- koData =- ClassData{prior = -1.2039728043259361,- unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("dayhour", -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal)",- -2.3978952727983707),- ("dayday", -1.9924301646902063),- ("<integer> <unit-of-duration>time-of-day (latent)",- -2.3978952727983707),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -2.3978952727983707)],- n = 3}}),- ("Independence Day",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("decimal number",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("next <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5263605246161616,- likelihoods =- HashMap.fromList- [("Martin Luther King's Day", -2.803360380906535),- ("Halloween", -2.803360380906535),- ("Wednesday", -2.803360380906535),- ("Memorial Day", -2.803360380906535),- ("Monday", -2.803360380906535),- ("Mother's Day", -2.803360380906535),- ("day", -1.0986122886681098),- ("Thanksgiving Day", -2.803360380906535),- ("March", -2.803360380906535), ("month", -2.803360380906535),- ("Tuesday", -2.1102132003465894)],- n = 11},- koData =- ClassData{prior = -infinity, unseen = -2.4849066497880004,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time-of-day> sharp|exactly",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("at <time-of-day>", -2.1400661634962708),- ("time-of-day (latent)", -2.1400661634962708),- ("hhmm (latent)", -2.1400661634962708),- ("<time-of-day> am|pm", -2.1400661634962708),- ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),- ("minute", -1.4469189829363254)],- n = 5},- koData =- ClassData{prior = -infinity, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [], n = 0}}),- ("Memorial Day Weekend",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("negative numbers",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 24}}),- ("about|exactly <duration>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("half an hour", -0.6931471805599453),- ("minute", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("<time> before last|after next",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods =- HashMap.fromList- [("Wednesday", -1.8718021769015913),- ("Friday", -1.466337068793427), ("day", -1.1786549963416462),- ("March", -1.8718021769015913), ("month", -1.8718021769015913)],- n = 4},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("by the end of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("this|last|next <cycle>", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("hhmm (military) am|pm",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<datetime> - <datetime> (interval)",- Classifier{okData =- ClassData{prior = -0.48550781578170077,- unseen = -3.891820298110627,- likelihoods =- HashMap.fromList- [("minuteminute", -1.4733057381095205),- ("hh:mmhh:mm", -1.6739764335716716),- ("dayday", -2.772588722239781),- ("hourhour", -2.2617630984737906),- ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",- -2.772588722239781),- ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",- -3.1780538303479458),- ("<time-of-day> am|pm<time-of-day> am|pm",- -2.4849066497880004)],- n = 16},- koData =- ClassData{prior = -0.9555114450274363,- unseen = -3.6109179126442243,- likelihoods =- HashMap.fromList- [("<named-month> <day-of-month> (non ordinal)July",- -2.890371757896165),- ("daymonth", -2.4849066497880004),- ("<time-of-day> am|pmintersect", -2.890371757896165),- ("hh:mm<time-of-day> am|pm", -2.4849066497880004),- ("minuteminute", -1.9740810260220096),- ("hourhour", -2.4849066497880004),- ("minutehour", -2.4849066497880004),- ("hh:mmintersect", -1.9740810260220096),- ("<named-month> <day-of-month> (non ordinal)August",- -2.890371757896165),- ("about|exactly <time-of-day><time-of-day> am|pm",- -2.890371757896165)],- n = 10}}),- ("Tuesday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("New Year's Day",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),- ("fortnight",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<integer> and an half hour",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("in <named-month>",- Classifier{okData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -1.252762968495368), ("March", -1.252762968495368),- ("month", -0.8472978603872037)],- n = 2},- koData =- ClassData{prior = -0.6931471805599453,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("October", -0.8472978603872037),- ("month", -0.8472978603872037)],- n = 2}}),- ("<time-of-day> - <time-of-day> (interval)",- Classifier{okData =- ClassData{prior = -0.8873031950009028,- unseen = -3.7376696182833684,- likelihoods =- HashMap.fromList- [("minuteminute", -1.5163474893680884),- ("hh:mmhh:mm", -1.5163474893680884),- ("<time-of-day> am|pmtime-of-day (latent)", -2.327277705584417),- ("hourhour", -1.7676619176489945),- ("<time-of-day> am|pm<time-of-day> am|pm", -2.327277705584417)],- n = 14},- koData =- ClassData{prior = -0.5306282510621704,- unseen = -3.9889840465642745,- likelihoods =- HashMap.fromList- [("about|exactly <time-of-day>time-of-day (latent)",- -3.2771447329921766),- ("hh:mmtime-of-day (latent)", -1.5723966407537513),- ("hh:mm<time-of-day> am|pm", -2.871679624884012),- ("<time-of-day> am|pmtime-of-day (latent)",- -3.2771447329921766),- ("at <time-of-day><time-of-day> am|pm", -3.2771447329921766),- ("hourhour", -2.0243817644968085),- ("minutehour", -1.262241712449912),- ("about|exactly <time-of-day><time-of-day> am|pm",- -3.2771447329921766),- ("at <time-of-day>time-of-day (latent)", -2.871679624884012),- ("<integer> to|till|before <hour-of-day>time-of-day (latent)",- -2.871679624884012)],- n = 20}}),- ("nth <time> after <time>",- Classifier{okData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",- -0.916290731874155)],- n = 1},- koData =- ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,- likelihoods =- HashMap.fromList- [("dayday", -0.916290731874155),- ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",- -0.916290731874155)],- n = 1}}),- ("<named-month> <day-of-month> (non ordinal)",- Classifier{okData =- ClassData{prior = -0.35667494393873245,- unseen = -3.9318256327243257,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.5257286443082556),- ("Marchinteger (numeric)", -2.8134107167600364),- ("Aprilinteger (numeric)", -3.2188758248682006),- ("month", -0.8209805520698302),- ("Februaryinteger (numeric)", -1.9661128563728327),- ("Septemberinteger (numeric)", -2.8134107167600364),- ("Octoberinteger (numeric)", -2.8134107167600364),- ("Julyinteger (numeric)", -2.120263536200091)],- n = 21},- koData =- ClassData{prior = -1.2039728043259361, unseen = -3.295836866004329,- likelihoods =- HashMap.fromList- [("Augustinteger (numeric)", -2.159484249353372),- ("Marchinteger (numeric)", -2.5649493574615367),- ("Aprilinteger (numeric)", -2.5649493574615367),- ("month", -0.9555114450274363),- ("Julyinteger (numeric)", -1.466337068793427)],- n = 9}}),- ("this|next <day-of-week>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.995732273553991,- likelihoods =- HashMap.fromList- [("Thursday", -2.2512917986064953),- ("Wednesday", -2.2512917986064953),- ("Monday", -1.845826690498331), ("day", -0.8649974374866046),- ("Tuesday", -1.55814461804655)],- n = 7},- koData =- ClassData{prior = -infinity, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [], n = 0}}),- ("ordinal (digits)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.5553480614894135,- likelihoods = HashMap.fromList [("", 0.0)], n = 33},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("quarter (grain)",- Classifier{okData =- ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,- likelihoods = HashMap.fromList [("", 0.0)], n = 12},- koData =- ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),- ("last <cycle> of <time>",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("day (grain)October", -1.791759469228055),- ("daymonth", -1.2809338454620642),- ("day (grain)intersect", -1.791759469228055),- ("weekmonth", -1.791759469228055),- ("week (grain)intersect", -2.1972245773362196),- ("week (grain)September", -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("seasons",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("<day-of-month>(ordinal) <named-month> year",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList- [("ordinal (digits)April", -0.6931471805599453),- ("month", -0.6931471805599453)],- n = 1},- koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [], n = 0}}),- ("Labor Day",- Classifier{okData =- ClassData{prior = -0.2876820724517809,- unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -1.3862943611198906,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("week-end",- Classifier{okData =- ClassData{prior = -1.5040773967762742,- unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},- koData =- ClassData{prior = -0.25131442828090605,- unseen = -2.1972245773362196,- likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),- ("after <time-of-day>",- Classifier{okData =- ClassData{prior = -1.6094379124341003,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("time-of-day (latent)", -1.7047480922384253),- ("<time-of-day> am|pm", -1.7047480922384253),- ("hour", -1.2992829841302609)],- n = 2},- koData =- ClassData{prior = -0.2231435513142097,- unseen = -3.1780538303479458,- likelihoods =- HashMap.fromList- [("intersect", -2.03688192726104),- ("tomorrow", -2.03688192726104), ("day", -1.3437347467010947),- ("time-of-day (latent)", -2.4423470353692043),- ("<time-of-day> am|pm", -2.4423470353692043),- ("Christmas", -2.03688192726104), ("hour", -1.749199854809259)],- n = 8}}),- ("day (grain)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.2188758248682006,- likelihoods = HashMap.fromList [("", 0.0)], n = 23},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("black friday",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("", 0.0)], n = 4},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("right now",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [("", 0.0)], n = 3},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}),- ("for <duration> from <time>",- Classifier{okData =- ClassData{prior = -0.40546510810816444,- unseen = -2.3025850929940455,- likelihoods =- HashMap.fromList- [("<integer> <unit-of-duration><day-of-month> (ordinal)",- -1.5040773967762742),- ("dayday", -1.0986122886681098),- ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",- -1.5040773967762742)],- n = 2},- koData =- ClassData{prior = -1.0986122886681098,- unseen = -2.0794415416798357,- likelihoods =- HashMap.fromList- [("dayhour", -1.252762968495368),- ("<integer> <unit-of-duration>time-of-day (latent)",- -1.252762968495368)],- n = 1}}),- ("between <time> and <time>",- Classifier{okData =- ClassData{prior = -1.0986122886681098,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("minuteminute", -1.0116009116784799),- ("hh:mmhh:mm", -1.0116009116784799)],- n = 3},- koData =- ClassData{prior = -0.40546510810816444,- unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("hh:mmtime-of-day (latent)", -1.4469189829363254),- ("minuteminute", -1.4469189829363254),- ("minutehour", -1.4469189829363254),- ("hh:mmintersect", -1.4469189829363254)],- n = 6}}),- ("<month> dd-dd (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -3.1354942159291497,- likelihoods =- HashMap.fromList- [("Julyinteger (numeric)integer (numeric)", -1.2992829841302609),- ("Augustordinal (digits)integer (numeric)",- -1.9924301646902063),- ("month", -0.7884573603642702),- ("Augustordinal (digits)ordinal (digits)",- -1.9924301646902063)],- n = 9},- koData =- ClassData{prior = -infinity, unseen = -1.6094379124341003,- likelihoods = HashMap.fromList [], n = 0}}),- ("part of days",- Classifier{okData =- ClassData{prior = -4.0821994520255166e-2,- unseen = -3.258096538021482,- likelihoods = HashMap.fromList [("", 0.0)], n = 24},- koData =- ClassData{prior = -3.2188758248682006,- unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),- ("dd-dd <month> (interval)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -2.9444389791664407,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)September",- -1.791759469228055),- ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),- ("ordinal (digits)ordinal (digits)October",- -2.1972245773362196),- ("integer (numeric)integer (numeric)July", -2.1972245773362196),- ("month", -0.9444616088408514),- ("ordinal (digits)ordinal (digits)August",- -2.1972245773362196)],- n = 6},- koData =- ClassData{prior = -infinity, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [], n = 0}}),- ("this <time>",- Classifier{okData =- ClassData{prior = -0.10536051565782628,- unseen = -3.332204510175204,- likelihoods =- HashMap.fromList- [("Thursday", -2.6026896854443837),- ("Martin Luther King's Day", -2.6026896854443837),- ("intersect", -2.6026896854443837),- ("Monday", -2.6026896854443837), ("day", -1.2163953243244932),- ("Thanksgiving Day", -2.6026896854443837),- ("hour", -2.1972245773362196), ("seasons", -1.9095425048844386),- ("week-end", -2.6026896854443837)],- n = 9},- koData =- ClassData{prior = -2.3025850929940455,- unseen = -2.4849066497880004,- likelihoods =- HashMap.fromList- [("intersect", -1.7047480922384253),- ("day", -1.7047480922384253)],- n = 1}}),+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.824549292051046),+ ("<time-of-day> am|pm", -1.6422277352570913),+ ("hh:mm", -1.824549292051046), ("hour", -1.1314021114911006),+ ("minute", -1.824549292051046)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.7765287894989963, unseen = -5.225746673713201,+ likelihoods = HashMap.fromList [("", 0.0)], n = 184},+ koData =+ ClassData{prior = -0.616186139423817, unseen = -5.384495062789089,+ likelihoods = HashMap.fromList [("", 0.0)], n = 216}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.784189633918261,+ likelihoods =+ HashMap.fromList+ [("week", -1.563975538357343), ("day", -1.8152899666382492),+ ("year", -2.662587827025453),+ ("<integer> <unit-of-duration>", -1.0531499145913523),+ ("a <unit-of-duration>", -2.662587827025453),+ ("month", -2.662587827025453),+ ("fortnight", -2.662587827025453)],+ n = 18},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("noon|midnight|EOD|end of day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter to|till|before <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.6094379124341003),+ ("dayday", -1.0986122886681098),+ ("day (grain)yesterday", -1.6094379124341003)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.466337068793427),+ ("year (grain)Christmas", -1.8718021769015913),+ ("day (grain)intersect", -1.466337068793427),+ ("yearday", -1.8718021769015913)],+ n = 3}}),+ ("Martin Luther King's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("mm/yyyy",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("integer after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("hour", -0.8109302162163288),+ ("integer (numeric)time-of-day (latent)", -1.0986122886681098),+ ("integer (20..90)time-of-day (latent)", -1.5040773967762742)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal or number) <named-month>",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)December", -2.1400661634962708),+ ("ordinal (digits)February", -2.1400661634962708),+ ("integer (numeric)April", -2.1400661634962708),+ ("month", -1.4469189829363254)],+ n = 3},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)October", -2.6741486494265287),+ ("ordinal (digits)July", -2.6741486494265287),+ ("integer (numeric)September", -2.268683541318364),+ ("ordinal (digits)August", -2.6741486494265287),+ ("integer (numeric)August", -2.6741486494265287),+ ("ordinal (digits)April", -2.6741486494265287),+ ("month", -1.0647107369924282),+ ("integer (numeric)July", -2.268683541318364)],+ n = 9}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -9.844007281325252e-2,+ unseen = -4.430816798843313,+ likelihoods =+ HashMap.fromList+ [("<day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("dayhour", -1.5284688499004333),+ ("Mondayearly morning", -3.3202283191284883),+ ("time-of-day (latent)tonight", -3.3202283191284883),+ ("hourhour", -2.339399066116762),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -3.7256934272366524),+ ("todaypart of days", -3.7256934272366524),+ ("minutehour", -2.627081138568543),+ ("at <time-of-day>in|during the <part-of-day>",+ -3.3202283191284883),+ ("time-of-day (latent)this <part-of-day>", -3.7256934272366524),+ ("Mondayin|during the <part-of-day>", -3.7256934272366524),+ ("intersectpart of days", -3.7256934272366524),+ ("intersectin|during the <part-of-day>", -3.7256934272366524),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -3.7256934272366524),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -3.7256934272366524),+ ("tomorrowpart of days", -2.339399066116762),+ ("hh:mmin|during the <part-of-day>", -3.0325462466767075),+ ("time-of-day (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("hhmm (latent)in|during the <part-of-day>",+ -3.7256934272366524),+ ("yesterdaypart of days", -3.7256934272366524),+ ("Mondaypart of days", -3.7256934272366524)],+ n = 29},+ koData =+ ClassData{prior = -2.367123614131617, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("yearhour", -2.740840023925201),+ ("monthhour", -2.740840023925201),+ ("hourhour", -2.740840023925201),+ ("past year (latent)in|during the <part-of-day>",+ -2.740840023925201),+ ("Februaryin|during the <part-of-day>", -2.740840023925201),+ ("time-of-day (latent)in|during the <part-of-day>",+ -2.740840023925201)],+ n = 3}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd",+ Classifier{okData =+ ClassData{prior = -1.4271163556401458,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -9.381875521765486e-2,+ unseen = -4.90527477843843,+ likelihoods =+ HashMap.fromList+ [("<time> timezone", -3.7992275112828016),+ ("noon|midnight|EOD|end of day", -3.7992275112828016),+ ("integer after|past <hour-of-day>", -3.7992275112828016),+ ("half after|past <hour-of-day>", -4.204692619390966),+ ("time-of-day (latent)", -1.7197859696029658),+ ("hhmm (latent)", -3.5115454388310208),+ ("<time-of-day> am|pm", -1.8067973465925955),+ ("hh:mm", -3.288401887516811),+ ("about|exactly <time-of-day>", -3.7992275112828016),+ ("hour", -1.0911773101805915),+ ("<time-of-day> sharp|exactly", -4.204692619390966),+ ("minute", -2.0074680420547466)],+ n = 61},+ koData =+ ClassData{prior = -2.412933150162911, unseen = -3.2188758248682006,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.2321436812926323),+ ("hour", -1.2321436812926323)],+ n = 6}}),+ ("December",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("on <date>", -2.1972245773362196),+ ("Wednesday", -2.6026896854443837),+ ("Saturday", -2.6026896854443837),+ ("Monday", -2.1972245773362196),+ ("Friday", -1.9095425048844386), ("day", -0.8979415932059586),+ ("Sunday", -2.6026896854443837)],+ n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tonight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last|past|next <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("week", -2.456735772821304), ("second", -2.639057329615259),+ ("day", -2.3025850929940455), ("year", -2.639057329615259),+ ("<integer> <unit-of-duration>", -0.7827593392496325),+ ("hour", -2.639057329615259), ("month", -2.639057329615259),+ ("minute", -2.639057329615259)],+ n = 31},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the ides of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.1670540846631662, unseen = -4.007333185232471,+ likelihoods =+ HashMap.fromList+ [("Thursday", -1.791759469228055), ("mm/dd", -3.295836866004329),+ ("absorption of , after named day", -2.890371757896165),+ ("intersect", -2.890371757896165),+ ("Saturday", -2.6026896854443837),+ ("Friday", -3.295836866004329), ("day", -0.8979415932059586),+ ("the <day-of-month> (ordinal)", -2.890371757896165),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -2.6026896854443837),+ ("hour", -3.295836866004329)],+ n = 22},+ koData =+ ClassData{prior = -1.8718021769015913,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.791759469228055), ("day", -1.2809338454620642),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ -1.791759469228055)],+ n = 4}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.784189633918261,+ likelihoods = HashMap.fromList [("", 0.0)], n = 42},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -0.916290731874155),+ ("hh:mmhh:mm", -0.916290731874155)],+ n = 3},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -0.916290731874155),+ ("minutehour", -0.916290731874155)],+ n = 3}}),+ ("Halloween",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6094379124341003),+ ("Augustordinal (digits)integer (numeric)",+ -1.6094379124341003),+ ("month", -0.916290731874155),+ ("Augustordinal (digits)ordinal (digits)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from|since|after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("July", -3.3141860046725258),+ ("time-of-day (latent)", -2.3978952727983707),+ ("<time-of-day> am|pm", -2.3978952727983707),+ ("hh:mm", -2.3978952727983707), ("hour", -1.8101086078962516),+ ("month", -2.908720896564361), ("minute", -2.3978952727983707),+ ("August", -3.3141860046725258)],+ n = 14},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -4.836281906951478,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.7297014486341915),+ ("week", -4.135166556742356),+ ("<day-of-month> (ordinal or number) <named-month>",+ -4.135166556742356),+ ("today", -4.135166556742356),+ ("intersect", -2.7488721956224653),+ ("second", -4.135166556742356), ("now", -3.4420193761824103),+ ("tomorrow", -3.7297014486341915),+ ("this|last|next <cycle>", -4.135166556742356),+ ("day", -1.995100393246085),+ ("time-of-day (latent)", -4.135166556742356),+ ("<time-of-day> am|pm", -3.7297014486341915),+ ("nograin", -3.4420193761824103),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ -4.135166556742356),+ ("Christmas", -3.4420193761824103),+ ("hour", -2.8824035882469876),+ ("<datetime> - <datetime> (interval)", -2.7488721956224653),+ ("<time-of-day> - <time-of-day> (interval)",+ -2.430418464503931),+ ("<named-month> <day-of-month> (non ordinal)",+ -3.7297014486341915),+ ("minute", -1.6928195213731514),+ ("right now", -4.135166556742356),+ ("<month> dd-dd (interval)", -3.4420193761824103),+ ("dd-dd <month> (interval)", -3.7297014486341915)],+ n = 49}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> more <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)minute (grain)", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in|within|after <duration>",+ Classifier{okData =+ ClassData{prior = -4.652001563489282e-2,+ unseen = -4.61512051684126,+ likelihoods =+ HashMap.fromList+ [("week", -3.2188758248682006),+ ("<integer> more <unit-of-duration>", -3.912023005428146),+ ("three-quarters of an hour", -2.995732273553991),+ ("<integer> + '\"", -3.2188758248682006),+ ("number.number hours", -3.912023005428146),+ ("second", -3.506557897319982), ("day", -3.2188758248682006),+ ("half an hour", -2.995732273553991),+ ("<integer> <unit-of-duration>", -1.6094379124341003),+ ("a <unit-of-duration>", -2.995732273553991),+ ("quarter of an hour", -2.995732273553991),+ ("hour", -2.5257286443082556),+ ("about|exactly <duration>", -3.912023005428146),+ ("<integer> and an half hour", -3.912023005428146),+ ("minute", -1.2729656758128873)],+ n = 42},+ koData =+ ClassData{prior = -3.0910424533583156, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("quarter", -1.8971199848858813),+ ("<integer> <unit-of-duration>", -2.3025850929940455),+ ("a <unit-of-duration>", -2.3025850929940455)],+ n = 2}}),+ ("three-quarters of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half <integer> (UK style hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -0.8209805520698302,+ unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -0.579818495252942, unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -1.1786549963416462),+ ("ordinals (first..twentieth,thirtieth,...)quarter (grain)",+ -1.466337068793427),+ ("quarter", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.8109302162163288),+ ("quarter", -0.8109302162163288)],+ n = 3}}),+ ("one twenty two",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.4957877464014501, unseen = -6.293419278846481,+ likelihoods =+ HashMap.fromList+ [("<datetime> - <datetime> (interval)on <date>",+ -4.345658990503007),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -4.345658990503007),+ ("hourday", -3.8936738667599493),+ ("dayhour", -2.765208614942159),+ ("daymonth", -4.90527477843843),+ ("monthday", -5.19295685089021),+ ("monthyear", -3.9889840465642745),+ ("Tuesdaythe <day-of-month> (ordinal)", -5.598421958998375),+ ("Christmasyear", -5.598421958998375),+ ("from <datetime> - <datetime> (interval)July",+ -5.598421958998375),+ ("houryear", -5.598421958998375),+ ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.90527477843843),+ ("<time-of-day> am|pmintersect", -4.345658990503007),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -5.598421958998375),+ ("Marchyear", -5.598421958998375),+ ("<named-month>|<named-day> <day-of-month> (ordinal)year",+ -5.19295685089021),+ ("intersect<time-of-day> am|pm", -5.598421958998375),+ ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.598421958998375),+ ("monthhour", -5.19295685089021),+ ("last <day-of-week> of <time>year", -5.598421958998375),+ ("todayat <time-of-day>", -5.598421958998375),+ ("Thursday<time> timezone", -3.8936738667599493),+ ("this <time>hh(:mm) - <time-of-day> am|pm",+ -5.598421958998375),+ ("dayday", -3.58351893845611),+ ("Thanksgiving Dayyear", -4.499809670330265),+ ("<time> <part-of-day>at <time-of-day>", -5.598421958998375),+ ("Tuesdayin <named-month>", -5.598421958998375),+ ("mm/ddat <time-of-day>", -5.598421958998375),+ ("tonightat <time-of-day>", -5.598421958998375),+ ("<time-of-day> am|pmabsorption of , after named day",+ -4.90527477843843),+ ("today<time-of-day> am|pm", -5.598421958998375),+ ("Februarythe <day-of-month> (ordinal)", -5.19295685089021),+ ("at <time-of-day><time> <part-of-day>", -5.598421958998375),+ ("mm/dd<time-of-day> am|pm", -5.598421958998375),+ ("hourhour", -4.345658990503007),+ ("<time-of-day> am|pmon <date>", -3.58351893845611),+ ("Wednesdaythis|last|next <cycle>", -5.598421958998375),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -4.0943445622221),+ ("dayyear", -3.1560749236291703),+ ("last weekend of <named-month>year", -5.598421958998375),+ ("<time-of-day> o'clockin|during the <part-of-day>",+ -5.598421958998375),+ ("Thursdayat <time-of-day>", -5.19295685089021),+ ("<time-of-day> am|pmtomorrow", -4.90527477843843),+ ("minutehour", -4.68213122712422),+ ("Mother's Dayyear", -5.598421958998375),+ ("at <time-of-day>in|during the <part-of-day>",+ -5.19295685089021),+ ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",+ -3.8936738667599493),+ ("for <duration> from <time>December", -5.598421958998375),+ ("tomorrow<time-of-day> sharp|exactly", -5.598421958998375),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -5.19295685089021),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.68213122712422),+ ("Mondayin|during the <part-of-day>", -5.598421958998375),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.19295685089021),+ ("intersectin|during the <part-of-day>", -5.598421958998375),+ ("Thursday<datetime> - <datetime> (interval)",+ -4.68213122712422),+ ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",+ -5.598421958998375),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.345658990503007),+ ("from <time-of-day> - <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -4.68213122712422),+ ("at <time-of-day>intersect", -5.19295685089021),+ ("<time-of-day> - <time-of-day> (interval)tomorrow",+ -5.598421958998375),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.598421958998375),+ ("dayminute", -2.924273309571846),+ ("from <datetime> - <datetime> (interval)on <date>",+ -5.19295685089021),+ ("<datetime> - <datetime> (interval)tomorrow",+ -5.598421958998375),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.19295685089021),+ ("<ordinal> <cycle> of <time>year", -5.598421958998375),+ ("minuteday", -2.132686056198648),+ ("absorption of , after named dayintersect",+ -5.598421958998375),+ ("Octoberyear", -4.345658990503007),+ ("the <day-of-month> (ordinal)in|during the <part-of-day>",+ -5.598421958998375),+ ("at <time-of-day>absorption of , after named day",+ -5.598421958998375),+ ("<day-of-month> (ordinal or number) <named-month>year",+ -5.598421958998375),+ ("year<time-of-day> am|pm", -5.598421958998375),+ ("Septemberyear", -5.19295685089021),+ ("at <time-of-day>on <date>", -4.499809670330265),+ ("between <time-of-day> and <time-of-day> (interval)on <date>",+ -4.90527477843843),+ ("Halloweenyear", -5.598421958998375),+ ("dayweek", -5.598421958998375),+ ("Thursday<time-of-day> am|pm", -5.598421958998375),+ ("weekyear", -5.19295685089021),+ ("hh:mmin|during the <part-of-day>", -4.90527477843843),+ ("Father's Dayyear", -5.598421958998375),+ ("<cycle> after|before <time><time-of-day> am|pm",+ -5.19295685089021),+ ("February<time> <part-of-day>", -5.598421958998375),+ ("Martin Luther King's Dayyear", -5.19295685089021),+ ("tomorrowat <time-of-day>", -4.90527477843843),+ ("between <time> and <time>on <date>", -4.90527477843843),+ ("Thursdayfrom|since|after <time-of-day>", -4.90527477843843),+ ("at <time-of-day>tomorrow", -5.19295685089021),+ ("tomorrow<time-of-day> am|pm", -5.598421958998375),+ ("in|during the <part-of-day>at <time-of-day>",+ -5.598421958998375),+ ("Labor Dayyear", -5.598421958998375),+ ("Februaryintersect", -5.598421958998375),+ ("last <cycle> of <time>year", -4.90527477843843),+ ("<named-month> <day-of-month> (non ordinal)year",+ -5.598421958998375),+ ("yearminute", -5.598421958998375),+ ("Black Fridayyear", -5.19295685089021)],+ n = 201},+ koData =+ ClassData{prior = -0.9392802500988537, unseen = -5.983936280687191,+ likelihoods =+ HashMap.fromList+ [("in <named-month>year", -5.288267030694535),+ ("<time-of-day> - <time-of-day> (interval)on <date>",+ -5.288267030694535),+ ("hourday", -5.288267030694535),+ ("<named-month> <day-of-month> (non ordinal)July",+ -5.288267030694535),+ ("dayhour", -2.890371757896165),+ ("daymonth", -3.2088254890146994),+ ("monthday", -4.882801922586371),+ ("monthyear", -4.59511985013459),+ ("intersecthh:mm", -5.288267030694535),+ ("from <datetime> - <datetime> (interval)July",+ -5.288267030694535),+ ("houryear", -5.288267030694535),+ ("from <time-of-day> - <time-of-day> (interval)July",+ -5.288267030694535),+ ("until <time-of-day><time-of-day> am|pm", -5.288267030694535),+ ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.59511985013459),+ ("<time-of-day> am|pmintersect", -4.035504062199167),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.37197629882038),+ ("from|since|after <time-of-day>on <date>", -4.37197629882038),+ ("July<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("absorption of , after named dayJuly", -4.882801922586371),+ ("monthhour", -5.288267030694535),+ ("hourmonth", -4.59511985013459),+ ("todayat <time-of-day>", -5.288267030694535),+ ("from|since|after <time-of-day>July", -5.288267030694535),+ ("dayday", -4.882801922586371),+ ("mm/ddat <time-of-day>", -4.882801922586371),+ ("<time-of-day> am|pmon <date>", -4.035504062199167),+ ("dayyear", -4.035504062199167),+ ("Thursdaymm/dd", -5.288267030694535),+ ("Thursdayat <time-of-day>", -4.035504062199167),+ ("<integer> to|till|before <hour-of-day>September",+ -5.288267030694535),+ ("monthminute", -5.288267030694535),+ ("<time-of-day> am|pmtomorrow", -5.288267030694535),+ ("Thursdayhh:mm", -4.37197629882038),+ ("August<day-of-month> (ordinal or number) <named-month>",+ -5.288267030694535),+ ("Fridayyear", -4.882801922586371),+ ("minutemonth", -3.4965075614664802),+ ("Sundayfrom|since|after <time-of-day>", -5.288267030694535),+ ("Thursdayfrom <datetime> - <datetime> (interval)",+ -4.882801922586371),+ ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("Aprilyear", -5.288267030694535),+ ("mm/dd<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",+ -5.288267030694535),+ ("<duration> after|before|from <time>December",+ -5.288267030694535),+ ("yesterday<time-of-day> am|pm", -5.288267030694535),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -4.37197629882038),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -4.882801922586371),+ ("<named-month> <day-of-month> (non ordinal)August",+ -5.288267030694535),+ ("until <time-of-day>on <date>", -4.59511985013459),+ ("at <time-of-day>intersect", -4.882801922586371),+ ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("dayminute", -2.7625383863862796),+ ("intersectSeptember", -3.784189633918261),+ ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",+ -5.288267030694535),+ ("minuteday", -2.3704962986102562),+ ("absorption of , after named dayintersect",+ -5.288267030694535),+ ("Februaryin|during the <part-of-day>", -5.288267030694535),+ ("week-endin <named-month>", -5.288267030694535),+ ("Octoberyear", -5.288267030694535),+ ("from|since|after <time-of-day>year", -5.288267030694535),+ ("yearhh:mm", -5.288267030694535),+ ("hh:mmon <date>", -3.784189633918261),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -5.288267030694535),+ ("absorption of , after named daySeptember", -4.37197629882038),+ ("on <date>September", -4.882801922586371),+ ("at <time-of-day>on <date>", -4.882801922586371),+ ("dayweek", -5.288267030694535),+ ("Thursday<time-of-day> am|pm", -4.882801922586371),+ ("absorption of , after named dayFebruary", -4.37197629882038),+ ("July<integer> to|till|before <hour-of-day>",+ -5.288267030694535),+ ("tomorrowat <time-of-day>", -5.288267030694535),+ ("<integer> to|till|before <hour-of-day>July",+ -5.288267030694535),+ ("Thursdayfrom|since|after <time-of-day>", -3.6788291182604347),+ ("tomorrow<time-of-day> am|pm", -5.288267030694535),+ ("Tuesdayfrom|since|after <time-of-day>", -5.288267030694535),+ ("yearminute", -5.288267030694535)],+ n = 129}}),+ ("one eleven",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("after lunch/work/school",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("early morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <number> (implicit minutes)",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.3184537311185346),+ ("integer (0..19)", -1.2992829841302609)],+ n = 9},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.16251892949777494),+ ("integer (0..19)", -1.8971199848858813)],+ n = 18}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("daymonth", -2.0149030205422647),+ ("quarteryear", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)day (grain)October",+ -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)intersect",+ -2.0149030205422647),+ ("weekmonth", -1.6094379124341003),+ ("ordinal (digits)quarter (grain)year", -2.0149030205422647),+ ("ordinals (first..twentieth,thirtieth,...)week (grain)October",+ -2.0149030205422647)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods = HashMap.fromList [("", 0.0)], n = 21},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -1.0116009116784799,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -2.001480000210124),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("hh:mmhh:mm", -2.001480000210124),+ ("dayday", -2.512305623976115),+ ("<named-month>|<named-day> <day-of-month> (ordinal)<day-of-month> (ordinal)",+ -2.917770732084279),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.917770732084279),+ ("hourhour", -2.512305623976115),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.917770732084279)],+ n = 8},+ koData =+ ClassData{prior = -0.45198512374305727,+ unseen = -3.912023005428146,+ likelihoods =+ HashMap.fromList+ [("hourday", -3.1986731175506815),+ ("dayhour", -2.793208009442517),+ ("<day-of-month> (ordinal)time-of-day (latent)",+ -3.1986731175506815),+ ("hh:mmtime-of-day (latent)", -2.2823823856765264),+ ("minuteminute", -2.793208009442517),+ ("time-of-day (latent)time-of-day (latent)",+ -2.793208009442517),+ ("dayday", -3.1986731175506815),+ ("hourhour", -2.505525936990736),+ ("dayyear", -3.1986731175506815),+ ("<named-month>|<named-day> <day-of-month> (ordinal)past year (latent)",+ -3.1986731175506815),+ ("minutehour", -2.2823823856765264),+ ("hh:mmintersect", -2.793208009442517),+ ("<day-of-month> (ordinal)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("time-of-day (latent)<time-of-day> am|pm",+ -3.1986731175506815),+ ("time-of-day (latent)<day-of-month> (ordinal or number) <named-month>",+ -3.1986731175506815),+ ("<named-month> <day-of-month> (non ordinal)time-of-day (latent)",+ -3.1986731175506815)],+ n = 14}}),+ ("Saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",+ -1.7346010553881064),+ ("weekmonth", -1.7346010553881064),+ ("week (grain)October", -1.7346010553881064),+ ("week (grain)<named-month> <day-of-month> (non ordinal)",+ -1.7346010553881064),+ ("weekday", -1.2237754316221157)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number.number hours",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.6094379124341003),+ ("hh:mmhh:mm", -1.6094379124341003),+ ("<time-of-day> am|pmtime-of-day (latent)", -2.70805020110221),+ ("hourhour", -2.3025850929940455),+ ("hourminute", -2.3025850929940455),+ ("time-of-day (latent)<time-of-day> sharp|exactly",+ -2.70805020110221),+ ("time-of-day (latent)hh:mm", -2.70805020110221),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.70805020110221)],+ n = 9},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.6094379124341003),+ ("time-of-day (latent)time-of-day (latent)",+ -2.0149030205422647),+ ("hourhour", -1.791759469228055),+ ("minutehour", -1.6094379124341003),+ ("time-of-day (latent)<time-of-day> am|pm", -2.70805020110221)],+ n = 9}}),+ ("integer 21..99",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)", -0.6931471805599453),+ ("integer (20..90)integer (0..19)", -0.6931471805599453)],+ n = 4}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("mm/dd/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -1.6094379124341003,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("Monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm:ss",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>integer (20..90)", -1.3862943611198906),+ ("hour", -0.9808292530117262),+ ("at <time-of-day>integer (numeric)", -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>integer (numeric)",+ -1.0986122886681098),+ ("hour", -1.0986122886681098)],+ n = 1}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.9808292530117262),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -2.0794415416798357),+ ("ordinals (first..twentieth,thirtieth,...)Wednesdayintersect",+ -1.6739764335716716),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayOctober",+ -1.6739764335716716)],+ n = 5},+ koData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0986122886681098),+ ("ordinals (first..twentieth,thirtieth,...)TuesdaySeptember",+ -1.791759469228055),+ ("ordinals (first..twentieth,thirtieth,...)WednesdayOctober",+ -1.3862943611198906)],+ n = 3}}),+ ("Valentine's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("end of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = -8.004270767353637e-2,+ unseen = -3.6375861597263857,+ likelihoods = HashMap.fromList [("", 0.0)], n = 36},+ koData =+ ClassData{prior = -2.5649493574615367,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("part of daysintersect by \",\", \"of\", \"from\", \"'s\"",+ -1.6094379124341003),+ ("hourday", -0.916290731874155),+ ("part of daysthe <day-of-month> (ordinal)",+ -1.6094379124341003),+ ("part of daysthe <day-of-month> (number)",+ -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("past year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 2}}),+ ("six thirty six a.m.",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -1.252762968495368),+ ("one twenty two", -0.8472978603872037),+ ("one eleven", -1.252762968495368)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.9459101490553135,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<day-of-month> (ordinal or number) of <named-month>",+ Classifier{okData =+ ClassData{prior = -0.13353139262452263,+ unseen = -3.0910424533583156,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -2.3513752571634776),+ ("ordinals (first..twentieth,thirtieth,...)March",+ -2.3513752571634776),+ ("ordinal (digits)February", -2.3513752571634776),+ ("integer (numeric)February", -1.9459101490553135),+ ("month", -0.9650808960435872),+ ("ordinal (digits)March", -2.3513752571634776),+ ("integer (numeric)July", -2.3513752571634776)],+ n = 7},+ koData =+ ClassData{prior = -2.0794415416798357,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)February", -1.5040773967762742),+ ("month", -1.5040773967762742)],+ n = 1}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("hour", -0.6931471805599453),+ ("part of days", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Friday",+ Classifier{okData =+ ClassData{prior = -0.3677247801253174,+ unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -1.1786549963416462, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("in|during the <part-of-day>",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("early morning", -2.5257286443082556),+ ("hour", -0.7339691750802004),+ ("part of days", -0.8209805520698302)],+ n = 11},+ koData =+ ClassData{prior = -2.4849066497880004, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("hour", -0.916290731874155),+ ("part of days", -0.916290731874155)],+ n = 1}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh(:mm) - <time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this|last|next <cycle>",+ Classifier{okData =+ ClassData{prior = -0.15822400521489416,+ unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("week", -1.5488132906176655),+ ("month (grain)", -2.995732273553991),+ ("year (grain)", -1.817077277212345),+ ("week (grain)", -1.5488132906176655),+ ("quarter", -2.772588722239781), ("year", -1.817077277212345),+ ("month", -2.995732273553991),+ ("quarter (grain)", -2.772588722239781)],+ n = 35},+ koData =+ ClassData{prior = -1.9218125974762528,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("week", -1.4816045409242156),+ ("week (grain)", -1.4816045409242156),+ ("day", -1.9924301646902063),+ ("day (grain)", -1.9924301646902063)],+ n = 6}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("noon|midnight|EOD|end of day", -2.1972245773362196),+ ("end of month", -2.1972245773362196),+ ("time-of-day (latent)", -2.1972245773362196),+ ("<time-of-day> am|pm", -2.1972245773362196),+ ("hh:mm", -2.1972245773362196), ("hour", -1.791759469228055),+ ("month", -2.1972245773362196), ("minute", -1.791759469228055)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2006706954621511,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..twentieth,thirtieth,...)",+ -1.7047480922384253),+ ("ordinal (digits)", -0.2006706954621511)],+ n = 9},+ koData =+ ClassData{prior = -1.7047480922384253,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList [("ordinal (digits)", -0.2876820724517809)],+ n = 2}}),+ ("last weekend of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("October", -0.9555114450274363), ("July", -1.8718021769015913),+ ("month", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <day-of-month> (number)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17}}),+ ("Sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.6931471805599453),+ ("quarter", -0.6931471805599453)],+ n = 1}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.5315058290035293,+ unseen = -4.2626798770413155,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.12136085700426748),+ ("integer (0..19)", -2.3025850929940455)],+ n = 67},+ koData =+ ClassData{prior = -0.8860508466844369,+ unseen = -3.9318256327243257,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.10536051565782628),+ ("integer (0..19)", -2.8134107167600364),+ ("integer 21..99", -3.2188758248682006)],+ n = 47}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.23483959107740107, unseen = -3.58351893845611,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 34},+ koData =+ ClassData{prior = -1.563975538357343, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 9}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("SundayMarch", -1.6094379124341003),+ ("MondayMarch", -1.6094379124341003),+ ("Sundayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.1479201300766222,+ unseen = -5.0875963352323845,+ likelihoods =+ HashMap.fromList+ [("week", -2.4423470353692043),+ ("integer (0..19)year (grain)", -3.289644895756408),+ ("integer (numeric)day (grain)", -2.6835090921860925),+ ("integer (0..19)second (grain) ", -3.6951100038645723),+ ("integer (0..19)hour (grain)", -3.001962823304627),+ ("second", -3.289644895756408),+ ("integer (numeric)second (grain) ", -3.982792076316353),+ ("integer (numeric)year (grain)", -3.6951100038645723),+ ("day", -2.4423470353692043), ("year", -2.8841797876482436),+ ("integer (numeric)week (grain)", -3.001962823304627),+ ("integer (0..19)month (grain)", -3.4719664525503626),+ ("hour", -2.5964977151964628), ("month", -3.1354942159291497),+ ("integer (numeric)minute (grain)", -3.1354942159291497),+ ("integer (0..19)minute (grain)", -3.001962823304627),+ ("integer (numeric)month (grain)", -3.982792076316353),+ ("minute", -2.4423470353692043),+ ("integer (numeric)hour (grain)", -3.4719664525503626),+ ("integer (0..19)day (grain)", -3.6951100038645723),+ ("integer (0..19)week (grain)", -3.1354942159291497)],+ n = 69},+ koData =+ ClassData{prior = -1.984131361875511, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("quarter", -3.1135153092103742), ("hour", -1.4087672169719492),+ ("integer (numeric)hour (grain)", -1.4087672169719492),+ ("integer (0..19)quarter (grain)", -3.1135153092103742)],+ n = 11}}),+ ("hhmm (latent)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = -0.2929871246814741,+ unseen = -5.3230099791384085,+ likelihoods =+ HashMap.fromList+ [("integer after|past <hour-of-day>", -3.9318256327243257),+ ("at <time-of-day>", -2.2270775404859005),+ ("from|since|after <time-of-day>", -3.708682081410116),+ ("<time-of-day> o'clock", -4.219507705176107),+ ("half after|past <hour-of-day>", -4.219507705176107),+ ("time-of-day (latent)", -1.7346010553881064),+ ("hhmm (latent)", -4.624972813284271),+ ("hh:mm", -2.2735975561207935),+ ("quarter after|past <hour-of-day>", -4.624972813284271),+ ("about|exactly <time-of-day>", -4.624972813284271),+ ("until <time-of-day>", -3.9318256327243257),+ ("hour", -1.2237754316221157),+ ("<time-of-day> sharp|exactly", -4.624972813284271),+ ("minute", -1.7346010553881064)],+ n = 94},+ koData =+ ClassData{prior = -1.3705460041517514, unseen = -4.394449154672439,+ likelihoods =+ HashMap.fromList+ [("<integer> to|till|before <hour-of-day>", -3.283414346005772),+ ("from|since|after <time-of-day>", -3.283414346005772),+ ("<hour-of-day> <integer>", -3.6888794541139363),+ ("time-of-day (latent)", -1.0498221244986778),+ ("hour", -1.0147308046874075), ("minute", -2.772588722239781)],+ n = 32}}),+ ("from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)ordinal (digits)July", -1.252762968495368),+ ("integer (numeric)integer (numeric)July", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Thanksgiving Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("March", -0.6931471805599453), ("month", -0.6931471805599453)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("a <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -0.5753641449035618,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("week", -2.0794415416798357),+ ("year (grain)", -2.772588722239781),+ ("second", -2.772588722239781),+ ("week (grain)", -2.0794415416798357),+ ("day", -2.0794415416798357),+ ("minute (grain)", -2.772588722239781),+ ("year", -2.772588722239781),+ ("second (grain) ", -2.772588722239781),+ ("minute", -2.772588722239781),+ ("day (grain)", -2.0794415416798357)],+ n = 9},+ koData =+ ClassData{prior = -0.8266785731844679, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("hour (grain)", -1.7227665977411035),+ ("quarter", -1.9459101490553135), ("hour", -1.7227665977411035),+ ("quarter (grain)", -1.9459101490553135)],+ n = 7}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = -6.782259633876106e-2,+ unseen = -4.07753744390572,+ likelihoods = HashMap.fromList [("", 0.0)], n = 57},+ koData =+ ClassData{prior = -2.7245795030534206, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinals (first..twentieth,thirtieth,...)",+ Classifier{okData =+ ClassData{prior = -6.899287148695143e-2,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14},+ koData =+ ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("quarter after|past <hour-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("the <cycle> after|before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("day (grain)tomorrow", -1.252762968495368),+ ("dayday", -0.8472978603872037),+ ("day (grain)yesterday", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("week", -2.639057329615259),+ ("hh(:mm) - <time-of-day> am|pm", -2.639057329615259),+ ("this|last|next <cycle>", -2.639057329615259),+ ("day", -2.2335922215070942),+ ("time-of-day (latent)", -2.639057329615259),+ ("hhmm (latent)", -2.2335922215070942),+ ("<time-of-day> am|pm", -2.639057329615259),+ ("hour", -1.9459101490553135),+ ("next <time>", -2.639057329615259),+ ("this|next <day-of-week>", -2.639057329615259),+ ("minute", -2.2335922215070942)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.833213344056216,+ likelihoods =+ HashMap.fromList+ [("mm/dd", -2.0794415416798357), ("day", -2.0794415416798357),+ ("time-of-day (latent)", -2.0794415416798357),+ ("hour", -2.0794415416798357)],+ n = 2}}),+ ("intersect by \",\", \"of\", \"from\", \"'s\"",+ Classifier{okData =+ ClassData{prior = -0.48130318449966897,+ unseen = -5.170483995038151,+ likelihoods =+ HashMap.fromList+ [("Wednesday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayhour", -3.2188758248682006),+ ("daymonth", -3.2188758248682006),+ ("<named-month> <day-of-month> (non ordinal)Friday",+ -4.471638793363569),+ ("Friday<named-month> <day-of-month> (non ordinal)",+ -3.7784916128036232),+ ("Wednesdayintersect", -4.471638793363569),+ ("Labor Daythis|last|next <cycle>", -4.471638793363569),+ ("Black Fridaythis|last|next <cycle>", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"year",+ -4.471638793363569),+ ("<part-of-day> of <time>February", -4.471638793363569),+ ("Saturday<time-of-day> am|pm", -4.471638793363569),+ ("Martin Luther King's Daythis|last|next <cycle>",+ -4.471638793363569),+ ("on <date><time-of-day> am|pm", -4.471638793363569),+ ("hourmonth", -4.471638793363569),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.471638793363569),+ ("dayday", -2.5998366164619773),+ ("the <day-of-month> (ordinal)February", -4.0661736852554045),+ ("WednesdayOctober", -4.471638793363569),+ ("Wednesdaythis|last|next <cycle>", -4.0661736852554045),+ ("intersect<named-month> <day-of-month> (non ordinal)",+ -3.5553480614894135),+ ("dayyear", -2.8622008809294686),+ ("Saturday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.471638793363569),+ ("Thursdayhh:mm", -4.0661736852554045),+ ("Thanksgiving Daythis|last|next <cycle>", -4.471638793363569),+ ("Memorial Daythis|last|next <cycle>", -4.471638793363569),+ ("on <date><named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("TuesdayOctober", -4.471638793363569),+ ("the <day-of-month> (ordinal)March", -4.471638793363569),+ ("Mondaythis|last|next <cycle>", -4.471638793363569),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.0661736852554045),+ ("Fridayintersect", -4.471638793363569),+ ("Thursday<datetime> - <datetime> (interval)",+ -3.7784916128036232),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.5553480614894135),+ ("Tuesdaythis|last|next <cycle>", -4.471638793363569),+ ("Sunday<named-month> <day-of-month> (non ordinal)",+ -4.471638793363569),+ ("dayminute", -2.6798793241355137),+ ("intersectyear", -4.471638793363569),+ ("minuteday", -3.5553480614894135),+ ("this|last|next <cycle>Sunday", -4.471638793363569),+ ("Sundaythis|last|next <cycle>", -4.471638793363569),+ ("intersectintersect", -4.471638793363569),+ ("weekday", -4.471638793363569),+ ("dayweek", -3.373026504695459),+ ("Thursday<time-of-day> am|pm", -4.471638793363569),+ ("Monday<named-month> <day-of-month> (non ordinal)",+ -4.0661736852554045),+ ("<named-month> <day-of-month> (non ordinal)year",+ -4.0661736852554045)],+ n = 55},+ koData =+ ClassData{prior = -0.9622758451159785, unseen = -4.897839799950911,+ likelihoods =+ HashMap.fromList+ [("week-endJuly", -4.197201947661808),+ ("week-endOctober", -3.5040547671018634),+ ("daymonth", -1.9999773703255892),+ ("TuesdaySeptember", -4.197201947661808),+ ("Wednesdayintersect", -4.197201947661808),+ ("hourmonth", -3.0985896589936988),+ ("intersect by \",\", \"of\", \"from\", \"'s\"intersect",+ -4.197201947661808),+ ("Fridaythis|last|next <cycle>", -4.197201947661808),+ ("SundayFebruary", -4.197201947661808),+ ("WednesdayOctober", -4.197201947661808),+ ("week-endintersect", -4.197201947661808),+ ("dayyear", -4.197201947661808),+ ("FridayJuly", -3.791736839553644),+ ("<named-month> <day-of-month> (non ordinal)intersect",+ -4.197201947661808),+ ("FridaySeptember", -4.197201947661808),+ ("WednesdayFebruary", -4.197201947661808),+ ("minutemonth", -3.2809112157876537),+ ("SundayMarch", -4.197201947661808),+ ("Fridayintersect by \",\", \"of\", \"from\", \"'s\"",+ -4.197201947661808),+ ("MondayFebruary", -3.791736839553644),+ ("Fridayintersect", -4.197201947661808),+ ("Thursday<time-of-day> - <time-of-day> (interval)",+ -3.791736839553644),+ ("dayminute", -2.810907586541918),+ ("SaturdaySeptember", -4.197201947661808),+ ("intersectSeptember", -3.2809112157876537),+ ("MondayMarch", -4.197201947661808),+ ("on <date>September", -3.791736839553644),+ ("intersectintersect", -4.197201947661808),+ ("Tuesdayintersect", -4.197201947661808),+ ("Sundayintersect", -4.197201947661808)],+ n = 34}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = -0.6286086594223742, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("Father's Day", -2.6026896854443837),+ ("Martin Luther King's Day", -2.6026896854443837),+ ("Memorial Day", -2.6026896854443837),+ ("Mother's Day", -2.6026896854443837),+ ("day", -1.2163953243244932), ("Sunday", -2.6026896854443837),+ ("Thanksgiving Day", -2.6026896854443837),+ ("hour", -2.6026896854443837), ("Tuesday", -2.6026896854443837),+ ("week-end", -2.6026896854443837)],+ n = 8},+ koData =+ ClassData{prior = -0.7621400520468967, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Monday", -2.5257286443082556), ("day", -2.120263536200091),+ ("Sunday", -2.5257286443082556), ("hour", -1.4271163556401458),+ ("week-end", -1.4271163556401458)],+ n = 7}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<named-month>|<named-day> <day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -0.2231435513142097, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Octoberordinal (digits)", -2.120263536200091),+ ("Thursdayordinal (digits)", -2.5257286443082556),+ ("day", -2.120263536200091),+ ("Augustordinal (digits)", -2.5257286443082556),+ ("Marchordinals (first..twentieth,thirtieth,...)",+ -2.120263536200091),+ ("Tuesdayordinal (digits)", -2.5257286443082556),+ ("month", -1.2729656758128873),+ ("Marchordinal (digits)", -2.5257286443082556)],+ n = 8},+ koData =+ ClassData{prior = -1.6094379124341003, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("from|since|after <time-of-day>ordinal (digits)",+ -1.8718021769015913),+ ("Augustordinal (digits)", -1.8718021769015913),+ ("month", -1.466337068793427)],+ n = 2}}),+ ("Labor Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("ordinal (digits)", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.9808292530117262, unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -2.3025850929940455),+ ("<time-of-day> am|pm", -1.6094379124341003),+ ("hh:mm", -1.8971199848858813), ("hour", -1.8971199848858813),+ ("minute", -1.3862943611198906)],+ n = 6},+ koData =+ ClassData{prior = -0.4700036292457356, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.7227665977411035),+ ("yesterday", -2.2335922215070942),+ ("day", -2.2335922215070942), ("hh:mm", -1.7227665977411035),+ ("hour", -2.639057329615259), ("minute", -1.252762968495368)],+ n = 10}}),+ ("mm.dd.yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after|before|from <time>",+ Classifier{okData =+ ClassData{prior = -0.35667494393873245,+ unseen = -3.4339872044851463,+ likelihoods =+ HashMap.fromList+ [("a <unit-of-duration>now", -2.70805020110221),+ ("a <unit-of-duration>Christmas", -2.70805020110221),+ ("<integer> <unit-of-duration>today", -2.70805020110221),+ ("daysecond", -2.70805020110221),+ ("a <unit-of-duration>right now", -2.70805020110221),+ ("minutenograin", -2.70805020110221),+ ("<integer> <unit-of-duration>Christmas", -2.70805020110221),+ ("secondnograin", -2.70805020110221),+ ("yearday", -2.0149030205422647),+ ("daynograin", -2.70805020110221),+ ("<integer> <unit-of-duration>now", -2.3025850929940455)],+ n = 7},+ koData =+ ClassData{prior = -1.2039728043259361,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -2.3978952727983707),+ ("dayday", -1.9924301646902063),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -2.3978952727983707),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -2.3978952727983707)],+ n = 3}}),+ ("Independence Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5263605246161616,+ likelihoods =+ HashMap.fromList+ [("Martin Luther King's Day", -2.803360380906535),+ ("Halloween", -2.803360380906535),+ ("Wednesday", -2.803360380906535),+ ("Memorial Day", -2.803360380906535),+ ("Monday", -2.803360380906535),+ ("Mother's Day", -2.803360380906535),+ ("day", -1.0986122886681098),+ ("Thanksgiving Day", -2.803360380906535),+ ("March", -2.803360380906535), ("month", -2.803360380906535),+ ("Tuesday", -2.1102132003465894)],+ n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> sharp|exactly",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.1400661634962708),+ ("time-of-day (latent)", -2.1400661634962708),+ ("hhmm (latent)", -2.1400661634962708),+ ("<time-of-day> am|pm", -2.1400661634962708),+ ("hh:mm", -2.1400661634962708), ("hour", -1.7346010553881064),+ ("minute", -1.4469189829363254)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -7.696104113612832e-2),+ ("integer (0..19)", -2.6026896854443837)],+ n = 25}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("half an hour", -0.6931471805599453),+ ("minute", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> before last|after next",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("Wednesday", -1.8718021769015913),+ ("Friday", -1.466337068793427), ("day", -1.1786549963416462),+ ("March", -1.8718021769015913), ("month", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("this|last|next <cycle>", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hhmm (military) am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.3794896217049037, unseen = -4.304065093204169,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -3.1918471524802814),+ ("intersect<time-of-day> am|pm", -3.1918471524802814),+ ("minuteminute", -1.457246097092175),+ ("hh:mmhh:mm", -2.093234863812172),+ ("dayday", -3.1918471524802814),+ ("hourhour", -2.093234863812172),+ ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",+ -3.1918471524802814),+ ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",+ -3.597312260588446),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.597312260588446),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.681021528714291),+ ("from|since|after <time-of-day>hh:mm", -2.681021528714291)],+ n = 26},+ koData =+ ClassData{prior = -1.1526795099383855, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -3.1135153092103742),+ ("daymonth", -2.70805020110221),+ ("from|since|after <time-of-day>intersect", -2.70805020110221),+ ("<time-of-day> am|pmintersect", -3.1135153092103742),+ ("hh:mm<time-of-day> am|pm", -2.70805020110221),+ ("minuteminute", -1.8607523407150064),+ ("hourhour", -2.70805020110221),+ ("minutehour", -2.70805020110221),+ ("hh:mmintersect", -2.1972245773362196),+ ("<named-month> <day-of-month> (non ordinal)August",+ -3.1135153092103742),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.1135153092103742)],+ n = 12}}),+ ("Tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("New Year's Day",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("fortnight",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Memorial Day weekend",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> and an half hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("in <named-month>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -1.252762968495368), ("March", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("October", -0.8472978603872037),+ ("month", -0.8472978603872037)],+ n = 2}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.7375989431307791, unseen = -4.110873864173311,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.529395204760564),+ ("hh:mmhh:mm", -1.8971199848858813),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -2.4849066497880004),+ ("hourhour", -1.6964492894237302),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -3.4011973816621555),+ ("from|since|after <time-of-day><time-of-day> am|pm",+ -3.4011973816621555),+ ("<time-of-day> am|pm<time-of-day> am|pm", -2.4849066497880004),+ ("from|since|after <time-of-day>hh:mm", -2.4849066497880004)],+ n = 22},+ koData =+ ClassData{prior = -0.6505875661411494, unseen = -4.174387269895637,+ likelihoods =+ HashMap.fromList+ [("about|exactly <time-of-day>time-of-day (latent)",+ -3.4657359027997265),+ ("hh:mmtime-of-day (latent)", -1.7609878105613013),+ ("hh:mm<time-of-day> am|pm", -3.0602707946915624),+ ("<time-of-day> am|pmtime-of-day (latent)",+ -3.4657359027997265),+ ("at <time-of-day><time-of-day> am|pm", -3.4657359027997265),+ ("hourhour", -2.2129729343043585),+ ("minutehour", -1.2144441041932315),+ ("about|exactly <time-of-day><time-of-day> am|pm",+ -3.4657359027997265),+ ("from|since|after <time-of-day>time-of-day (latent)",+ -2.5494451709255714),+ ("at <time-of-day>time-of-day (latent)", -3.0602707946915624),+ ("<integer> to|till|before <hour-of-day>time-of-day (latent)",+ -3.0602707946915624)],+ n = 24}}),+ ("military spelled out numbers am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods =+ HashMap.fromList [("integer (0..19)integer (20..90)", 0.0)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)Tuesdayintersect",+ -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..twentieth,thirtieth,...)TuesdayChristmas",+ -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = -0.42121346507630353,+ unseen = -3.951243718581427,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.5455312716044354),+ ("Marchinteger (numeric)", -2.833213344056216),+ ("Aprilinteger (numeric)", -3.2386784521643803),+ ("month", -0.8407831793660099),+ ("Februaryinteger (numeric)", -1.9859154836690123),+ ("Septemberinteger (numeric)", -2.833213344056216),+ ("Octoberinteger (numeric)", -2.833213344056216),+ ("Julyinteger (numeric)", -2.1400661634962708)],+ n = 21},+ koData =+ ClassData{prior = -1.067840630001356, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -2.3353749158170367),+ ("Marchinteger (numeric)", -2.740840023925201),+ ("Aprilinteger (numeric)", -2.740840023925201),+ ("month", -0.9490805546971459),+ ("from|since|after <time-of-day>integer (numeric)",+ -2.3353749158170367),+ ("Julyinteger (numeric)", -1.6422277352570913)],+ n = 11}}),+ ("this|next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.2512917986064953),+ ("Wednesday", -2.2512917986064953),+ ("Monday", -1.845826690498331), ("day", -0.8649974374866046),+ ("Tuesday", -1.55814461804655)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.5553480614894135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 33},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.791759469228055),+ ("daymonth", -1.2809338454620642),+ ("day (grain)intersect", -1.791759469228055),+ ("weekmonth", -1.791759469228055),+ ("week (grain)intersect", -2.1972245773362196),+ ("week (grain)September", -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)April", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Black Friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Labor Day",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = -1.5040773967762742,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -0.25131442828090605,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("right now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("for <duration> from <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration><day-of-month> (ordinal)",+ -1.5040773967762742),+ ("dayday", -1.0986122886681098),+ ("<integer> <unit-of-duration><day-of-month> (ordinal or number) <named-month>",+ -1.5040773967762742)],+ n = 2},+ koData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("dayhour", -1.252762968495368),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -1.252762968495368)],+ n = 1}}),+ ("between <time> and <time>",+ Classifier{okData =+ ClassData{prior = -1.0986122886681098,+ unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0116009116784799),+ ("hh:mmhh:mm", -1.0116009116784799)],+ n = 3},+ koData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.4469189829363254),+ ("minuteminute", -1.4469189829363254),+ ("minutehour", -1.4469189829363254),+ ("hh:mmintersect", -1.4469189829363254)],+ n = 6}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.4657359027997265,+ likelihoods =+ HashMap.fromList+ [("Julyinteger (numeric)integer (numeric)", -1.6422277352570913),+ ("from|since|after <time-of-day>ordinal (digits)ordinal (digits)",+ -2.740840023925201),+ ("from|since|after <time-of-day>integer (numeric)integer (numeric)",+ -2.740840023925201),+ ("from|since|after <time-of-day>ordinal (digits)integer (numeric)",+ -2.740840023925201),+ ("Augustordinal (digits)integer (numeric)",+ -2.3353749158170367),+ ("month", -0.8690378470236094),+ ("Augustordinal (digits)ordinal (digits)",+ -2.3353749158170367)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("part of days",+ Classifier{okData =+ ClassData{prior = -4.0821994520255166e-2,+ unseen = -3.258096538021482,+ likelihoods = HashMap.fromList [("", 0.0)], n = 24},+ koData =+ ClassData{prior = -3.2188758248682006,+ unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd-dd <month> (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)integer (numeric)September",+ -1.791759469228055),+ ("ordinal (digits)ordinal (digits)July", -2.1972245773362196),+ ("ordinal (digits)ordinal (digits)October",+ -2.1972245773362196),+ ("integer (numeric)integer (numeric)July", -2.1972245773362196),+ ("month", -0.9444616088408514),+ ("ordinal (digits)ordinal (digits)August",+ -2.1972245773362196)],+ n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("Thursday", -2.5257286443082556),+ ("Martin Luther King's Day", -2.5257286443082556),+ ("Monday", -2.5257286443082556), ("day", -1.1394342831883648),+ ("Thanksgiving Day", -2.5257286443082556),+ ("hour", -2.5257286443082556), ("winter", -2.5257286443082556),+ ("week-end", -2.5257286443082556),+ ("summer", -2.120263536200091)],+ n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [], n = 0}}), ("August", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357,
Duckling/Ranking/Classifiers/ES_XX.hs view
@@ -719,6 +719,13 @@ koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}), ("afternoon", Classifier{okData = ClassData{prior = -0.3364722366212129,
Duckling/Ranking/Classifiers/FR_XX.hs view
@@ -102,16 +102,26 @@ n = 2}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.0794415416798357,+ ClassData{prior = -1.6094379124341003,+ unseen = -2.3978952727983707, likelihoods = HashMap.fromList- [("\224|vers <time-of-day>", -1.252762968495368),- ("hour", -0.8472978603872037),- ("<time-of-day> heures", -1.252762968495368)],+ [("\224|vers <time-of-day>", -1.6094379124341003),+ ("hour", -1.2039728043259361),+ ("<time-of-day> heures", -1.6094379124341003)], n = 2}, koData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0}}),+ ClassData{prior = -0.2231435513142097,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("\224|vers <time-of-day>", -1.7047480922384253),+ ("<hour-of-day> et quart", -1.9924301646902063),+ ("hour", -1.9924301646902063),+ ("<hour-of-day> et demi", -1.9924301646902063),+ ("minute", -1.1451323043030026),+ ("<time-of-day> heures", -2.3978952727983707)],+ n = 8}}), ("n <cycle> apr\232s", Classifier{okData = ClassData{prior = 0.0, unseen = -1.9459101490553135,@@ -603,349 +613,351 @@ n = 2}}), ("intersect", Classifier{okData =- ClassData{prior = -0.2260379093405742,- unseen = -6.9726062513017535,+ ClassData{prior = -0.2318016140573243, unseen = -6.974478911025045, likelihoods = HashMap.fromList [("<day-of-month> <named-month><dim time> <part-of-day>",- -6.278521424165844),- ("intersect<dim time> du matin", -6.278521424165844),+ -6.280395838960195),+ ("intersect<dim time> du matin", -6.280395838960195), ("<hour-of-day> <integer> (as relative minutes)intersect",- -5.8730563160576805),+ -5.87493073085203), ("<day-of-month> <named-month>d\233but de journ\233e",- -6.278521424165844),- ("hourday", -4.027229625559349),- ("<day-of-month> <named-month>year", -5.585374243605899),- ("dayhour", -1.915422799377482),+ -6.280395838960195),+ ("hourday", -4.0291040403537),+ ("<day-of-month> <named-month>year", -5.58724865840025),+ ("dayhour", -1.917297214171832), ("<datetime> - <datetime> (interval)Juillet",- -5.025758455670476),- ("daymonth", -2.8607947405524787),- ("monthyear", -4.7744440273895705),+ -5.027632870464827),+ ("daymonth", -2.862669155346829),+ ("monthyear", -4.77631844218392), ("<day-of-month> <named-month>d\233but de matin\233e",- -6.278521424165844),- ("dernier <cycle> de <time> (latent)year", -5.362230692291689),- ("aujourd'huimilieu d'apr\232s-midi", -6.278521424165844),+ -6.280395838960195),+ ("dernier <cycle> de <time> (latent)year", -5.36410510708604),+ ("aujourd'huimilieu d'apr\232s-midi", -6.280395838960195), ("<day-of-month> <named-month>\224|vers <time-of-day>",- -4.7744440273895705),- ("dd mmyear", -5.025758455670476),- ("Vendredi\224|vers <time-of-day>", -5.8730563160576805),- ("Mercredidu|dans le <part-of-day>", -6.278521424165844),- ("aujourd'huifin d'apr\232s-midi", -6.278521424165844),- ("day of month (premier)Novembre", -5.585374243605899),+ -4.77631844218392),+ ("dd mmyear", -5.027632870464827),+ ("Vendredi\224|vers <time-of-day>", -5.87493073085203),+ ("Mercredidu|dans le <part-of-day>", -6.280395838960195),+ ("aujourd'huifin d'apr\232s-midi", -6.280395838960195),+ ("day of month (premier)Novembre", -5.58724865840025), ("le <day-of-month> (non ordinal)<dim time> du matin",- -6.278521424165844),- ("aujourd'huimilieu de matin\233e", -6.278521424165844),+ -6.280395838960195),+ ("aujourd'huimilieu de matin\233e", -6.280395838960195), ("hh(:|h)mm (time-of-day)<day-of-week> <day-of-month>",- -6.278521424165844),- ("le <day-of-month> (non ordinal)Fevrier", -4.199079882486009),- ("Mars<dim time> <part-of-day>", -6.278521424165844),- ("Lundiday of month (premier)", -5.8730563160576805),+ -6.280395838960195),+ ("le <day-of-month> (non ordinal)Fevrier", -4.200954297280359),+ ("Mars<dim time> <part-of-day>", -6.280395838960195),+ ("Lundiday of month (premier)", -5.87493073085203), ("<time-of-day> heuresdu|dans le <part-of-day>",- -5.585374243605899),+ -5.58724865840025), ("<hour-of-day> et quart<dim time> <part-of-day>",- -5.8730563160576805),- ("le <time>du|dans le <part-of-day>", -5.585374243605899),- ("aujourd'huifin de matin\233e", -6.278521424165844),- ("Marsyear", -5.8730563160576805),- ("aujourd'huifin de soir\233e", -6.278521424165844),- ("\224|vers <time-of-day>ce <part-of-day>", -5.585374243605899),+ -5.87493073085203),+ ("le <time>du|dans le <part-of-day>", -5.58724865840025),+ ("aujourd'huifin de matin\233e", -6.280395838960195),+ ("Marsyear", -5.87493073085203),+ ("aujourd'huifin de soir\233e", -6.280395838960195),+ ("\224|vers <time-of-day>ce <part-of-day>", -5.58724865840025), ("<day-of-month> <named-month>d\233but d'apr\232s-midi",- -6.278521424165844),+ -6.280395838960195), ("le <day-of-month> (non ordinal)<dim time> du soir",- -5.585374243605899),- ("intersectSeptembre", -5.8730563160576805),- ("aujourd'huid\233but de soir\233e", -6.278521424165844),- ("<day-of-week> <day-of-month>Fevrier", -5.8730563160576805),- ("<hour-of-day> et demice <part-of-day>", -5.8730563160576805),- ("apr\232s <time-of-day>Jeudi", -5.8730563160576805),- ("le <time>fin de matin\233e", -6.278521424165844),+ -5.58724865840025),+ ("intersectSeptembre", -5.87493073085203),+ ("aujourd'huid\233but de soir\233e", -6.280395838960195),+ ("<day-of-week> <day-of-month>Fevrier", -5.87493073085203),+ ("<hour-of-day> et demice <part-of-day>", -5.87493073085203),+ ("apr\232s <time-of-day>Jeudi", -5.87493073085203),+ ("le <time>fin de matin\233e", -6.280395838960195), ("Jeudide <time-of-day> - <time-of-day> (interval)",- -5.8730563160576805),- ("day of month (premier)Mars", -5.362230692291689),- ("intersectmilieu de journ\233e", -6.278521424165844),- ("intersectfin de journ\233e", -6.278521424165844),+ -5.87493073085203),+ ("day of month (premier)Mars", -5.36410510708604),+ ("intersectmilieu de journ\233e", -6.280395838960195),+ ("intersectfin de journ\233e", -6.280395838960195), ("le <day-of-month> (non ordinal)<time-of-day> heures",- -6.278521424165844),- ("Octobreyear", -5.362230692291689),- ("Fevrierd\233but de matin\233e", -6.278521424165844),+ -6.280395838960195),+ ("Octobreyear", -5.36410510708604),+ ("Fevrierd\233but de matin\233e", -6.280395838960195), ("de <datetime> - <datetime> (interval)Juillet",- -5.8730563160576805),+ -5.87493073085203), ("<hour-of-day> <integer> (as relative minutes)<day-of-week> <day-of-month>",- -6.278521424165844),- ("monthhour", -4.081296846829625),- ("Marsintersect", -6.278521424165844),+ -6.280395838960195),+ ("monthhour", -4.083171261623976),+ ("Marsintersect", -6.280395838960195), ("Lundile <cycle> prochain|suivant|d'apr\232s",- -6.278521424165844),- ("le <time>fin d'apr\232s-midi", -6.278521424165844),- ("hourmonth", -4.7744440273895705),- ("<time-of-day> heuresle <time>", -4.7744440273895705),+ -6.280395838960195),+ ("le <time>fin d'apr\232s-midi", -6.280395838960195),+ ("hourmonth", -4.77631844218392),+ ("<time-of-day> heuresle <time>", -4.77631844218392), ("entre <datetime> et <datetime> (interval)Jeudi",- -5.8730563160576805),- ("dayday", -3.9271461670023666),- ("Septembreyear", -5.8730563160576805),+ -5.87493073085203),+ ("dayday", -3.929020581796717),+ ("Septembreyear", -5.87493073085203), ("aujourd'hui<hour-of-day> <integer> (as relative minutes)",- -5.8730563160576805),- ("apr\232s <time-of-day>Novembre", -5.585374243605899),- ("hourhour", -3.752792779857589),- ("Fevrierd\233but d'apr\232s-midi", -6.278521424165844),+ -5.87493073085203),+ ("apr\232s <time-of-day>Novembre", -5.58724865840025),+ ("hourhour", -3.7546671946519394),+ ("Fevrierd\233but d'apr\232s-midi", -6.280395838960195), ("<day-of-week> <day-of-month>\224|vers <time-of-day>",- -5.179909135497735),- ("<day-of-week> <day-of-month>Septembre", -6.278521424165844),- ("le <time>intersect", -5.8730563160576805),+ -5.181783550292085),+ ("<day-of-week> <day-of-month>Septembre", -6.280395838960195),+ ("le <time>intersect", -5.87493073085203), ("\224|vers <time-of-day><dim time> <part-of-day>",- -6.278521424165844),- ("aujourd'huiau d\233jeuner", -6.278521424165844),- ("Vendrediday of month (premier)", -6.278521424165844),- ("le <day-of-month> (non ordinal)Avril", -6.278521424165844),- ("<time-of-day> heuresintersect", -5.362230692291689),- ("<hour-of-day> et quartce <part-of-day>", -5.8730563160576805),- ("Jeudi\224|vers <time-of-day>", -6.278521424165844),- ("dayyear", -3.880626151367474),- ("le <day-of-month> (non ordinal)Juin", -6.278521424165844),- ("Lundice|dans le <cycle>", -6.278521424165844),- ("apr\232s-demain\224|vers <time-of-day>", -5.8730563160576805),- ("intersectfin d'apr\232s-midi", -6.278521424165844),- ("le <ordinal> <cycle> de <time>year", -6.278521424165844),- ("intersectmilieu d'apr\232s-midi", -6.278521424165844),+ -6.280395838960195),+ ("aujourd'huiau d\233jeuner", -6.280395838960195),+ ("Vendrediday of month (premier)", -6.280395838960195),+ ("le <day-of-month> (non ordinal)Avril", -6.280395838960195),+ ("<time-of-day> heuresintersect", -5.36410510708604),+ ("<hour-of-day> et quartce <part-of-day>", -5.87493073085203),+ ("Jeudi\224|vers <time-of-day>", -6.280395838960195),+ ("dayyear", -3.8825005661618244),+ ("le <day-of-month> (non ordinal)Juin", -6.280395838960195),+ ("Lundice|dans le <cycle>", -6.280395838960195),+ ("apr\232s-demain\224|vers <time-of-day>", -5.87493073085203),+ ("intersectfin d'apr\232s-midi", -6.280395838960195),+ ("le <ordinal> <cycle> de <time>year", -6.280395838960195),+ ("intersectmilieu d'apr\232s-midi", -6.280395838960195), ("<hour-of-day> <integer> (as relative minutes)Jeudi",- -6.278521424165844),- ("le <time>milieu de journ\233e", -6.278521424165844),- ("aujourd'huid\233but de journ\233e", -6.278521424165844),- ("demain\224|vers <time-of-day>", -5.8730563160576805),- ("le <day-of-month> (non ordinal)Mars", -4.892227063045954),+ -6.280395838960195),+ ("le <time>milieu de journ\233e", -6.280395838960195),+ ("aujourd'huid\233but de journ\233e", -6.280395838960195),+ ("demain\224|vers <time-of-day>", -5.87493073085203),+ ("le <day-of-month> (non ordinal)Mars", -4.894101477840304), ("le <day-of-month> (non ordinal)intersect",- -3.7936147743778443),- ("hourminute", -6.278521424165844),- ("dd-dd <month>(interval)year", -6.278521424165844),- ("intersect<day-of-month> <named-month>", -5.8730563160576805),+ -3.7954891891721947),+ ("hourminute", -6.280395838960195),+ ("dd-dd <month>(interval)year", -6.280395838960195),+ ("intersect<day-of-month> <named-month>", -5.87493073085203), ("<hour-of-day> <integer> (as relative minutes)Samedi",- -6.278521424165844),- ("minutemonth", -5.8730563160576805),- ("\224|vers <time-of-day>demain", -6.278521424165844),- ("minutehour", -4.669083511731744),- ("Lundidu|dans le <part-of-day>", -6.278521424165844),- ("aujourd'huimilieu de journ\233e", -6.278521424165844),- ("Mars\224|vers <time-of-day>", -5.585374243605899),- ("intersectd\233but de soir\233e", -6.278521424165844),+ -6.280395838960195),+ ("minutemonth", -5.87493073085203),+ ("\224|vers <time-of-day>demain", -6.280395838960195),+ ("minutehour", -4.6709579265260945),+ ("Lundidu|dans le <part-of-day>", -6.280395838960195),+ ("aujourd'huimilieu de journ\233e", -6.280395838960195),+ ("Mars\224|vers <time-of-day>", -5.58724865840025),+ ("intersectd\233but de soir\233e", -6.280395838960195), ("Mardile <cycle> prochain|suivant|d'apr\232s",- -5.585374243605899),- ("aujourd'huifin de journ\233e", -6.278521424165844),- ("le <day-of-month> (non ordinal)Octobre", -6.278521424165844),- ("intersectdu|dans le <part-of-day>", -4.48676195493779),+ -5.58724865840025),+ ("aujourd'huifin de journ\233e", -6.280395838960195),+ ("le <day-of-month> (non ordinal)Octobre", -6.280395838960195),+ ("intersectdu|dans le <part-of-day>", -4.48863636973214), ("le <day-of-month> \224 <datetime>du|dans le <part-of-day>",- -5.8730563160576805),- ("hh(:|h)mm (time-of-day)Jeudi", -6.278521424165844),+ -5.87493073085203),+ ("hh(:|h)mm (time-of-day)Jeudi", -6.280395838960195), ("le <day-of-month> (non ordinal)apr\232s <time-of-day>",- -6.278521424165844),- ("le <time>Juillet", -6.278521424165844),- ("Lundi<day-of-month> <named-month>", -6.278521424165844),+ -6.280395838960195),+ ("le <time>Juillet", -6.280395838960195),+ ("Lundi<day-of-month> <named-month>", -6.280395838960195), ("Mercredile <cycle> prochain|suivant|d'apr\232s",- -5.585374243605899),- ("Lundifin d'apr\232s-midi", -5.8730563160576805),- ("Lundile <time>", -5.8730563160576805),+ -5.58724865840025),+ ("Lundifin d'apr\232s-midi", -5.87493073085203),+ ("Lundile <time>", -5.87493073085203), ("le <day-of-month> (non ordinal)<dim time> <part-of-day>",- -4.1384552606695735),+ -4.140329675463924), ("Mardi<named-month|named-day> suivant|d'apr\232s",- -5.8730563160576805),- ("apr\232s <time-of-day>le <time>", -5.362230692291689),- ("Mars<dim time> du matin", -6.278521424165844),- ("le <time>Novembre", -5.585374243605899),- ("intersectd\233but d'apr\232s-midi", -6.278521424165844),- ("<datetime> - <datetime> (interval)Jeudi", -5.362230692291689),+ -5.87493073085203),+ ("apr\232s <time-of-day>le <time>", -5.36410510708604),+ ("Mars<dim time> du matin", -6.280395838960195),+ ("le <time>Novembre", -5.58724865840025),+ ("intersectd\233but d'apr\232s-midi", -6.280395838960195),+ ("<datetime> - <datetime> (interval)Jeudi", -5.36410510708604), ("Mercredi<named-month|named-day> suivant|d'apr\232s",- -5.8730563160576805),+ -5.87493073085203), ("<time-of-day> - <time-of-day> (interval)Jeudi",- -5.025758455670476),- ("Samedi<day-of-month> <named-month>", -6.278521424165844),- ("<hour-of-day> et quartdemain", -5.8730563160576805),- ("<time-of-day> heuresce <time>", -6.278521424165844),- ("le <time>d\233but d'apr\232s-midi", -6.278521424165844),- ("day of month (premier)Juillet", -5.585374243605899),+ -5.027632870464827),+ ("Samedi<day-of-month> <named-month>", -6.280395838960195),+ ("<hour-of-day> et quartdemain", -5.87493073085203),+ ("<time-of-day> heuresce <time>", -6.280395838960195),+ ("le <time>d\233but d'apr\232s-midi", -6.280395838960195),+ ("day of month (premier)Juillet", -5.58724865840025), ("<day-of-month> <named-month>du|dans le <part-of-day>",- -5.8730563160576805),- ("Fevriermilieu d'apr\232s-midi", -6.278521424165844),- ("Mercredi\224|vers <time-of-day>", -6.278521424165844),- ("intersectNovembre", -5.025758455670476),- ("le <time><dim time> du matin", -6.278521424165844),- ("Fevrierfin d'apr\232s-midi", -6.278521424165844),- ("apr\232s <time-of-day>intersect", -5.8730563160576805),+ -5.87493073085203),+ ("Fevriermilieu d'apr\232s-midi", -6.280395838960195),+ ("Mercredi\224|vers <time-of-day>", -6.280395838960195),+ ("intersectNovembre", -5.027632870464827),+ ("le <time><dim time> du matin", -6.280395838960195),+ ("Fevrierfin d'apr\232s-midi", -6.280395838960195),+ ("apr\232s <time-of-day>intersect", -5.87493073085203), ("le <day-of-month> (non ordinal)\224|vers <time-of-day>",- -4.7744440273895705),+ -4.77631844218392), ("<day-of-month> <named-month>d\233but de soir\233e",- -6.278521424165844),- ("hierdu|dans le <part-of-day>", -6.278521424165844),- ("le <time>d\233but de soir\233e", -6.278521424165844),- ("Mercredice|dans le <cycle>", -6.278521424165844),- ("Fevrierfin de soir\233e", -6.278521424165844),- ("intersect<dim time> <part-of-day>", -6.278521424165844),- ("Mardice|dans le <cycle>", -6.278521424165844),- ("dayminute", -4.669083511731744),- ("intersectd\233but de journ\233e", -6.278521424165844),- ("<ordinal> <cycle> de <time>year", -5.8730563160576805),- ("Fevriermilieu de matin\233e", -6.278521424165844),- ("le <time>\224|vers <time-of-day>", -5.179909135497735),+ -6.280395838960195),+ ("hierdu|dans le <part-of-day>", -6.280395838960195),+ ("le <time>d\233but de soir\233e", -6.280395838960195),+ ("Mercredice|dans le <cycle>", -6.280395838960195),+ ("Fevrierfin de soir\233e", -6.280395838960195),+ ("intersect<dim time> <part-of-day>", -6.280395838960195),+ ("Mardice|dans le <cycle>", -6.280395838960195),+ ("dayminute", -4.6709579265260945),+ ("intersectd\233but de journ\233e", -6.280395838960195),+ ("<ordinal> <cycle> de <time>year", -5.87493073085203),+ ("Fevriermilieu de matin\233e", -6.280395838960195),+ ("le <time>\224|vers <time-of-day>", -5.181783550292085), ("<day-of-month> <named-month><dim time> du matin",- -6.278521424165844),- ("intersectyear", -5.585374243605899),- ("Fevrierfin de matin\233e", -6.278521424165844),- ("minuteday", -3.334082444999404),- ("le <time>d\233but de matin\233e", -6.278521424165844),- ("Mardile <time>", -4.892227063045954),- ("aujourd'hui\224|vers <time-of-day>", -5.362230692291689),+ -6.280395838960195),+ ("intersectyear", -5.58724865840025),+ ("Fevrierfin de matin\233e", -6.280395838960195),+ ("minuteday", -3.3359568597937543),+ ("le <time>d\233but de matin\233e", -6.280395838960195),+ ("Mardile <time>", -4.894101477840304),+ ("aujourd'hui\224|vers <time-of-day>", -5.36410510708604), ("<day-of-month> <named-month>milieu d'apr\232s-midi",- -6.278521424165844),- ("day of month (premier)intersect", -6.278521424165844),+ -6.280395838960195),+ ("day of month (premier)intersect", -6.280395838960195), ("<day-of-month> <named-month>fin d'apr\232s-midi",- -6.278521424165844),- ("day of month (premier)Janvier", -6.278521424165844),+ -6.280395838960195),+ ("day of month (premier)Janvier", -6.280395838960195), ("de <datetime> - <datetime> (interval)Jeudi",- -5.8730563160576805),- ("le <time>milieu de matin\233e", -6.278521424165844),- ("aujourd'huid\233but de matin\233e", -5.179909135497735),- ("Fevrierd\233but de soir\233e", -6.278521424165844),- ("Jeudiapr\232s <time-of-day>", -5.362230692291689),- ("Mercredile <time>", -4.892227063045954),+ -5.87493073085203),+ ("le <time>milieu de matin\233e", -6.280395838960195),+ ("aujourd'huid\233but de matin\233e", -5.181783550292085),+ ("Fevrierd\233but de soir\233e", -6.280395838960195),+ ("Jeudiapr\232s <time-of-day>", -5.36410510708604),+ ("Mercredile <time>", -4.894101477840304), ("<dim time> <part-of-day>apr\232s <time-of-day>",- -6.278521424165844),- ("le <time>fin de soir\233e", -6.278521424165844),+ -6.280395838960195),+ ("le <time>fin de soir\233e", -6.280395838960195), ("de <time-of-day> - <time-of-day> (interval)Jeudi",- -5.362230692291689),+ -5.36410510708604), ("<day-of-month> <named-month>milieu de matin\233e",- -6.278521424165844),+ -6.280395838960195), ("<day-of-month> <named-month>fin de soir\233e",- -6.278521424165844),+ -6.280395838960195), ("<day-of-month> <named-month>fin de matin\233e",- -6.278521424165844),- ("<time-of-day> heuresce <part-of-day>", -5.8730563160576805),- ("Mercredi<day-of-month> <named-month>", -6.278521424165844),- ("aujourd'huid\233but d'apr\232s-midi", -6.278521424165844),- ("le <time>milieu d'apr\232s-midi", -6.278521424165844),+ -6.280395838960195),+ ("<time-of-day> heuresce <part-of-day>", -5.87493073085203),+ ("Mercredi<day-of-month> <named-month>", -6.280395838960195),+ ("aujourd'huid\233but d'apr\232s-midi", -6.280395838960195),+ ("le <time>milieu d'apr\232s-midi", -6.280395838960195), ("\224|vers <time-of-day>du|dans le <part-of-day>",- -5.179909135497735),+ -5.181783550292085), ("entre <time-of-day> et <time-of-day> (interval)Jeudi",- -5.8730563160576805),- ("intersectintersect", -6.278521424165844),- ("dayweek", -4.081296846829625),+ -5.87493073085203),+ ("intersectintersect", -6.280395838960195),+ ("dayweek", -4.083171261623976), ("entre <datetime> et <datetime> (interval)Juillet",- -6.278521424165844),- ("intersectMars", -6.278521424165844),- ("weekyear", -4.892227063045954),- ("le <time>Mars", -5.8730563160576805),- ("apr\232s le <day-of-month>Mars", -6.278521424165844),- ("hh(:|h)mm (time-of-day)intersect", -5.8730563160576805),+ -6.280395838960195),+ ("intersectMars", -6.280395838960195),+ ("weekyear", -4.894101477840304),+ ("le <time>Mars", -5.87493073085203),+ ("apr\232s le <day-of-month>Mars", -6.280395838960195),+ ("hh(:|h)mm (time-of-day)intersect", -5.87493073085203), ("<day-of-month> <named-month>fin de journ\233e",- -6.278521424165844),+ -6.280395838960195), ("<day-of-month> <named-month>milieu de journ\233e",- -6.278521424165844),- ("le <time>fin de journ\233e", -6.278521424165844),- ("dd/-mm\224|vers <time-of-day>", -5.8730563160576805),- ("intersectfin de matin\233e", -6.278521424165844),- ("Fevrierd\233but de journ\233e", -6.278521424165844),- ("Vendrediintersect", -6.278521424165844),- ("<day-of-month> <named-month>intersect", -6.278521424165844),- ("intersectfin de soir\233e", -6.278521424165844),- ("intersectmilieu de matin\233e", -6.278521424165844),- ("intersect\224|vers <time-of-day>", -5.585374243605899),- ("le <time>year", -4.7744440273895705),- ("Vendrediapr\232s <time-of-day>", -6.278521424165844),- ("hh(:|h)mm (time-of-day)Samedi", -6.278521424165844),- ("le <time><dim time> <part-of-day>", -6.278521424165844),- ("Fevrierfin de journ\233e", -6.278521424165844),- ("Fevriermilieu de journ\233e", -6.278521424165844),- ("le <time>d\233but de journ\233e", -6.278521424165844),- ("intersectd\233but de matin\233e", -6.278521424165844)],+ -6.280395838960195),+ ("le <time>fin de journ\233e", -6.280395838960195),+ ("dd/-mm\224|vers <time-of-day>", -5.87493073085203),+ ("intersectfin de matin\233e", -6.280395838960195),+ ("Fevrierd\233but de journ\233e", -6.280395838960195),+ ("Vendrediintersect", -6.280395838960195),+ ("<day-of-month> <named-month>intersect", -6.280395838960195),+ ("intersectfin de soir\233e", -6.280395838960195),+ ("intersectmilieu de matin\233e", -6.280395838960195),+ ("intersect\224|vers <time-of-day>", -5.58724865840025),+ ("le <time>year", -4.77631844218392),+ ("Vendrediapr\232s <time-of-day>", -6.280395838960195),+ ("hh(:|h)mm (time-of-day)Samedi", -6.280395838960195),+ ("le <time><dim time> <part-of-day>", -6.280395838960195),+ ("Fevrierfin de journ\233e", -6.280395838960195),+ ("Fevriermilieu de journ\233e", -6.280395838960195),+ ("le <time>d\233but de journ\233e", -6.280395838960195),+ ("intersectd\233but de matin\233e", -6.280395838960195)], n = 414}, koData =- ClassData{prior = -1.5979435330083651,- unseen = -6.1070228877422545,+ ClassData{prior = -1.575536360758419, unseen = -6.124683390894205, likelihoods = HashMap.fromList [("year<time-of-day> - <time-of-day> (interval)",- -4.718498871295094),- ("demain<time-of-day> heures", -5.4116460518550396),- ("hourday", -3.2144214745188204),- ("<day-of-month> <named-month>year", -5.4116460518550396),- ("demainavant <time-of-day>", -5.4116460518550396),- ("dayhour", -2.7374974024285113),+ -4.736198448394496),+ ("demain<time-of-day> heures", -5.429345628954441),+ ("hourday", -3.2321210516182215),+ ("<day-of-month> <named-month>year", -5.429345628954441),+ ("demainavant <time-of-day>", -5.429345628954441),+ ("dayhour", -2.755196979527912), ("<time-of-day> - <time-of-day> (interval)Juillet",- -4.718498871295094),+ -4.736198448394496), ("Jeudi<time-of-day> - <time-of-day> (interval)",- -5.006180943746876),- ("daymonth", -3.8022081394209395),- ("monthday", -5.4116460518550396),- ("monthyear", -4.718498871295094),- ("yearhour", -4.718498871295094),- ("le <cycle> de <time>Octobre", -5.006180943746876),- ("houryear", -5.006180943746876),+ -5.0238805208462765),+ ("daymonth", -3.8199077165203406),+ ("monthday", -5.429345628954441),+ ("monthyear", -4.736198448394496),+ ("yearhour", -4.736198448394496),+ ("le <cycle> de <time>Octobre", -5.0238805208462765),+ ("houryear", -5.0238805208462765), ("<time-of-day> heuresdu|dans le <part-of-day>",- -4.718498871295094),- ("le <time>du|dans le <part-of-day>", -5.006180943746876),- ("Marsyear", -5.4116460518550396),- ("Dimanche<day-of-month> <named-month>", -4.718498871295094),+ -4.736198448394496),+ ("le <time>du|dans le <part-of-day>", -5.0238805208462765),+ ("Marsyear", -5.429345628954441),+ ("Dimanche<day-of-month> <named-month>", -4.736198448394496), ("<time-of-day> heuresle <day-of-month> (non ordinal)",- -4.4953553199808844),+ -4.513054897080286), ("le <day-of-month> (non ordinal)<time-of-day> heures",- -5.4116460518550396),- ("aujourd'huidu|dans le <part-of-day>", -5.006180943746876),+ -5.429345628954441),+ ("aujourd'huidu|dans le <part-of-day>", -5.0238805208462765), ("de <datetime> - <datetime> (interval)Juillet",- -5.4116460518550396),- ("monthhour", -4.02535169073515),- ("hourmonth", -4.1588830833596715),+ -5.429345628954441),+ ("monthhour", -4.04305126783455),+ ("hourmonth", -4.176582660459073), ("Vendredi<time-of-day> - <time-of-day> (interval)",- -4.1588830833596715),- ("dayday", -3.619886582626985),- ("Septembreyear", -5.4116460518550396),- ("Lundiapr\232s <time-of-day>", -5.4116460518550396),- ("hourhour", -3.8022081394209395),- ("\224|vers <time-of-day>Jeudi", -4.718498871295094),- ("dayyear", -4.1588830833596715),- ("le lendemain du <time>Fevrier", -5.4116460518550396),- ("demain\224|vers <time-of-day>", -5.006180943746876),- ("Mars\224|vers <time-of-day>", -4.31303376318693),- ("Lundi<datetime> - <datetime> (interval)", -5.006180943746876),- ("intersect by 'de' or ','year", -5.006180943746876),- ("hh(:|h)mm (time-of-day)Jeudi", -5.4116460518550396),- ("weekmonth", -5.006180943746876),- ("le <day-of-month> (non ordinal)Juillet", -5.4116460518550396),- ("le <day-of-month> (non ordinal)year", -5.006180943746876),- ("Juillet<day-of-month> <named-month>", -5.4116460518550396),+ -4.176582660459073),+ ("dayday", -3.6375861597263857),+ ("Septembreyear", -5.429345628954441),+ ("Lundiapr\232s <time-of-day>", -5.429345628954441),+ ("hourhour", -3.5575434520528493),+ ("\224|vers <time-of-day>Jeudi", -4.736198448394496),+ ("dayyear", -4.176582660459073),+ ("le lendemain du <time>Fevrier", -5.429345628954441),+ ("demain\224|vers <time-of-day>", -5.0238805208462765),+ ("<time> timezoneapr\232s <time-of-day>", -5.0238805208462765),+ ("Mars\224|vers <time-of-day>", -4.330733340286331),+ ("Lundi<datetime> - <datetime> (interval)",+ -5.0238805208462765),+ ("intersect by 'de' or ','year", -5.0238805208462765),+ ("hh(:|h)mm (time-of-day)Jeudi", -5.429345628954441),+ ("weekmonth", -5.0238805208462765),+ ("le <day-of-month> (non ordinal)Juillet", -5.429345628954441),+ ("le <day-of-month> (non ordinal)year", -5.0238805208462765),+ ("Juillet<day-of-month> <named-month>", -5.429345628954441), ("<time-of-day> - <time-of-day> (interval)Septembre",- -5.4116460518550396),+ -5.429345628954441), ("Samedi<time-of-day> - <time-of-day> (interval)",- -5.006180943746876),- ("<time-of-day> heuresdd/-mm", -5.4116460518550396),+ -5.0238805208462765),+ ("<time-of-day> heuresdd/-mm", -5.429345628954441), ("<time-of-day> - <time-of-day> (interval)du|dans le <part-of-day>",- -5.006180943746876),- ("intersectyear", -5.4116460518550396),- ("minuteday", -5.4116460518550396),- ("Mardile <time>", -5.4116460518550396),- ("Fevrierdu|dans le <part-of-day>", -5.006180943746876),- ("aujourd'hui\224|vers <time-of-day>", -5.006180943746876),- ("<datetime>-dd <month>(interval)year", -5.006180943746876),- ("Jeudiapr\232s <time-of-day>", -5.006180943746876),- ("Mercredile <time>", -5.4116460518550396),+ -5.0238805208462765),+ ("intersectyear", -5.429345628954441),+ ("minuteday", -5.429345628954441),+ ("Mardile <time>", -5.429345628954441),+ ("Fevrierdu|dans le <part-of-day>", -5.0238805208462765),+ ("aujourd'hui\224|vers <time-of-day>", -5.0238805208462765),+ ("<datetime>-dd <month>(interval)year", -5.0238805208462765),+ ("Jeudiapr\232s <time-of-day>", -5.0238805208462765),+ ("Mercredile <time>", -5.429345628954441), ("le <day-of-month> (non ordinal)avant <time-of-day>",- -5.4116460518550396),+ -5.429345628954441), ("<dim time> <part-of-day>apr\232s <time-of-day>",- -5.4116460518550396),- ("Mercredi<day-of-month> <named-month>", -4.4953553199808844),- ("demainapr\232s <time-of-day>", -5.4116460518550396),- ("<day-of-week> <day-of-month>Juillet", -4.02535169073515),+ -5.429345628954441),+ ("Mercredi<day-of-month> <named-month>", -4.513054897080286),+ ("demainapr\232s <time-of-day>", -5.429345628954441),+ ("<day-of-week> <day-of-month>Juillet", -4.04305126783455), ("<time-of-day> - <time-of-day> (interval)intersect",- -5.4116460518550396),+ -5.429345628954441), ("apr\232s <time-of-day>\224|vers <time-of-day>",- -5.006180943746876),- ("Fevrieryear", -5.4116460518550396),- ("Jeudi<time-of-day> heures", -5.006180943746876),+ -5.0238805208462765),+ ("\224|vers <time-of-day>apr\232s <time-of-day>",+ -5.429345628954441),+ ("Fevrieryear", -5.429345628954441),+ ("Jeudi<time-of-day> heures", -5.0238805208462765), ("apr\232s <time-of-day>le <day-of-month> (non ordinal)",- -5.006180943746876),- ("avant <time-of-day>Jeudi", -5.4116460518550396),+ -5.0238805208462765),+ ("avant <time-of-day>Jeudi", -5.429345628954441), ("de <datetime> - <datetime> (interval)<day-of-month> <named-month>",- -5.4116460518550396),+ -5.429345628954441), ("<dim time> <part-of-day><time-of-day> heures",- -5.4116460518550396),- ("<time-of-day> heuresJeudi", -4.31303376318693)],- n = 105}}),+ -5.429345628954441),+ ("<time-of-day> heuresJeudi", -4.330733340286331)],+ n = 108}}), ("Janvier", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -1438,7 +1450,7 @@ likelihoods = HashMap.fromList [], n = 0}}), ("\224|vers <time-of-day>", Classifier{okData =- ClassData{prior = -0.19319122903085847, unseen = -4.90527477843843,+ ClassData{prior = -0.23293155768037255, unseen = -4.90527477843843, likelihoods = HashMap.fromList [("<time> timezone", -4.204692619390966),@@ -1457,15 +1469,24 @@ -3.288401887516811)], n = 61}, koData =- ClassData{prior = -1.739115735742633, unseen = -3.6635616461296463,+ ClassData{prior = -1.5712166996139025,+ unseen = -3.8066624897703196, likelihoods = HashMap.fromList- [("hh(:|h)mm (time-of-day)", -2.538973871058276),- ("hour", -1.3350010667323402), ("minute", -2.0281482472922856),- ("<time-of-day> heures", -1.3350010667323402),+ [("<time> timezone", -2.3978952727983707),+ ("hh(:|h)mm (time-of-day)", -2.6855773452501515),+ ("hour", -1.3862943611198906), ("minute", -1.8382794848629478),+ ("<time-of-day> heures", -1.4816045409242156), ("<hour-of-day> <integer> (as relative minutes)",- -2.538973871058276)],- n = 13}}),+ -2.6855773452501515)],+ n = 16}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.1780538303479458,+ likelihoods = HashMap.fromList [("", 0.0)], n = 22}}), ("d\233but <named-month>(interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707,@@ -1535,123 +1556,125 @@ likelihoods = HashMap.fromList [], n = 0}}), ("<dim time> <part-of-day>", Classifier{okData =- ClassData{prior = -9.53101798043249e-2,- unseen = -5.723585101952381,+ ClassData{prior = -0.1823215567939546, unseen = -5.730099782973574, likelihoods = HashMap.fromList- [("Mercredisoir", -5.0271645960474665),+ [("Mercredisoir", -5.033700567027251), ("<day-of-month> <named-month>d\233but de journ\233e",- -5.0271645960474665),- ("dayhour", -1.500804071431305),+ -5.033700567027251),+ ("dayhour", -1.5073400424110905), ("<day-of-month> <named-month>d\233but de matin\233e",- -5.0271645960474665),- ("aujourd'huimilieu d'apr\232s-midi", -5.0271645960474665),- ("Mercredidu|dans le <part-of-day>", -5.0271645960474665),- ("aujourd'huifin d'apr\232s-midi", -5.0271645960474665),- ("aujourd'huimilieu de matin\233e", -5.0271645960474665),+ -5.033700567027251),+ ("aujourd'huimilieu d'apr\232s-midi", -5.033700567027251),+ ("Mercredidu|dans le <part-of-day>", -5.033700567027251),+ ("aujourd'huifin d'apr\232s-midi", -5.033700567027251),+ ("aujourd'huimilieu de matin\233e", -5.033700567027251), ("<time-of-day> heuresdu|dans le <part-of-day>",- -4.334017415487521),- ("le <time>du|dans le <part-of-day>", -4.334017415487521),- ("aujourd'huifin de matin\233e", -5.0271645960474665),- ("aujourd'huifin de soir\233e", -5.0271645960474665),- ("\224|vers <time-of-day>ce <part-of-day>", -4.334017415487521),+ -4.340553386467307),+ ("le <time>du|dans le <part-of-day>", -4.340553386467307),+ ("aujourd'huifin de matin\233e", -5.033700567027251),+ ("aujourd'huifin de soir\233e", -5.033700567027251),+ ("\224|vers <time-of-day>ce <part-of-day>", -4.340553386467307), ("<day-of-month> <named-month>d\233but d'apr\232s-midi",- -5.0271645960474665),- ("demainsoir", -5.0271645960474665),- ("aujourd'huid\233but de soir\233e", -5.0271645960474665),- ("Lundimatin", -5.0271645960474665),- ("<hour-of-day> et demice <part-of-day>", -4.621699487939302),- ("le <time>fin de matin\233e", -5.0271645960474665),- ("intersectmilieu de journ\233e", -5.0271645960474665),- ("intersectfin de journ\233e", -5.0271645960474665),- ("Fevrierd\233but de matin\233e", -5.0271645960474665),- ("monthhour", -3.235405126819411),- ("le <time>fin d'apr\232s-midi", -5.0271645960474665),- ("hourhour", -2.542257946259466),- ("Fevrierd\233but d'apr\232s-midi", -5.0271645960474665),- ("aujourd'huiau d\233jeuner", -5.0271645960474665),- ("<hour-of-day> et quartce <part-of-day>", -4.621699487939302),- ("intersectfin d'apr\232s-midi", -5.0271645960474665),- ("intersectmilieu d'apr\232s-midi", -5.0271645960474665),- ("le <time>milieu de journ\233e", -5.0271645960474665),- ("aujourd'huid\233but de journ\233e", -5.0271645960474665),- ("demainapr\232s-midi", -5.0271645960474665),- ("minutehour", -3.417726683613366),- ("Lundidu|dans le <part-of-day>", -5.0271645960474665),- ("aujourd'huimilieu de journ\233e", -5.0271645960474665),- ("intersectd\233but de soir\233e", -5.0271645960474665),- ("aujourd'huifin de journ\233e", -5.0271645960474665),- ("intersectdu|dans le <part-of-day>", -3.235405126819411),+ -5.033700567027251),+ ("demainsoir", -5.033700567027251),+ ("aujourd'huid\233but de soir\233e", -5.033700567027251),+ ("Lundimatin", -5.033700567027251),+ ("<hour-of-day> et demice <part-of-day>", -4.628235458919088),+ ("le <time>fin de matin\233e", -5.033700567027251),+ ("intersectmilieu de journ\233e", -5.033700567027251),+ ("intersectfin de journ\233e", -5.033700567027251),+ ("Fevrierd\233but de matin\233e", -5.033700567027251),+ ("monthhour", -3.241941097799197),+ ("le <time>fin d'apr\232s-midi", -5.033700567027251),+ ("hourhour", -2.5487939172392515),+ ("Fevrierd\233but d'apr\232s-midi", -5.033700567027251),+ ("aujourd'huiau d\233jeuner", -5.033700567027251),+ ("<hour-of-day> et quartce <part-of-day>", -4.628235458919088),+ ("intersectfin d'apr\232s-midi", -5.033700567027251),+ ("intersectmilieu d'apr\232s-midi", -5.033700567027251),+ ("le <time>milieu de journ\233e", -5.033700567027251),+ ("aujourd'huid\233but de journ\233e", -5.033700567027251),+ ("demainapr\232s-midi", -5.033700567027251),+ ("minutehour", -3.4242626545931514),+ ("Lundidu|dans le <part-of-day>", -5.033700567027251),+ ("aujourd'huimilieu de journ\233e", -5.033700567027251),+ ("intersectd\233but de soir\233e", -5.033700567027251),+ ("aujourd'huifin de journ\233e", -5.033700567027251),+ ("intersectdu|dans le <part-of-day>", -3.241941097799197), ("le <day-of-month> \224 <datetime>du|dans le <part-of-day>",- -4.621699487939302),- ("Lundifin d'apr\232s-midi", -4.621699487939302),- ("intersectd\233but d'apr\232s-midi", -5.0271645960474665),- ("le <time>d\233but d'apr\232s-midi", -5.0271645960474665),+ -4.628235458919088),+ ("Lundifin d'apr\232s-midi", -4.628235458919088),+ ("intersectd\233but d'apr\232s-midi", -5.033700567027251),+ ("le <time>d\233but d'apr\232s-midi", -5.033700567027251), ("<day-of-month> <named-month>du|dans le <part-of-day>",- -4.621699487939302),- ("Fevriermilieu d'apr\232s-midi", -5.0271645960474665),- ("Fevrierfin d'apr\232s-midi", -5.0271645960474665),+ -4.628235458919088),+ ("Fevriermilieu d'apr\232s-midi", -5.033700567027251),+ ("Fevrierfin d'apr\232s-midi", -5.033700567027251), ("<day-of-month> <named-month>d\233but de soir\233e",- -5.0271645960474665),- ("hierdu|dans le <part-of-day>", -5.0271645960474665),- ("le <time>d\233but de soir\233e", -5.0271645960474665),- ("Fevrierfin de soir\233e", -5.0271645960474665),- ("intersectd\233but de journ\233e", -5.0271645960474665),- ("Fevriermilieu de matin\233e", -5.0271645960474665),- ("Fevrierfin de matin\233e", -5.0271645960474665),- ("le <time>d\233but de matin\233e", -5.0271645960474665),+ -5.033700567027251),+ ("hierdu|dans le <part-of-day>", -5.033700567027251),+ ("le <time>d\233but de soir\233e", -5.033700567027251),+ ("Fevrierfin de soir\233e", -5.033700567027251),+ ("intersectd\233but de journ\233e", -5.033700567027251),+ ("Fevriermilieu de matin\233e", -5.033700567027251),+ ("Fevrierfin de matin\233e", -5.033700567027251),+ ("le <time>d\233but de matin\233e", -5.033700567027251), ("<day-of-month> <named-month>milieu d'apr\232s-midi",- -5.0271645960474665),+ -5.033700567027251), ("<day-of-month> <named-month>fin d'apr\232s-midi",- -5.0271645960474665),- ("le <time>milieu de matin\233e", -5.0271645960474665),- ("aujourd'huid\233but de matin\233e", -3.9285523073793565),- ("Fevrierd\233but de soir\233e", -5.0271645960474665),- ("le <time>fin de soir\233e", -5.0271645960474665),+ -5.033700567027251),+ ("le <time>milieu de matin\233e", -5.033700567027251),+ ("aujourd'huid\233but de matin\233e", -3.9350882783591423),+ ("Fevrierd\233but de soir\233e", -5.033700567027251),+ ("le <time>fin de soir\233e", -5.033700567027251), ("<day-of-month> <named-month>milieu de matin\233e",- -5.0271645960474665),+ -5.033700567027251), ("<day-of-month> <named-month>fin de soir\233e",- -5.0271645960474665),+ -5.033700567027251), ("<day-of-month> <named-month>fin de matin\233e",- -5.0271645960474665),- ("<time-of-day> heuresce <part-of-day>", -4.621699487939302),- ("aujourd'huid\233but d'apr\232s-midi", -5.0271645960474665),- ("le <time>milieu d'apr\232s-midi", -5.0271645960474665),+ -5.033700567027251),+ ("<time-of-day> heuresce <part-of-day>", -4.628235458919088),+ ("aujourd'huid\233but d'apr\232s-midi", -5.033700567027251),+ ("le <time>milieu d'apr\232s-midi", -5.033700567027251), ("\224|vers <time-of-day>du|dans le <part-of-day>",- -3.9285523073793565),- ("Jeudimatin", -5.0271645960474665),+ -3.9350882783591423),+ ("Jeudimatin", -5.033700567027251), ("<day-of-month> <named-month>fin de journ\233e",- -5.0271645960474665),+ -5.033700567027251), ("<day-of-month> <named-month>milieu de journ\233e",- -5.0271645960474665),- ("le <time>fin de journ\233e", -5.0271645960474665),- ("Lundiapr\232s-midi", -5.0271645960474665),- ("intersectfin de matin\233e", -5.0271645960474665),- ("Fevrierd\233but de journ\233e", -5.0271645960474665),- ("intersectfin de soir\233e", -5.0271645960474665),- ("intersectmilieu de matin\233e", -5.0271645960474665),- ("intersectapr\232s-midi", -4.334017415487521),- ("Fevrierfin de journ\233e", -5.0271645960474665),- ("Fevriermilieu de journ\233e", -5.0271645960474665),- ("le <time>d\233but de journ\233e", -5.0271645960474665),- ("intersectd\233but de matin\233e", -5.0271645960474665),- ("hiersoir", -5.0271645960474665)],+ -5.033700567027251),+ ("le <time>fin de journ\233e", -5.033700567027251),+ ("Lundiapr\232s-midi", -5.033700567027251),+ ("intersectfin de matin\233e", -5.033700567027251),+ ("Fevrierd\233but de journ\233e", -5.033700567027251),+ ("intersectfin de soir\233e", -5.033700567027251),+ ("intersectmilieu de matin\233e", -5.033700567027251),+ ("intersectapr\232s-midi", -4.340553386467307),+ ("Fevrierfin de journ\233e", -5.033700567027251),+ ("Fevriermilieu de journ\233e", -5.033700567027251),+ ("le <time>d\233but de journ\233e", -5.033700567027251),+ ("intersectd\233but de matin\233e", -5.033700567027251),+ ("hiersoir", -5.033700567027251)], n = 110}, koData =- ClassData{prior = -2.3978952727983707, unseen = -4.68213122712422,+ ClassData{prior = -1.791759469228055, unseen = -4.882801922586371, likelihoods = HashMap.fromList- [("dayhour", -3.5742165457937967),+ [("dayhour", -3.776585034533042), ("<time-of-day> heuresdu|dans le <part-of-day>",- -3.2865344733420154),- ("le <time>du|dans le <part-of-day>", -3.5742165457937967),- ("aujourd'huidu|dans le <part-of-day>", -3.5742165457937967),- ("monthhour", -3.5742165457937967),- ("hourhour", -2.5933872927820705),+ -3.488902962081261),+ ("le <time>du|dans le <part-of-day>", -3.776585034533042),+ ("aujourd'huidu|dans le <part-of-day>", -3.776585034533042),+ ("monthhour", -3.776585034533042),+ ("\224|vers <time-of-day>apr\232s-midi", -3.488902962081261),+ ("hourhour", -2.477302050402781),+ ("minutehour", -2.677972745864932), ("<time-of-day> - <time-of-day> (interval)du|dans le <part-of-day>",- -3.5742165457937967),- ("Fevrierdu|dans le <part-of-day>", -3.5742165457937967)],- n = 11}}),+ -3.776585034533042),+ ("Fevrierdu|dans le <part-of-day>", -3.776585034533042),+ ("<time> timezoneapr\232s-midi", -2.677972745864932)],+ n = 22}}), ("jour de l'an", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906,
Duckling/Ranking/Classifiers/GA_XX.hs view
@@ -70,6 +70,13 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("year", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453,
Duckling/Ranking/Classifiers/HE_XX.hs view
@@ -553,6 +553,13 @@ ClassData{prior = -1.3862943611198906, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("ordinal 9", -0.916290731874155)], n = 1}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}), ("this <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003,
+ Duckling/Ranking/Classifiers/HI_XX.hs view
@@ -0,0 +1,22 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++-----------------------------------------------------------------+-- Auto-generated by regenClassifiers+--+-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING+-- @generated+-----------------------------------------------------------------+{-# LANGUAGE OverloadedStrings #-}+module Duckling.Ranking.Classifiers.HI_XX (classifiers) where+import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import Duckling.Ranking.Types++classifiers :: Classifiers+classifiers = HashMap.fromList []
Duckling/Ranking/Classifiers/HR_XX.hs view
@@ -23,32 +23,32 @@ = HashMap.fromList [("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.4849066497880004,+ ClassData{prior = 0.0, unseen = -2.772588722239781, likelihoods = HashMap.fromList- [("<time> <part-of-day>", -1.7047480922384253),- ("intersect", -1.7047480922384253),- ("hh:mm", -1.7047480922384253), ("hour", -1.7047480922384253),- ("minute", -1.2992829841302609)],- n = 3},+ [("<time> <part-of-day>", -2.0149030205422647),+ ("intersect", -1.6094379124341003),+ ("hh:mm", -1.6094379124341003), ("hour", -2.0149030205422647),+ ("minute", -1.0986122886681098)],+ n = 5}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("Thursday", Classifier{okData =- ClassData{prior = -7.410797215372185e-2,- unseen = -2.70805020110221,- likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ ClassData{prior = -6.899287148695143e-2,+ unseen = -2.772588722239781,+ likelihoods = HashMap.fromList [("", 0.0)], n = 14}, koData =- ClassData{prior = -2.639057329615259, unseen = -1.0986122886681098,+ ClassData{prior = -2.70805020110221, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.9697794168251413, unseen = -4.532599493153256,+ ClassData{prior = -0.9780782196398363, unseen = -4.532599493153256, likelihoods = HashMap.fromList [("", 0.0)], n = 91}, koData =- ClassData{prior = -0.4766926173965321, unseen = -5.017279836814924,- likelihoods = HashMap.fromList [("", 0.0)], n = 149}}),+ ClassData{prior = -0.471657889341762, unseen = -5.030437921392435,+ likelihoods = HashMap.fromList [("", 0.0)], n = 151}}), ("Father's Day", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -348,121 +348,120 @@ n = 2}}), ("intersect", Classifier{okData =- ClassData{prior = -0.5019253742957266,- unseen = -6.0844994130751715,+ ClassData{prior = -0.4969802169439377, unseen = -6.093569770045136, likelihoods = HashMap.fromList [("u <named-day><day-of-month>(ordinal) <named-month>",- -5.389071729816501),- ("hourday", -4.983606621708336),- ("dd.mm<time-of-day> o'clock", -5.389071729816501),- ("dayhour", -2.714923080389972),- ("daymonth", -3.597312260588446),+ -5.3981627015177525),+ ("hourday", -4.992697593409589),+ ("dd.mm<time-of-day> o'clock", -5.3981627015177525),+ ("dayhour", -2.724014052091224),+ ("daymonth", -3.606403232289698), ("u <named-day><named-month> <day-of-month> (ordinal)",- -5.389071729816501),- ("monthyear", -3.6843236375780757),- ("Wednesdayintersect", -5.389071729816501),- ("christmasyear", -5.389071729816501),- ("Wednesdaynext <cycle>", -5.389071729816501),- ("u <named-day><time-of-day> o'clock", -5.389071729816501),- ("<time> <part-of-day>u <named-day>", -4.00277736869661),- ("intersectat <time-of-day>", -5.389071729816501),- ("Saturday<time> <part-of-day>", -4.983606621708336),- ("day before yesterdayat <time-of-day>", -4.695924549256556),- ("Marchyear", -5.389071729816501),+ -5.3981627015177525),+ ("monthyear", -3.6934146092793276),+ ("Wednesdayintersect", -5.3981627015177525),+ ("christmasyear", -5.3981627015177525),+ ("Wednesdaynext <cycle>", -5.3981627015177525),+ ("u <named-day><time-of-day> o'clock", -5.3981627015177525),+ ("<time> <part-of-day>u <named-day>", -4.011868340397862),+ ("intersectat <time-of-day>", -5.3981627015177525),+ ("Saturday<time> <part-of-day>", -4.992697593409589),+ ("day before yesterdayat <time-of-day>", -4.705015520957807),+ ("Marchyear", -5.3981627015177525), ("<named-day> <day-of-month> (ordinal)September",- -4.983606621708336),- ("Saturdayat <time-of-day>", -4.983606621708336),+ -4.992697593409589),+ ("Saturdayat <time-of-day>", -4.992697593409589), ("between <time-of-day> and <time-of-day> (interval)u <named-day>",- -4.695924549256556),+ -4.705015520957807), ("between <datetime> and <datetime> (interval)u <named-day>",- -4.695924549256556),- ("last <cycle>u <named-day>", -5.389071729816501),- ("<time-of-day> o'clocktonight", -5.389071729816501),+ -4.705015520957807),+ ("last <cycle>u <named-day>", -5.3981627015177525),+ ("<time-of-day> o'clocktonight", -5.3981627015177525), ("from <datetime> - <datetime> (interval)u <named-day>",- -5.389071729816501),- ("today<time> <part-of-day>", -4.983606621708336),- ("todayat <time-of-day>", -5.389071729816501),- ("Thursday<time> timezone", -5.389071729816501),+ -5.3981627015177525),+ ("today<time> <part-of-day>", -4.992697593409589),+ ("todayat <time-of-day>", -5.3981627015177525),+ ("Thursday<time> timezone", -4.992697593409589), ("from <time-of-day> - <time-of-day> (interval)u <named-day>",- -5.389071729816501),- ("next <cycle>u <named-day>", -5.389071729816501),- ("dayday", -3.1377799312100056),- ("hourhour", -5.389071729816501),+ -5.3981627015177525),+ ("next <cycle>u <named-day>", -5.3981627015177525),+ ("dayday", -3.1468709029112576),+ ("hourhour", -5.3981627015177525), ("intersect<named-month> <day-of-month> (non ordinal)",- -4.983606621708336),+ -4.992697593409589), ("Thursdaybetween <time-of-day> and <time-of-day> (interval)",- -4.695924549256556),- ("dayyear", -3.884994333040227),+ -4.705015520957807),+ ("dayyear", -3.8940853047414787), ("Thursdaybetween <datetime> and <datetime> (interval)",- -4.695924549256556),- ("<time-of-day> o'clocktomorrow", -5.389071729816501),- ("Thursday<time> <part-of-day>", -4.983606621708336),+ -4.705015520957807),+ ("<time-of-day> o'clocktomorrow", -5.3981627015177525),+ ("Thursday<time> <part-of-day>", -4.992697593409589), ("<time-of-day> - <time-of-day> (interval)u <named-day>",- -4.472780997942346),+ -4.481871969643597), ("<day-of-month>(ordinal) <named-month>year",- -4.983606621708336),+ -4.992697593409589), ("<datetime> - <datetime> (interval)u <named-day>",- -4.472780997942346),+ -4.481871969643597), ("absorption of , after named day<day-of-month>(ordinal) <named-month>",- -4.00277736869661),- ("day after tomorrow<time> <part-of-day>", -5.389071729816501),- ("Thursdayhh:mm", -5.389071729816501),- ("minutemonth", -4.472780997942346),- ("day after tomorrowat <time-of-day>", -4.983606621708336),+ -4.011868340397862),+ ("day after tomorrow<time> <part-of-day>", -5.3981627015177525),+ ("Thursdayhh:mm", -4.992697593409589),+ ("minutemonth", -4.481871969643597),+ ("day after tomorrowat <time-of-day>", -4.992697593409589), ("absorption of , after named day<named-month> <day-of-month> (ordinal)",- -4.472780997942346),+ -4.481871969643597), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -4.983606621708336),+ -4.992697593409589), ("<named-day> <day-of-month> (ordinal)February",- -4.136308761321133),- ("this <cycle>u <named-day>", -4.983606621708336),- ("last <day-of-week> <time>year", -4.983606621708336),- ("dd.mmat <time-of-day>", -4.983606621708336),+ -4.145399733022385),+ ("this <cycle>u <named-day>", -4.992697593409589),+ ("last <day-of-week> <time>year", -4.992697593409589),+ ("dd.mmat <time-of-day>", -4.992697593409589), ("intersect<day-of-month>(ordinal) <named-month>",- -4.472780997942346),+ -4.481871969643597), ("intersect<named-month> <day-of-month> (ordinal)",- -4.983606621708336),- ("Saturday<time-of-day> o'clock", -5.389071729816501),+ -4.992697593409589),+ ("Saturday<time-of-day> o'clock", -5.3981627015177525), ("day before yesterday<time-of-day> o'clock",- -5.389071729816501),+ -5.3981627015177525), ("<time> <part-of-day><named-day> <day-of-month> (ordinal)",- -4.472780997942346),- ("dayminute", -3.3096301881366648),- ("u <named-day>at <time-of-day>", -4.983606621708336),- ("<time> <part-of-day>intersect", -3.5172695529149096),- ("u <named-day><time> <part-of-day>", -4.983606621708336),- ("Tuesdayu <named-month>", -5.389071729816501),- ("intersectyear", -5.389071729816501),- ("intersectSeptember", -4.472780997942346),- ("<ordinal> <cycle> of <time>year", -5.389071729816501),- ("minuteday", -2.093234863812172),+ -4.481871969643597),+ ("dayminute", -3.2009381241815333),+ ("u <named-day>at <time-of-day>", -4.992697593409589),+ ("<time> <part-of-day>intersect", -3.5263605246161616),+ ("u <named-day><time> <part-of-day>", -4.992697593409589),+ ("Tuesdayu <named-month>", -5.3981627015177525),+ ("intersectyear", -5.3981627015177525),+ ("intersectSeptember", -4.481871969643597),+ ("<ordinal> <cycle> of <time>year", -5.3981627015177525),+ ("minuteday", -2.102325835513424), ("absorption of , after named dayintersect",- -5.389071729816501),- ("<time> <part-of-day>intersect by \",\"", -4.472780997942346),- ("Octoberyear", -4.290459441148391),- ("intersect by \",\"at <time-of-day>", -4.472780997942346),+ -5.3981627015177525),+ ("<time> <part-of-day>intersect by \",\"", -4.481871969643597),+ ("Octoberyear", -4.299550412849643),+ ("intersect by \",\"at <time-of-day>", -4.481871969643597), ("absorption of , after named dayintersect by \",\"",- -4.290459441148391),- ("yearat <time-of-day>", -5.389071729816501),- ("Septemberyear", -4.983606621708336),+ -4.299550412849643),+ ("yearat <time-of-day>", -5.3981627015177525),+ ("Septemberyear", -4.992697593409589), ("<time> <part-of-day>absorption of , after named day",- -4.695924549256556),- ("todaytonight", -5.389071729816501),- ("weekday", -4.472780997942346),- ("dayweek", -5.389071729816501),- ("weekyear", -4.983606621708336),- ("Wednesdayu <named-month>", -5.389071729816501),+ -4.705015520957807),+ ("todaytonight", -5.3981627015177525),+ ("weekday", -4.481871969643597),+ ("dayweek", -5.3981627015177525),+ ("weekyear", -4.992697593409589),+ ("Wednesdayu <named-month>", -5.3981627015177525), ("u <named-day><named-month> <day-of-month> (non ordinal)",- -5.389071729816501),- ("u <named-month>year", -4.983606621708336),- ("last <cycle> of <time>year", -4.983606621708336),+ -5.3981627015177525),+ ("u <named-month>year", -4.992697593409589),+ ("last <cycle> of <time>year", -4.992697593409589), ("<day-of-month> (non ordinal) <named-month>year",- -5.389071729816501),- ("yearminute", -5.389071729816501)],- n = 158},+ -5.3981627015177525),+ ("yearminute", -5.3981627015177525)],+ n = 160}, koData =- ClassData{prior = -0.9297914190930576, unseen = -5.796057750765372,+ ClassData{prior = -0.9374250439481288, unseen = -5.796057750765372, likelihoods = HashMap.fromList [("since <time-of-day>by <time>", -4.406719247264253),@@ -996,6 +995,13 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [("", 0.0)], n = 15}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455,@@ -1301,11 +1307,11 @@ n = 18}}), ("hh:mm", Classifier{okData =- ClassData{prior = -2.7398974188114388e-2,- unseen = -3.6375861597263857,- likelihoods = HashMap.fromList [("", 0.0)], n = 36},+ ClassData{prior = -2.6668247082161294e-2,+ unseen = -3.6635616461296463,+ likelihoods = HashMap.fromList [("", 0.0)], n = 37}, koData =- ClassData{prior = -3.6109179126442243,+ ClassData{prior = -3.6375861597263857, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("quarter of an hour",
Duckling/Ranking/Classifiers/IT_XX.hs view
@@ -65,24 +65,24 @@ likelihoods = HashMap.fromList [], n = 0}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.5649493574615367,+ ClassData{prior = 0.0, unseen = -2.833213344056216, likelihoods = HashMap.fromList- [("at <time-of-day>", -1.0986122886681098),- ("hh(:|h)mm (time-of-day)", -1.791759469228055),- ("hour", -1.3862943611198906), ("minute", -1.3862943611198906)],- n = 4},+ [("at <time-of-day>", -1.1631508098056809),+ ("hh(:|h)mm (time-of-day)", -1.6739764335716716),+ ("hour", -1.6739764335716716), ("minute", -1.1631508098056809)],+ n = 6}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.5347411751625487,+ ClassData{prior = -0.5421761536500667, unseen = -5.0689042022202315, likelihoods = HashMap.fromList [("", 0.0)], n = 157}, koData =- ClassData{prior = -0.8814567791985226, unseen = -4.727387818712341,- likelihoods = HashMap.fromList [("", 0.0)], n = 111}}),+ ClassData{prior = -0.8710341402860342, unseen = -4.74493212836325,+ likelihoods = HashMap.fromList [("", 0.0)], n = 113}}), ("the day before yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906,@@ -121,34 +121,34 @@ likelihoods = HashMap.fromList [], n = 0}}), ("at <time-of-day>", Classifier{okData =- ClassData{prior = -0.6234672599219555, unseen = -4.770684624465665,+ ClassData{prior = -0.616186139423817, unseen = -4.804021044733257, likelihoods = HashMap.fromList- [("midnight", -4.069026754237811),- ("<time> timezone", -4.069026754237811),- ("<integer 0 12> del <part of day>", -2.68273239311792),- ("<integer> (latent time-of-day)", -1.5432981099295555),- ("hh(:|h)mm (time-of-day)", -2.1231166051824975),- ("<hour-of-day> and <relative minutes>", -4.069026754237811),- ("noon", -3.6635616461296463),+ [("midnight", -4.102643365036796),+ ("<time> timezone", -3.6971782569286313),+ ("<integer 0 12> del <part of day>", -2.716349003916905),+ ("<integer> (latent time-of-day)", -1.5769147207285403),+ ("hh(:|h)mm (time-of-day)", -2.087740344494531),+ ("<hour-of-day> and <relative minutes>", -4.102643365036796),+ ("noon", -3.6971782569286313), ("hh <relative-minutes> del pomeriggio(time-of-day)",- -3.6635616461296463),- ("<hour-of-day> minus quart", -4.069026754237811),- ("hour", -1.2068258733083426), ("minute", -1.8177349556313156)],- n = 52},+ -3.6971782569286313),+ ("<hour-of-day> minus quart", -4.102643365036796),+ ("hour", -1.2404424841073274), ("minute", -1.751268107873318)],+ n = 54}, koData =- ClassData{prior = -0.768048488733063, unseen = -4.6443908991413725,+ ClassData{prior = -0.7765287894989963, unseen = -4.663439094112067, likelihoods = HashMap.fromList- [("una", -3.9415818076696905),- ("<integer> (latent time-of-day)", -1.0512100497735257),- ("hh(:|h)mm (time-of-day)", -2.842969519001581),- ("<hour-of-day> and <relative minutes>", -3.536116699561526),+ [("una", -3.960813169597578),+ ("<integer> (latent time-of-day)", -1.043042437513299),+ ("hh(:|h)mm (time-of-day)", -2.8622008809294686),+ ("<hour-of-day> and <relative minutes>", -3.5553480614894135), ("<hour-of-day> minus <integer> (as relative minutes)",- -3.9415818076696905),- ("noon", -3.9415818076696905), ("hour", -0.99714282850325),- ("minute", -2.4375044108934163)],- n = 45}}),+ -3.960813169597578),+ ("noon", -3.960813169597578), ("hour", -0.9903987040278769),+ ("minute", -2.456735772821304)],+ n = 46}}), ("ann\233e (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.833213344056216,@@ -176,8 +176,8 @@ n = 15}}), ("Giovedi", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.044522437723423,- likelihoods = HashMap.fromList [("", 0.0)], n = 19},+ ClassData{prior = 0.0, unseen = -3.0910424533583156,+ likelihoods = HashMap.fromList [("", 0.0)], n = 20}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -553,7 +553,7 @@ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("<integer> (latent time-of-day)", Classifier{okData =- ClassData{prior = -1.0822184788924334,+ ClassData{prior = -1.0904489780289488, unseen = -3.8066624897703196, likelihoods = HashMap.fromList@@ -561,15 +561,15 @@ ("number (0..19)", -1.3862943611198906)], n = 41}, koData =- ClassData{prior = -0.41376391092285947,- unseen = -4.430816798843313,+ ClassData{prior = -0.40957189006081784,+ unseen = -4.442651256490317, likelihoods = HashMap.fromList- [("integer (numeric)", -0.34130316389087856),+ [("integer (numeric)", -0.3364722366212129), ("number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)",- -3.3202283191284883),- ("number (0..19)", -1.374318170073175)],- n = 80}}),+ -3.332204510175204),+ ("number (0..19)", -1.3862943611198906)],+ n = 81}}), ("nth <time> of <time>", Classifier{okData = ClassData{prior = -0.4700036292457356, unseen = -2.833213344056216,@@ -714,11 +714,11 @@ likelihoods = HashMap.fromList [], n = 0}}), ("hh(:|h)mm (time-of-day)", Classifier{okData =- ClassData{prior = -0.13353139262452263,- unseen = -3.784189633918261,- likelihoods = HashMap.fromList [("", 0.0)], n = 42},+ ClassData{prior = -0.13062018241706422,+ unseen = -3.8066624897703196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 43}, koData =- ClassData{prior = -2.0794415416798357,+ ClassData{prior = -2.1000608288825715, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("", 0.0)], n = 6}}), ("EOY|End of year",@@ -899,6 +899,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}), ("afternoon", Classifier{okData = ClassData{prior = -0.6931471805599453,@@ -1450,194 +1457,195 @@ likelihoods = HashMap.fromList [], n = 0}}), ("two time tokens in a row", Classifier{okData =- ClassData{prior = -0.3402001067352274, unseen = -6.021023349349527,+ ClassData{prior = -0.3456466128972542, unseen = -6.030685260261263, likelihoods = HashMap.fromList- [("Lunedi<day-of-month> <named-month>", -4.919980925828125),+ [("Lunedi<day-of-month> <named-month>", -4.929666231562589), ("<datetime> - <datetime> (interval)Giovedi",- -5.32544603393629),+ -5.3351313396707525), ("intersect by \"di\", \"della\", \"del\"year (1000-2100 not latent)",- -4.919980925828125),- ("dayhour", -3.3105430133940246),- ("Febbraioyear (1000-2100 not latent)", -5.32544603393629),- ("Settembreat <time-of-day>", -4.632298853376344),- ("daymonth", -2.552857311696508),- ("<named-day> <day-of-month>Settembre", -4.22683374526818),+ -4.929666231562589),+ ("dayhour", -3.3202283191284883),+ ("Febbraioyear (1000-2100 not latent)", -5.3351313396707525),+ ("Settembreat <time-of-day>", -4.641984159110808),+ ("daymonth", -2.562542617430972),+ ("<named-day> <day-of-month>Settembre", -4.236519051002643), ("day of month (1st)intersect by \"di\", \"della\", \"del\"",- -4.632298853376344),- ("Ottobreyear (1000-2100 not latent)", -4.072683065440922),- ("monthyear", -3.1853798704400185),+ -4.641984159110808),+ ("Ottobreyear (1000-2100 not latent)", -4.082368371175385),+ ("monthyear", -3.195065176174482), ("day of month (1st)two time tokens in a row",- -4.22683374526818),+ -4.236519051002643), ("<ordinal> <cycle> of <time>year (1000-2100 not latent)",- -5.32544603393629),- ("christmasyear (1000-2100 not latent)", -4.919980925828125),+ -5.3351313396707525),+ ("christmasyear (1000-2100 not latent)", -4.929666231562589), ("<named-day> <day-of-month>two time tokens in a row",- -4.919980925828125),- ("tomorrowdopo <time>", -5.32544603393629),+ -4.929666231562589),+ ("tomorrowdopo <time>", -5.3351313396707525), ("Giovedidalle <time-of-day> alle <time-of-day> (interval)",- -4.919980925828125),+ -4.929666231562589), ("intersect by \"di\", \"della\", \"del\"<day-of-month> <named-month>",- -4.632298853376344),+ -4.641984159110808), ("two time tokens separated by `di`Settembre",- -4.632298853376344),- ("day of month (1st)Maggio", -5.32544603393629),+ -4.641984159110808),+ ("day of month (1st)Maggio", -5.3351313396707525), ("tra il <integer> e il <integer> (interval)Luglio",- -4.919980925828125),- ("day of month (1st)Mercoledi", -5.32544603393629),- ("dayday", -2.7604966764747525),- ("il <time>year (1000-2100 not latent)", -5.32544603393629),- ("Giovediat <time-of-day>", -5.32544603393629),- ("entro il <integer>Aprile", -5.32544603393629),- ("dayyear", -3.1853798704400185),+ -4.929666231562589),+ ("day of month (1st)Mercoledi", -5.3351313396707525),+ ("dayday", -2.770181982209216),+ ("il <time>year (1000-2100 not latent)", -5.3351313396707525),+ ("Giovediat <time-of-day>", -4.929666231562589),+ ("entro il <integer>Aprile", -5.3351313396707525),+ ("dayyear", -3.195065176174482), ("tomorrowdalle <time-of-day> alle <time-of-day> (interval)",- -5.32544603393629),+ -5.3351313396707525), ("hh(:|h)mm (time-of-day)two time tokens in a row",- -4.919980925828125),- ("dd[/-]mmat <time-of-day>", -5.32544603393629),+ -4.929666231562589),+ ("dd[/-]mmat <time-of-day>", -5.3351313396707525), ("dal <integer> al <integer> (interval)Luglio",- -4.919980925828125),- ("tomorrowdopo le <time-of-day>", -4.919980925828125),- ("monthminute", -4.632298853376344),- ("minutemonth", -3.821368637160015),- ("il <time>Marzo", -5.32544603393629),- ("<named-day> <day-of-month>Febbraio", -4.409155302062135),+ -4.929666231562589),+ ("tomorrowdopo le <time-of-day>", -4.929666231562589),+ ("monthminute", -4.641984159110808),+ ("minutemonth", -3.8310539428944788),+ ("il <time>Marzo", -5.3351313396707525),+ ("<named-day> <day-of-month>Febbraio", -4.418840607796598), ("hh(:|h)mm (time-of-day)<named-day> <day-of-month>",- -5.32544603393629),- ("Settembreyear (1000-2100 not latent)", -4.919980925828125),- ("Mercoledi<day-of-month> <named-month>", -5.32544603393629),+ -5.3351313396707525),+ ("Settembreyear (1000-2100 not latent)", -4.929666231562589),+ ("Mercoledi<day-of-month> <named-month>", -5.3351313396707525), ("il <day-of-month> <named-month>at <time-of-day>",- -5.32544603393629),- ("day of month (1st)Marzo", -4.919980925828125),- ("Sabato<day-of-month> <named-month>", -5.32544603393629),- ("il <day-of-month>Settembre", -5.32544603393629),- ("Venerdi<day-of-month> <named-month>", -4.409155302062135),+ -5.3351313396707525),+ ("day of month (1st)Marzo", -4.929666231562589),+ ("Sabato<day-of-month> <named-month>", -5.3351313396707525),+ ("il <day-of-month>Settembre", -5.3351313396707525),+ ("Venerdi<day-of-month> <named-month>", -4.418840607796598), ("<day-of-month> <named-month>at <time-of-day>",- -4.632298853376344),+ -4.641984159110808), ("il <day-of-month> <named-month>year (1000-2100 not latent)",- -5.32544603393629),+ -5.3351313396707525), ("two time tokens separated by `di`year (1000-2100 not latent)",- -4.919980925828125),+ -4.929666231562589), ("last <cycle> of <time>year (1000-2100 not latent)",- -4.632298853376344),+ -4.641984159110808), ("day of month (1st)two time tokens separated by `di`",- -4.632298853376344),- ("il <day-of-month>Febbraio", -4.409155302062135),- ("Gennaioyear (1000-2100 not latent)", -4.632298853376344),- ("the day after tomorrowat <time-of-day>", -4.919980925828125),+ -4.641984159110808),+ ("il <day-of-month>Febbraio", -4.418840607796598),+ ("Gennaioyear (1000-2100 not latent)", -4.641984159110808),+ ("the day after tomorrowat <time-of-day>", -4.929666231562589), ("two time tokens in a rowyear (1000-2100 not latent)",- -4.632298853376344),+ -4.641984159110808), ("il <day-of-month>two time tokens in a row",- -4.919980925828125),- ("Giovedientro <time>", -5.32544603393629),+ -4.929666231562589),+ ("Giovedientro <time>", -5.3351313396707525), ("at <time-of-day>two time tokens in a row",- -4.919980925828125),- ("dayminute", -2.927550761137919),- ("Venerditwo time tokens in a row", -4.919980925828125),- ("two time tokens in a rowat <time-of-day>", -4.22683374526818),- ("minuteday", -3.1282214566000697),+ -4.929666231562589),+ ("dayminute", -2.8502246898827526),+ ("Venerditwo time tokens in a row", -4.929666231562589),+ ("two time tokens in a rowat <time-of-day>",+ -4.236519051002643),+ ("minuteday", -3.137906762334534), ("two time tokens separated by `di`<day-of-month> <named-month>",- -4.632298853376344),- ("il <time>at <time-of-day>", -5.32544603393629),- ("Sabatoat <time-of-day>", -5.32544603393629),+ -4.641984159110808),+ ("il <time>at <time-of-day>", -5.3351313396707525),+ ("Sabatoat <time-of-day>", -5.3351313396707525), ("intersect by \"di\", \"della\", \"del\"Settembre",- -4.632298853376344),- ("Domenica<day-of-month> <named-month>", -5.32544603393629),+ -4.641984159110808),+ ("Domenica<day-of-month> <named-month>", -5.3351313396707525), ("last <day-of-week> of <time>year (1000-2100 not latent)",- -5.32544603393629),- ("immacolata concezioneat <time-of-day>", -5.32544603393629),+ -5.3351313396707525),+ ("immacolata concezioneat <time-of-day>", -5.3351313396707525), ("at <time-of-day><named-day> <day-of-month>",- -5.32544603393629),- ("day of month (1st)Martedi", -4.409155302062135),- ("at <time-of-day>Venerdi", -5.32544603393629),- ("weekyear", -4.919980925828125),- ("Giovedi<time> timezone", -5.32544603393629),+ -5.3351313396707525),+ ("day of month (1st)Martedi", -4.418840607796598),+ ("at <time-of-day>Venerdi", -5.3351313396707525),+ ("weekyear", -4.929666231562589),+ ("Giovedi<time> timezone", -4.929666231562589), ("Gioveditra il <datetime> e il <datetime> (interval)",- -4.919980925828125),- ("two time tokens in a rowSettembre", -4.919980925828125),- ("tomorrowat <time-of-day>", -5.32544603393629),+ -4.929666231562589),+ ("two time tokens in a rowSettembre", -4.929666231562589),+ ("tomorrowat <time-of-day>", -5.3351313396707525), ("two time tokens in a row<day-of-month> <named-month>",- -4.919980925828125),- ("Giovedientro le <time-of-day>", -5.32544603393629),+ -4.929666231562589),+ ("Giovedientro le <time-of-day>", -5.3351313396707525), ("two time tokens in a rowin <named-month>",- -4.632298853376344),- ("Dicembreyear (1000-2100 not latent)", -4.632298853376344),- ("Marzoyear (1000-2100 not latent)", -5.32544603393629),- ("Martediin <named-month>", -4.632298853376344),+ -4.641984159110808),+ ("Dicembreyear (1000-2100 not latent)", -4.641984159110808),+ ("Marzoyear (1000-2100 not latent)", -5.3351313396707525),+ ("Martediin <named-month>", -4.641984159110808), ("the day after tomorrowentro le <time-of-day>",- -5.32544603393629),+ -5.3351313396707525), ("<day-of-month> <named-month>year (1000-2100 not latent)",- -4.919980925828125),+ -4.929666231562589), ("commemorazione dei defuntiat <time-of-day>",- -5.32544603393629),- ("il <day-of-month>Marzo", -5.32544603393629),- ("hh(:|h)mm (time-of-day)Venerdi", -5.32544603393629)],- n = 153},+ -5.3351313396707525),+ ("il <day-of-month>Marzo", -5.3351313396707525),+ ("hh(:|h)mm (time-of-day)Venerdi", -5.3351313396707525)],+ n = 155}, koData =- ClassData{prior = -1.2435036430825712, unseen = -5.438079308923196,+ ClassData{prior = -1.230188646456829, unseen = -5.455321115357702, likelihoods = HashMap.fromList [("at <time-of-day>prossimi <unit-of-duration>",- -4.33510971488613),+ -4.352426164897591), ("intersect by \"di\", \"della\", \"del\"year (1000-2100 not latent)",- -4.047427642434349),- ("dayhour", -2.214846178686039),- ("Settembreat <time-of-day>", -3.8242840911201395),- ("daymonth", -4.740574822994295),- ("monthday", -4.33510971488613),- ("monthyear", -4.740574822994295),- ("Luglio<day-of-month> <named-month>", -4.740574822994295),+ -4.06474409244581),+ ("dayhour", -2.1929419155442185),+ ("Settembreat <time-of-day>", -3.8416005411316),+ ("daymonth", -4.757891273005756),+ ("monthday", -4.352426164897591),+ ("monthyear", -4.757891273005756),+ ("Luglio<day-of-month> <named-month>", -4.757891273005756), ("<named-day> <day-of-month>two time tokens in a row",- -4.047427642434349),+ -4.06474409244581), ("Giovedidalle <time-of-day> alle <time-of-day> (interval)",- -4.740574822994295),- ("monthhour", -3.6419625343261846),- ("hourmonth", -4.33510971488613),- ("dayday", -4.740574822994295),- ("Febbraiothis <part-of-day>", -4.33510971488613),- ("Giovediat <time-of-day>", -4.33510971488613),+ -4.757891273005756),+ ("monthhour", -3.6592789843376456),+ ("hourmonth", -4.352426164897591),+ ("dayday", -4.757891273005756),+ ("Febbraiothis <part-of-day>", -4.352426164897591),+ ("Giovediat <time-of-day>", -3.8416005411316), ("tra il <datetime> e il <datetime> (interval)Luglio",- -4.33510971488613),- ("dayyear", -3.2364974262180204),+ -4.352426164897591),+ ("dayyear", -3.253813876229481), ("tomorrowdalle <time-of-day> alle <time-of-day> (interval)",- -4.740574822994295),+ -4.757891273005756), ("<hour-of-day> and <relative minutes>Luglio",- -4.740574822994295),- ("tomorrowstanotte", -4.740574822994295),- ("dd[/-]mmat <time-of-day>", -4.740574822994295),- ("il <day-of-month>Luglio", -4.740574822994295),- ("tomorrowdopo le <time-of-day>", -4.33510971488613),- ("monthminute", -4.740574822994295),- ("minutemonth", -4.740574822994295),+ -4.757891273005756),+ ("tomorrowstanotte", -4.757891273005756),+ ("dd[/-]mmat <time-of-day>", -4.757891273005756),+ ("il <day-of-month>Luglio", -4.757891273005756),+ ("tomorrowdopo le <time-of-day>", -4.352426164897591),+ ("monthminute", -4.757891273005756),+ ("minutemonth", -4.757891273005756), ("il <day-of-month> <named-month>at <time-of-day>",- -4.740574822994295),- ("dopo <time>at <time-of-day>", -4.740574822994295),+ -4.757891273005756),+ ("dopo <time>at <time-of-day>", -4.757891273005756), ("<day-of-month> <named-month>at <time-of-day>",- -3.8242840911201395),- ("weekmonth", -4.33510971488613),+ -3.8416005411316),+ ("weekmonth", -4.352426164897591), ("two time tokens separated by `di`year (1000-2100 not latent)",- -4.047427642434349),- ("hourweek", -4.33510971488613),- ("the day after tomorrowat <time-of-day>", -4.740574822994295),+ -4.06474409244581),+ ("hourweek", -4.352426164897591),+ ("the day after tomorrowat <time-of-day>", -4.757891273005756), ("il <day-of-month>two time tokens in a row",- -4.740574822994295),- ("Agosto<day-of-month> <named-month>", -4.740574822994295),- ("dayminute", -2.9488153537662396),- ("Venerditwo time tokens in a row", -4.047427642434349),+ -4.757891273005756),+ ("Agosto<day-of-month> <named-month>", -4.757891273005756),+ ("dayminute", -2.886089096104164),+ ("Venerditwo time tokens in a row", -4.06474409244581), ("two time tokens in a rowat <time-of-day>",- -3.3542804618744038),- ("minuteday", -4.740574822994295),- ("il <time>at <time-of-day>", -4.740574822994295),- ("Giovedidopo le <time-of-day>", -4.047427642434349),- ("the <cycle> of <time>Ottobre", -4.33510971488613),+ -3.371596911885865),+ ("minuteday", -4.757891273005756),+ ("il <time>at <time-of-day>", -4.757891273005756),+ ("Giovedidopo le <time-of-day>", -4.06474409244581),+ ("the <cycle> of <time>Ottobre", -4.352426164897591), ("Gioveditra il <datetime> e il <datetime> (interval)",- -4.740574822994295),- ("tomorrowat <time-of-day>", -4.740574822994295),- ("Martedidopo <time>", -4.740574822994295),- ("dopo <time>year (1000-2100 not latent)", -4.33510971488613),- ("hh(:|h)mm (time-of-day)Giovedi", -4.740574822994295),- ("Marzoyear (1000-2100 not latent)", -4.740574822994295)],- n = 62}}),+ -4.757891273005756),+ ("tomorrowat <time-of-day>", -4.757891273005756),+ ("Martedidopo <time>", -4.757891273005756),+ ("dopo <time>year (1000-2100 not latent)", -4.352426164897591),+ ("hh(:|h)mm (time-of-day)Giovedi", -4.757891273005756),+ ("Marzoyear (1000-2100 not latent)", -4.757891273005756)],+ n = 64}}), ("heure (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Classifiers/KO_XX.hs view
@@ -23,23 +23,23 @@ = HashMap.fromList [("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,+ ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList- [("<time-of-day> am|pm", -1.3862943611198906),- ("hh:mm", -1.3862943611198906), ("hour", -1.3862943611198906),- ("minute", -1.3862943611198906)],- n = 2},+ [("<time-of-day> am|pm", -1.6094379124341003),+ ("hh:mm", -1.2039728043259361), ("hour", -1.6094379124341003),+ ("minute", -1.2039728043259361)],+ n = 3}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.4267425065554492, unseen = -4.836281906951478,+ ClassData{prior = -0.4372138064227446, unseen = -4.836281906951478, likelihoods = HashMap.fromList [("", 0.0)], n = 124}, koData =- ClassData{prior = -1.0573693301340605, unseen = -4.219507705176107,- likelihoods = HashMap.fromList [("", 0.0)], n = 66}}),+ ClassData{prior = -1.0379876668516748, unseen = -4.248495242049359,+ likelihoods = HashMap.fromList [("", 0.0)], n = 68}}), ("lunch", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906,@@ -173,24 +173,11 @@ likelihoods = HashMap.fromList [], n = 0}}), ("integer - TYPE 1", Classifier{okData =- ClassData{prior = -1.8523840910444898, unseen = -3.258096538021482,+ ClassData{prior = -1.8588987720656835, unseen = -3.258096538021482, likelihoods = HashMap.fromList [("", 0.0)], n = 24}, koData =- ClassData{prior = -0.17062551703076334,- unseen = -4.875197323201151,- likelihoods = HashMap.fromList [("", 0.0)], n = 129}}),- ("fraction",- Classifier{okData =- ClassData{prior = -infinity, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods =- HashMap.fromList- [("integer (numeric)integer (numeric)", -0.6359887667199967),- ("fractioninteger (numeric)", -1.4469189829363254),- ("integer (numeric)fraction", -1.4469189829363254)],- n = 14}}),+ ClassData{prior = -0.1694181519580468, unseen = -4.882801922586371,+ likelihoods = HashMap.fromList [("", 0.0)], n = 130}}), ("hour (grain)", Classifier{okData = ClassData{prior = -1.241713132308783, unseen = -2.70805020110221,@@ -201,135 +188,136 @@ likelihoods = HashMap.fromList [("", 0.0)], n = 32}}), ("intersect", Classifier{okData =- ClassData{prior = -0.4488272263819219, unseen = -5.958424693029782,+ ClassData{prior = -0.45041649597043076,+ unseen = -5.963579343618447, likelihoods = HashMap.fromList [("intersect<hour-of-day> <integer> (as relative minutes)",- -5.262690188904886),- ("intersectday-of-week", -4.164077900236776),- ("year<time> \47560\51648\47561 <cycle>", -4.857225080796721),- ("next <cycle>day-of-week", -4.3463994570307305),- ("dayhour", -2.0240117367405053),- ("monthday", -2.4294768448486694),- ("yearhour", -3.5579420966664603),- ("<time> <part-of-day>time-of-day", -4.3463994570307305),- ("intersectam|pm <time-of-day>", -3.065465611568666),- ("next <cycle><time-of-day> am|pm", -5.262690188904886),- ("next <cycle>am|pm <time-of-day>", -4.857225080796721),- ("yearintersect", -2.96010509591084),+ -5.267858159063328),+ ("intersectday-of-week", -4.169245870395218),+ ("year<time> \47560\51648\47561 <cycle>", -4.862393050955164),+ ("next <cycle>day-of-week", -4.351567427189173),+ ("dayhour", -2.0291797068989474),+ ("monthday", -2.434644815007112),+ ("yearhour", -3.563110066824903),+ ("<time> <part-of-day>time-of-day", -4.351567427189173),+ ("intersectam|pm <time-of-day>", -3.0706335817271087),+ ("next <cycle><time-of-day> am|pm", -5.267858159063328),+ ("next <cycle>am|pm <time-of-day>", -4.862393050955164),+ ("yearintersect", -2.9652730660692823), ("day-of-week<datetime> - <datetime> (interval)",- -4.3463994570307305),+ -4.351567427189173), ("day-of-week<time-of-day> - <time-of-day> (interval)",- -4.3463994570307305),+ -4.351567427189173), ("monthday with korean number - \51068\51068..\44396\51068",- -5.262690188904886),- ("dayday-of-week", -4.3463994570307305),- ("this <cycle>day-of-week", -4.857225080796721),- ("day-of-week<time> timezone", -5.262690188904886),- ("monthhour", -3.5579420966664603),- ("mm/ddam|pm <time-of-day>", -4.56954300834494),- ("todayam|pm <time-of-day>", -4.56954300834494),+ -5.267858159063328),+ ("dayday-of-week", -4.351567427189173),+ ("this <cycle>day-of-week", -4.862393050955164),+ ("day-of-week<time> timezone", -4.862393050955164),+ ("monthhour", -3.563110066824903),+ ("mm/ddam|pm <time-of-day>", -4.574710978503383),+ ("todayam|pm <time-of-day>", -4.574710978503383), ("the day before yesterday - \50634\44536\51228am|pm <time-of-day>",- -4.3463994570307305),- ("dayday", -3.653252276470785),- ("hourhour", -3.7586127921286114),- ("year<time> <ordinal> <cycle>", -5.262690188904886),- ("month<datetime> - <datetime> (interval)", -4.857225080796721),- ("dayam|pm <time-of-day>", -5.262690188904886),- ("day-of-weekam|pm <time-of-day>", -4.56954300834494),- ("time-of-dayafter <time-of-day>", -5.262690188904886),- ("monthminute", -4.857225080796721),- ("hourminute", -4.56954300834494),- ("intersectday", -4.164077900236776),- ("am|pm <time-of-day>after <time-of-day>", -5.262690188904886),- ("last <cycle>day-of-week", -4.56954300834494),- ("month<time> <part-of-day>", -4.857225080796721),- ("yearmonth", -3.122624025408615),- ("dayminute", -3.653252276470785),- ("today<date>\50640", -5.262690188904886),- ("mm/dd<date>\50640", -5.262690188904886),+ -4.351567427189173),+ ("dayday", -3.6584202466292277),+ ("hourhour", -3.763780762287054),+ ("year<time> <ordinal> <cycle>", -5.267858159063328),+ ("month<datetime> - <datetime> (interval)", -4.862393050955164),+ ("dayam|pm <time-of-day>", -5.267858159063328),+ ("day-of-weekam|pm <time-of-day>", -4.574710978503383),+ ("time-of-dayafter <time-of-day>", -5.267858159063328),+ ("monthminute", -4.862393050955164),+ ("hourminute", -4.574710978503383),+ ("intersectday", -4.169245870395218),+ ("am|pm <time-of-day>after <time-of-day>", -5.267858159063328),+ ("last <cycle>day-of-week", -4.574710978503383),+ ("month<time> <part-of-day>", -4.862393050955164),+ ("yearmonth", -3.1277919955670574),+ ("dayminute", -3.563110066824903),+ ("today<date>\50640", -5.267858159063328),+ ("mm/dd<date>\50640", -5.267858159063328), ("<hour-of-day> <integer> (as relative minutes)seconds",- -5.262690188904886),- ("<time> <part-of-day><date>\50640", -4.857225080796721),- ("monthintersect", -3.653252276470785),+ -5.267858159063328),+ ("<time> <part-of-day><date>\50640", -4.862393050955164),+ ("monthintersect", -3.6584202466292277), ("year<time> \47560\51648\47561 <day-of-week>",- -5.262690188904886),- ("intersectintersect", -3.4709307196768306),- ("weekday", -3.653252276470785),+ -5.267858159063328),+ ("intersectintersect", -3.4760986898352733),+ ("weekday", -3.6584202466292277), ("intersectday with korean number - \51068\51068..\44396\51068",- -4.857225080796721),- ("yearday", -3.4709307196768306),- ("day-of-weekhh:mm", -4.857225080796721),- ("yearweek", -4.857225080796721),- ("minutesecond", -5.262690188904886),+ -4.862393050955164),+ ("yearday", -3.4760986898352733),+ ("day-of-weekhh:mm", -4.862393050955164),+ ("yearweek", -4.862393050955164),+ ("minutesecond", -5.267858159063328), ("<time> <part-of-day><hour-of-day> <integer> (as relative minutes)",- -4.857225080796721),- ("tomorrow<time-of-day> am|pm", -5.262690188904886),- ("tomorrowam|pm <time-of-day>", -4.857225080796721),- ("dayintersect", -4.857225080796721),- ("day-of-weektime-of-day", -5.262690188904886)],- n = 173},+ -4.862393050955164),+ ("tomorrow<time-of-day> am|pm", -5.267858159063328),+ ("tomorrowam|pm <time-of-day>", -4.862393050955164),+ ("dayintersect", -4.862393050955164),+ ("day-of-weektime-of-day", -5.267858159063328)],+ n = 174}, koData =- ClassData{prior = -1.017151342209129, unseen = -5.594711379601839,+ ClassData{prior = -1.0143519450503697, unseen = -5.602118820879701, likelihoods = HashMap.fromList- [("year<time> \47560\51648\47561 <cycle>", -4.897839799950911),- ("day-of-weekintersect", -4.897839799950911),- ("dayhour", -2.2587824703356527),- ("daymonth", -4.492374691842747),- ("monthday", -3.1060803307228566),- ("yearhour", -3.1930917077124863),- ("<time> <part-of-day>time-of-day", -3.7992275112828016),- ("houryear", -4.204692619390966),- ("day-of-weekafter <time-of-day>", -4.897839799950911),+ [("year<time> \47560\51648\47561 <cycle>", -4.90527477843843),+ ("day-of-weekintersect", -4.90527477843843),+ ("dayhour", -2.2662174488231708),+ ("daymonth", -4.499809670330265),+ ("monthday", -3.1135153092103742),+ ("yearhour", -3.200526686200004),+ ("<time> <part-of-day>time-of-day", -3.8066624897703196),+ ("houryear", -4.212127597878484),+ ("day-of-weekafter <time-of-day>", -4.90527477843843), ("after <time-of-day>by <time> - \44620\51648",- -4.897839799950911),- ("intersectam|pm <time-of-day>", -4.492374691842747),- ("intersect<time> <part-of-day>", -3.9815490680767565),- ("yearintersect", -3.02603762304932),+ -4.90527477843843),+ ("intersectam|pm <time-of-day>", -4.499809670330265),+ ("intersect<time> <part-of-day>", -3.9889840465642745),+ ("yearintersect", -3.033472601536838), ("day-of-week<time-of-day> - <time-of-day> (interval)",- -3.9815490680767565),- ("intersectmonth", -4.897839799950911),- ("time-of-day<duration> ago", -4.897839799950911),- ("this <cycle>day-of-week", -4.492374691842747),- ("intersecttime-of-day", -4.492374691842747),- ("monthhour", -3.02603762304932),- ("intersectlast <time>", -4.897839799950911),- ("dayday", -3.9815490680767565),- ("hourhour", -2.951929650895598),+ -3.9889840465642745),+ ("intersectmonth", -4.90527477843843),+ ("time-of-day<duration> ago", -4.90527477843843),+ ("this <cycle>day-of-week", -4.499809670330265),+ ("intersecttime-of-day", -4.499809670330265),+ ("monthhour", -3.033472601536838),+ ("intersectlast <time>", -4.90527477843843),+ ("dayday", -3.9889840465642745),+ ("hourhour", -2.959364629383116), ("month<datetime> - <datetime> (interval)",- -3.9815490680767565),- ("dayam|pm <time-of-day>", -4.492374691842747),- ("day-of-weekam|pm <time-of-day>", -4.897839799950911),- ("hourminute", -4.204692619390966),+ -3.9889840465642745),+ ("dayam|pm <time-of-day>", -4.499809670330265),+ ("day-of-weekam|pm <time-of-day>", -4.90527477843843),+ ("hourminute", -4.212127597878484), ("<time-of-day> - <time-of-day> (interval)last <time>",- -3.9815490680767565),- ("intersectday", -4.492374691842747),- ("<datetime> - <datetime> (interval)day", -3.9815490680767565),- ("month<time> <part-of-day>", -4.492374691842747),- ("yearmonth", -4.492374691842747),- ("dayminute", -4.204692619390966),- ("<time> <part-of-day><date>\50640", -4.897839799950911),- ("last <time>time-of-day", -4.897839799950911),- ("monthintersect", -3.288401887516811),- ("hoursecond", -4.897839799950911),- ("year<time> <part-of-day>", -4.492374691842747),- ("intersectintersect", -3.6450768314555435),- ("weekday", -4.492374691842747),+ -3.9889840465642745),+ ("intersectday", -4.499809670330265),+ ("<datetime> - <datetime> (interval)day", -3.9889840465642745),+ ("month<time> <part-of-day>", -4.499809670330265),+ ("yearmonth", -4.499809670330265),+ ("dayminute", -3.9889840465642745),+ ("<time> <part-of-day><date>\50640", -4.90527477843843),+ ("last <time>time-of-day", -4.90527477843843),+ ("monthintersect", -3.295836866004329),+ ("hoursecond", -4.90527477843843),+ ("year<time> <part-of-day>", -4.499809670330265),+ ("intersectintersect", -3.6525118099430616),+ ("weekday", -4.499809670330265), ("intersectday with korean number - \51068\51068..\44396\51068",- -4.492374691842747),- ("day<time> <part-of-day>", -4.897839799950911),- ("yearday", -3.7992275112828016),- ("day-of-weekhh:mm", -4.897839799950911),+ -4.499809670330265),+ ("day<time> <part-of-day>", -4.90527477843843),+ ("yearday", -3.8066624897703196),+ ("day-of-weekhh:mm", -4.499809670330265), ("<time-of-day> - <time-of-day> (interval)time-of-day",- -4.492374691842747),- ("intersectafter <time-of-day>", -3.3937624031746374),+ -4.499809670330265),+ ("intersectafter <time-of-day>", -3.4011973816621555), ("<time> <part-of-day><hour-of-day> <integer> (as relative minutes)",- -4.492374691842747),- ("dayintersect", -4.897839799950911),- ("mm/ddafter <time-of-day>", -4.897839799950911),- ("todayafter <time-of-day>", -4.897839799950911)],- n = 98}}),+ -4.499809670330265),+ ("dayintersect", -4.90527477843843),+ ("mm/ddafter <time-of-day>", -4.90527477843843),+ ("todayafter <time-of-day>", -4.90527477843843)],+ n = 99}}), ("season", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906,@@ -607,6 +595,13 @@ [("hour (grain)", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 7}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("afternoon", Classifier{okData = ClassData{prior = -0.2876820724517809,@@ -701,24 +696,24 @@ n = 50}}), ("year", Classifier{okData =- ClassData{prior = -1.006804739414987, unseen = -3.295836866004329,+ ClassData{prior = -0.9873866535578852, unseen = -3.258096538021482, likelihoods = HashMap.fromList- [("integer (numeric)", -0.3677247801253174),- ("intersect 2 numbers", -2.5649493574615367),- ("integer (21..99) - TYPE 2", -2.5649493574615367)],+ [("integer (numeric)", -0.3285040669720361),+ ("intersect 2 numbers", -2.5257286443082556),+ ("integer (21..99) - TYPE 2", -2.5257286443082556)], n = 19}, koData =- ClassData{prior = -0.4547361571149472, unseen = -3.713572066704308,+ ClassData{prior = -0.46608972992459924,+ unseen = -3.6635616461296463, likelihoods = HashMap.fromList- [("integer (numeric)", -0.5533852381847867),- ("intersect 2 numbers", -2.3025850929940455),- ("integer - TYPE 1", -2.0794415416798357),- ("fraction", -2.995732273553991),- ("integer - TYPE 1: powers of ten", -2.5902671654458267),- ("compose by multiplication", -2.995732273553991)],- n = 33}}),+ [("integer (numeric)", -0.5020919437972361),+ ("intersect 2 numbers", -2.2512917986064953),+ ("integer - TYPE 1", -2.0281482472922856),+ ("integer - TYPE 1: powers of ten", -2.538973871058276),+ ("compose by multiplication", -2.9444389791664407)],+ n = 32}}), ("<integer> <unit-of-duration>", Classifier{okData = ClassData{prior = -1.5955488002734333,@@ -834,11 +829,11 @@ n = 11}}), ("hh:mm", Classifier{okData =- ClassData{prior = -4.445176257083381e-2,- unseen = -3.1780538303479458,- likelihoods = HashMap.fromList [("", 0.0)], n = 22},+ ClassData{prior = -4.255961441879589e-2,+ unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23}, koData =- ClassData{prior = -3.1354942159291497,+ ClassData{prior = -3.1780538303479458, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("integer - TYPE 1: powers of ten",@@ -1426,8 +1421,8 @@ likelihoods = HashMap.fromList [], n = 0}}), ("day-of-week", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.713572066704308,- likelihoods = HashMap.fromList [("", 0.0)], n = 39},+ ClassData{prior = 0.0, unseen = -3.7376696182833684,+ likelihoods = HashMap.fromList [("", 0.0)], n = 40}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),
Duckling/Ranking/Classifiers/NB_XX.hs view
@@ -30,24 +30,25 @@ likelihoods = HashMap.fromList [], n = 0}}), ("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.0910424533583156,+ ClassData{prior = 0.0, unseen = -3.4657359027997265, likelihoods = HashMap.fromList- [("at <time-of-day>", -1.4350845252893227),- ("<time-of-day> o'clock", -2.3513752571634776),- ("hh:mm", -1.6582280766035324), ("hour", -1.6582280766035324),- ("minute", -1.252762968495368)],- n = 8},+ [("at <time-of-day>", -1.488077055429833),+ ("<time-of-day> o'clock", -2.740840023925201),+ ("hh:mm", -1.488077055429833), ("hour", -2.0476928433652555),+ ("minute", -1.0360919316867756)],+ n = 13}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.7546493803177391, unseen = -4.912654885736052,+ ClassData{prior = -0.7754834672205811, unseen = -4.912654885736052, likelihoods = HashMap.fromList [("", 0.0)], n = 134}, koData =- ClassData{prior = -0.6352093434537263, unseen = -5.030437921392435,- likelihoods = HashMap.fromList [("", 0.0)], n = 151}}),+ ClassData{prior = -0.6170774618231845,+ unseen = -5.0689042022202315,+ likelihoods = HashMap.fromList [("", 0.0)], n = 157}}), ("the day before yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -115,24 +116,25 @@ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("at <time-of-day>", Classifier{okData =- ClassData{prior = -0.2657031657330056, unseen = -4.605170185988091,+ ClassData{prior = -0.2776317365982795, unseen = -4.68213122712422, likelihoods = HashMap.fromList- [("<time> timezone", -3.4965075614664802),- ("time-of-day (latent)", -1.2278240201481159),+ [("<time> timezone", -3.0633909220278057),+ ("time-of-day (latent)", -1.3055330044754323), ("relative minutes after|past <integer> (hour-of-day)",- -3.4965075614664802),- ("hh:mm", -2.030170492673053),- ("<time-of-day> sharp", -3.4965075614664802),- ("hour", -1.1611326456494435), ("minute", -1.7619065060783738)],- n = 46},+ -3.5742165457937967),+ ("hh:mm", -1.9647786333596962),+ ("<time-of-day> sharp", -3.5742165457937967),+ ("hour", -1.23884162997676), ("minute", -1.6283063967384832)],+ n = 50}, koData =- ClassData{prior = -1.455287232606842, unseen = -3.58351893845611,+ ClassData{prior = -1.4170660197866443,+ unseen = -3.6888794541139363, likelihoods = HashMap.fromList- [("time-of-day (latent)", -0.8472978603872037),- ("hour", -0.8472978603872037)],- n = 14}}),+ [("time-of-day (latent)", -0.8303483020734304),+ ("hour", -0.8303483020734304)],+ n = 16}}), ("absorption of , after named day", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1354942159291497,@@ -302,142 +304,145 @@ likelihoods = HashMap.fromList [], n = 0}}), ("intersect", Classifier{okData =- ClassData{prior = -0.4103550934023561, unseen = -5.877735781779639,+ ClassData{prior = -0.42187813774949445,+ unseen = -5.905361848054571, likelihoods = HashMap.fromList- [("Onsdagthis <cycle>", -5.181783550292085),- ("Torsdag<time> timezone", -4.48863636973214),+ [("Onsdagthis <cycle>", -5.209486152841421),+ ("Torsdag<time> timezone", -3.956723184346053), ("<datetime> - <datetime> (interval)on <date>",- -4.083171261623976),+ -4.110873864173311), ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.083171261623976),- ("hourday", -5.181783550292085), ("dayhour", -2.93049175168559),- ("daymonth", -2.93049175168559),- ("monthyear", -3.1023420086122493),+ -4.110873864173311),+ ("hourday", -5.209486152841421),+ ("dayhour", -2.9581943542349256),+ ("daymonth", -2.9581943542349256),+ ("monthyear", -3.130044611161585), ("Torsdagbetween <time-of-day> and <time-of-day> (interval)",- -5.181783550292085),- ("Mandagon <date>", -4.77631844218392),- ("intersecthh:mm", -5.181783550292085),+ -5.209486152841421),+ ("Mandagon <date>", -4.804021044733257),+ ("intersecthh:mm", -5.209486152841421), ("Torsdagbetween <datetime> and <datetime> (interval)",- -5.181783550292085),- ("Torsdagat <time-of-day>", -4.77631844218392),- ("on <date>Februar", -4.77631844218392),- ("Marsyear", -4.77631844218392),+ -5.209486152841421),+ ("Torsdagat <time-of-day>", -4.293195420967266),+ ("on <date>Februar", -4.804021044733257),+ ("Marsyear", -4.804021044733257), ("intersect by \"of\", \"from\", \"'s\"year",- -4.77631844218392),- ("Oktoberyear", -3.572345637857985),+ -4.804021044733257),+ ("Oktoberyear", -3.6000482404073204), ("Torsdagfrom <time-of-day> - <time-of-day> (interval)",- -4.77631844218392),+ -4.804021044733257), ("Torsdagfrom <datetime> - <datetime> (interval)",- -4.77631844218392),- ("Mandagintersect", -4.77631844218392),- ("last <day-of-week> of <time>year", -4.77631844218392),- ("intersectFebruar", -4.77631844218392),- ("todayat <time-of-day>", -4.77631844218392),- ("dayday", -3.0417173867958143),- ("dd/mmat <time-of-day>", -4.26549281841793),- ("intersect by \",\"hh:mm", -4.26549281841793),- ("dayyear", -3.3099813733904937),- ("tomorrow<time-of-day> sharp", -4.77631844218392),+ -4.804021044733257),+ ("Mandagintersect", -4.804021044733257),+ ("last <day-of-week> of <time>year", -4.804021044733257),+ ("intersectFebruar", -4.804021044733257),+ ("todayat <time-of-day>", -4.804021044733257),+ ("dayday", -3.06941998934515),+ ("dd/mmat <time-of-day>", -4.293195420967266),+ ("intersect by \",\"hh:mm", -4.293195420967266),+ ("dayyear", -3.3376839759398296),+ ("tomorrow<time-of-day> sharp", -4.804021044733257), ("<day-of-month>(ordinal) <named-month>year",- -4.77631844218392),+ -4.804021044733257), ("Onsdag<named-month> <day-of-month> (non ordinal)",- -5.181783550292085),- ("Onsdagthis <time>", -4.48863636973214),+ -5.209486152841421),+ ("Onsdagthis <time>", -4.516338972281476), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -4.083171261623976),- ("tomorrowuntil <time-of-day>", -4.77631844218392),+ -4.110873864173311),+ ("tomorrowuntil <time-of-day>", -4.804021044733257), ("S\248ndag<day-of-month> (non ordinal) <named-month>",- -5.181783550292085),+ -5.209486152841421), ("absorption of , after named day<day-of-month> (non ordinal) <named-month>",- -4.48863636973214),- ("the <day-of-month> (ordinal)Februar", -4.77631844218392),- ("after <time-of-day>at <time-of-day>", -4.77631844218392),- ("the <day-of-month> (ordinal)Mars", -4.26549281841793),+ -4.516338972281476),+ ("the <day-of-month> (ordinal)Februar", -4.804021044733257),+ ("after <time-of-day>at <time-of-day>", -4.804021044733257),+ ("the <day-of-month> (ordinal)Mars", -4.293195420967266), ("intersect by \",\"<day-of-month> (non ordinal) <named-month>",- -4.77631844218392),- ("Mandagthe <day-of-month> (ordinal)", -5.181783550292085),- ("Mandagthis <cycle>", -5.181783550292085),- ("Tirsdagthis <time>", -4.77631844218392),- ("tomorrowafter <time-of-day>", -4.77631844218392),- ("Tirsdagthis <cycle>", -5.181783550292085),+ -4.804021044733257),+ ("Mandagthe <day-of-month> (ordinal)", -5.209486152841421),+ ("Mandagthis <cycle>", -5.209486152841421),+ ("Tirsdagthis <time>", -4.804021044733257),+ ("tomorrowafter <time-of-day>", -4.804021044733257),+ ("Tirsdagthis <cycle>", -5.209486152841421), ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.26549281841793),- ("dayminute", -2.8304082931286074),+ -4.293195420967266),+ ("dayminute", -2.644536795379884), ("from <datetime> - <datetime> (interval)on <date>",- -4.48863636973214),- ("on <date>Mars", -4.26549281841793),- ("<ordinal> <cycle> of <time>year", -4.77631844218392),- ("minuteday", -2.5790938648477013),+ -4.516338972281476),+ ("on <date>Mars", -4.293195420967266),+ ("<ordinal> <cycle> of <time>year", -4.804021044733257),+ ("minuteday", -2.606796467397037), ("absorption of , after named dayintersect",- -5.181783550292085),- ("yearhh:mm", -5.181783550292085),- ("Onsdagnext <cycle>", -5.181783550292085),+ -5.209486152841421),+ ("yearhh:mm", -5.209486152841421),+ ("Onsdagnext <cycle>", -5.209486152841421), ("absorption of , after named dayintersect by \",\"",- -4.77631844218392),- ("dd/mmyear", -4.77631844218392),- ("Septemberyear", -4.26549281841793),- ("at <time-of-day>on <date>", -5.181783550292085),+ -4.804021044733257),+ ("dd/mmyear", -4.804021044733257),+ ("Septemberyear", -4.293195420967266),+ ("at <time-of-day>on <date>", -5.209486152841421), ("between <time-of-day> and <time-of-day> (interval)on <date>",- -5.181783550292085),+ -5.209486152841421), ("between <datetime> and <datetime> (interval)on <date>",- -5.181783550292085),- ("dayweek", -4.083171261623976),- ("weekyear", -4.26549281841793),- ("hh:mmtomorrow", -4.48863636973214),- ("tomorrowat <time-of-day>", -3.929020581796717),- ("at <time-of-day>tomorrow", -4.77631844218392),- ("last <cycle> of <time>year", -4.26549281841793),+ -5.209486152841421),+ ("dayweek", -4.110873864173311),+ ("weekyear", -4.293195420967266),+ ("hh:mmtomorrow", -4.516338972281476),+ ("tomorrowat <time-of-day>", -3.956723184346053),+ ("at <time-of-day>tomorrow", -4.804021044733257),+ ("last <cycle> of <time>year", -4.293195420967266), ("<day-of-month> (non ordinal) <named-month>year",- -4.77631844218392),- ("yearminute", -5.181783550292085)],- n = 136},+ -4.804021044733257),+ ("yearminute", -5.209486152841421)],+ n = 141}, koData =- ClassData{prior = -1.0889034745411488, unseen = -5.407171771460119,+ ClassData{prior = -1.066572934923493, unseen = -5.4510384535657, likelihoods = HashMap.fromList- [("dayhour", -3.20545280453606), ("daymonth", -2.10684051586795),- ("monthday", -3.7932394694381792),- ("monthyear", -3.7932394694381792),+ [("dayhour", -3.0488420988679397),+ ("daymonth", -2.1509005056619808),+ ("monthday", -3.8372994592322094),+ ("monthyear", -3.8372994592322094), ("Torsdagbetween <time-of-day> and <time-of-day> (interval)",- -4.709530201312334),- ("Mandagon <date>", -4.709530201312334),+ -4.7535901911063645),+ ("Mandagon <date>", -4.7535901911063645), ("Torsdagbetween <datetime> and <datetime> (interval)",- -4.709530201312334),- ("Torsdagat <time-of-day>", -3.7932394694381792),- ("absorption of , after named dayFebruar", -4.0163830207523885),- ("Marsyear", -4.0163830207523885),+ -4.7535901911063645),+ ("Torsdagat <time-of-day>", -3.2495127943300903),+ ("absorption of , after named dayFebruar", -4.060443010546419),+ ("Marsyear", -4.060443010546419), ("intersect by \"of\", \"from\", \"'s\"year",- -3.4567672328169663),+ -3.5008272226109964), ("Torsdagfrom <time-of-day> - <time-of-day> (interval)",- -4.709530201312334),+ -4.7535901911063645), ("Torsdagfrom <datetime> - <datetime> (interval)",- -4.709530201312334),- ("OnsdagFebruar", -4.709530201312334),- ("absorption of , after named dayJuli", -4.304065093204169),- ("dd/mmat <time-of-day>", -3.7932394694381792),- ("hourhour", -3.4567672328169663),- ("dayyear", -3.4567672328169663),- ("Onsdagthis <time>", -3.4567672328169663),+ -4.7535901911063645),+ ("OnsdagFebruar", -4.7535901911063645),+ ("absorption of , after named dayJuli", -4.3481250829982),+ ("dd/mmat <time-of-day>", -3.8372994592322094),+ ("hourhour", -3.5008272226109964),+ ("dayyear", -3.5008272226109964),+ ("Onsdagthis <time>", -3.5008272226109964), ("in|during the <part-of-day>until <time-of-day>",- -4.304065093204169),- ("Aprilyear", -4.709530201312334),- ("Tirsdagthis <time>", -3.7932394694381792),+ -4.3481250829982),+ ("Aprilyear", -4.7535901911063645),+ ("Tirsdagthis <time>", -3.8372994592322094), ("<named-month> <day-of-month> (non ordinal)August",- -3.7932394694381792),- ("until <time-of-day>on <date>", -4.709530201312334),+ -3.8372994592322094),+ ("until <time-of-day>on <date>", -4.7535901911063645), ("August<day-of-month> (non ordinal) <named-month>",- -3.7932394694381792),- ("Torsdaghh:mm", -4.709530201312334),- ("dayminute", -3.3232358401924436),- ("minuteday", -3.20545280453606),- ("hh:mmon <date>", -3.3232358401924436),- ("this <part-of-day>until <time-of-day>", -4.304065093204169),- ("S\248ndagthis <time>", -3.7932394694381792),- ("tomorrownoon", -4.709530201312334),- ("this <time>until <time-of-day>", -4.304065093204169),- ("Mandagthis <time>", -4.304065093204169)],- n = 69}}),+ -3.8372994592322094),+ ("Torsdaghh:mm", -4.3481250829982),+ ("dayminute", -3.0488420988679397),+ ("minuteday", -3.2495127943300903),+ ("hh:mmon <date>", -3.367295829986474),+ ("this <part-of-day>until <time-of-day>", -4.3481250829982),+ ("S\248ndagthis <time>", -3.8372994592322094),+ ("tomorrownoon", -4.7535901911063645),+ ("this <time>until <time-of-day>", -4.3481250829982),+ ("Mandagthis <time>", -4.3481250829982)],+ n = 74}}), ("<ordinal> <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.890371757896165,@@ -597,8 +602,8 @@ likelihoods = HashMap.fromList [], n = 0}}), ("Torsdag", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -823,6 +828,13 @@ koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}), ("afternoon", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -901,17 +913,17 @@ likelihoods = HashMap.fromList [], n = 0}}), ("time-of-day (latent)", Classifier{okData =- ClassData{prior = -0.9057086225436182, unseen = -3.713572066704308,+ ClassData{prior = -0.9267620317414506, unseen = -3.713572066704308, likelihoods = HashMap.fromList [("integer (numeric)", -2.5317807984289897e-2)], n = 38}, koData =- ClassData{prior = -0.5179430915348547, unseen = -4.07753744390572,+ ClassData{prior = -0.503905180921417, unseen = -4.110873864173311, likelihoods = HashMap.fromList- [("integer (numeric)", -0.27625337662815824),- ("integer (0..19)", -1.4213856809311607)],- n = 56}}),+ [("integer (numeric)", -0.2657031657330056),+ ("integer (0..19)", -1.455287232606842)],+ n = 58}}), ("year", Classifier{okData = ClassData{prior = -0.1431008436406733, unseen = -3.332204510175204,@@ -1090,11 +1102,11 @@ n = 5}}), ("hh:mm", Classifier{okData =- ClassData{prior = -2.197890671877523e-2,- unseen = -3.8501476017100584,- likelihoods = HashMap.fromList [("", 0.0)], n = 45},+ ClassData{prior = -2.0619287202735703e-2,+ unseen = -3.912023005428146,+ likelihoods = HashMap.fromList [("", 0.0)], n = 48}, koData =- ClassData{prior = -3.828641396489095, unseen = -1.0986122886681098,+ ClassData{prior = -3.891820298110627, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("quarter after|past <integer> (hour-of-day)", Classifier{okData =
+ Duckling/Ranking/Classifiers/NE_XX.hs view
@@ -0,0 +1,22 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++-----------------------------------------------------------------+-- Auto-generated by regenClassifiers+--+-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING+-- @generated+-----------------------------------------------------------------+{-# LANGUAGE OverloadedStrings #-}+module Duckling.Ranking.Classifiers.NE_XX (classifiers) where+import Data.String+import Prelude+import qualified Data.HashMap.Strict as HashMap+import Duckling.Ranking.Types++classifiers :: Classifiers+classifiers = HashMap.fromList []
Duckling/Ranking/Classifiers/NL_XX.hs view
@@ -19,4 +19,1834 @@ import Duckling.Ranking.Types classifiers :: Classifiers-classifiers = HashMap.fromList []+classifiers+ = HashMap.fromList+ [("<time> timezone",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -1.6094379124341003),+ ("hh:mm", -1.2039728043259361), ("hour", -1.6094379124341003),+ ("minute", -1.2039728043259361)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (numeric)",+ Classifier{okData =+ ClassData{prior = -0.7090205297162354, unseen = -4.844187086458591,+ likelihoods = HashMap.fromList [("", 0.0)], n = 125},+ koData =+ ClassData{prior = -0.6775218626568645, unseen = -4.875197323201151,+ likelihoods = HashMap.fromList [("", 0.0)], n = 129}}),+ ("exactly <time-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -1.252762968495368),+ ("time-of-day (latent)", -1.252762968495368),+ ("hour", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> hence|ago",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("week", -1.55814461804655), ("day", -1.845826690498331),+ ("year", -2.2512917986064953),+ ("<integer> <unit-of-duration>", -0.8649974374866046),+ ("month", -2.2512917986064953)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Father's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("thursday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (20..90)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time> <part-of-day>",+ Classifier{okData =+ ClassData{prior = -0.15415067982725836,+ unseen = -5.030437921392435,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clockmorning", -3.077970371790963),+ ("until <time-of-day>afternoon", -4.330733340286331),+ ("dayhour", -2.9444389791664407),+ ("todayevening", -4.330733340286331),+ ("on <date>evening", -3.925268232178167),+ ("thursdaymorning", -4.330733340286331),+ ("intersectevening", -2.384823191231018),+ ("tomorrowafternoon", -3.925268232178167),+ ("half to|till|before <integer> (hour-of-day)afternoon",+ -4.330733340286331),+ ("hourhour", -1.1737329191362178),+ ("<day-of-month> (non ordinal) <named-month>morning",+ -3.925268232178167),+ ("at <time-of-day>afternoon", -4.330733340286331),+ ("todayafternoon", -4.330733340286331),+ ("<time-of-day> o'clockafternoon", -3.2321210516182215),+ ("<time-of-day> o'clocknight", -4.330733340286331),+ ("until <time-of-day>morning", -3.925268232178167),+ ("minutehour", -2.9444389791664407),+ ("<time-of-day> am|pmmorning", -3.925268232178167),+ ("hh:mmmorning", -3.925268232178167),+ ("about <time-of-day>evening", -4.330733340286331),+ ("<time-of-day> o'clockevening", -3.6375861597263857),+ ("<hour-of-day> <integer> (as relative minutes)afternoon",+ -3.925268232178167),+ ("intersectmorning", -3.077970371790963),+ ("about <time-of-day>afternoon", -4.330733340286331),+ ("hh:mmafternoon", -4.330733340286331),+ ("on <date>morning", -3.925268232178167),+ ("at <time-of-day>morning", -4.330733340286331)],+ n = 60},+ koData =+ ClassData{prior = -1.9459101490553135, unseen = -3.970291913552122,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clockmorning", -3.258096538021482),+ ("yearhour", -3.258096538021482),+ ("intersectevening", -2.5649493574615367),+ ("monthhour", -2.8526314299133175),+ ("hourhour", -1.8718021769015913),+ ("year (latent)afternoon", -3.258096538021482),+ ("Februarymorning", -2.8526314299133175),+ ("<time-of-day> o'clockevening", -3.258096538021482),+ ("time-of-day (latent)afternoon", -2.8526314299133175)],+ n = 10}}),+ ("dd/mm",+ Classifier{okData =+ ClassData{prior = -0.4307829160924542, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -1.0498221244986778,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}),+ ("today",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("at <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.19237189264745613, unseen = -4.31748811353631,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -1.739115735742633),+ ("half to|till|before <integer> (hour-of-day)",+ -3.6109179126442243),+ ("about <time-of-day>", -2.6946271807700692),+ ("time-of-day (latent)", -1.906169820405799),+ ("hh:mm", -2.512305623976115), ("hour", -1.0082282271998406),+ ("minute", -2.2246235515243336),+ ("<hour-of-day> <integer> (as relative minutes)",+ -3.6109179126442243)],+ n = 33},+ koData =+ ClassData{prior = -1.742969305058623, unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -2.3978952727983707),+ ("time-of-day (latent)", -1.1451323043030026),+ ("hour", -1.0116009116784799)],+ n = 7}}),+ ("absorption of , after named day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("wednesday", -2.2512917986064953),+ ("monday", -1.845826690498331), ("friday", -1.55814461804655),+ ("day", -0.8649974374866046), ("sunday", -2.2512917986064953)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("September",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on <date>",+ Classifier{okData =+ ClassData{prior = -0.19845093872383832,+ unseen = -4.574710978503383,+ likelihoods =+ HashMap.fromList+ [("thursday", -3.1780538303479458),+ ("<time> <part-of-day>", -2.9549102790337356),+ ("dd/mm", -2.9549102790337356),+ ("saturday", -3.871201010907891),+ ("intersect", -1.4733057381095205),+ ("<day-of-month>(ordinal) <named-month>", -3.871201010907891),+ ("friday", -3.871201010907891), ("day", -1.7311348474116202),+ ("hh:mm", -3.871201010907891),+ ("<day-of-month> (ordinal)", -3.1780538303479458),+ ("hour", -1.7311348474116202),+ ("<datetime> - <datetime> (interval)", -3.871201010907891),+ ("<day-of-month> (non ordinal) <named-month>",+ -3.871201010907891),+ ("minute", -2.2617630984737906)],+ n = 41},+ koData =+ ClassData{prior = -1.7147984280919266,+ unseen = -3.4965075614664802,+ likelihoods =+ HashMap.fromList+ [("intersect", -1.2685113254635072), ("day", -2.772588722239781),+ ("<day-of-month> (ordinal)", -2.772588722239781),+ ("hour", -2.367123614131617), ("minute", -1.5198257537444133)],+ n = 9}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -5.5569851154810765e-2,+ unseen = -3.6109179126442243,+ likelihoods = HashMap.fromList [("", 0.0)], n = 35},+ koData =+ ClassData{prior = -2.917770732084279, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("between <time-of-day> and <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0986122886681098),+ ("hh:mmhh:mm", -1.0986122886681098)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.0986122886681098),+ ("minutehour", -1.0986122886681098)],+ n = 1}}),+ ("between <datetime> and <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.0986122886681098),+ ("hh:mmhh:mm", -1.0986122886681098)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453,+ unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.0986122886681098),+ ("minutehour", -1.0986122886681098)],+ n = 1}}),+ ("October",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("month (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("on a named-day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("thursday", -1.252762968495368),+ ("saturday", -1.9459101490553135),+ ("friday", -1.9459101490553135), ("day", -0.8472978603872037)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday/tomorrow night",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("wednesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> o'clock",+ Classifier{okData =+ ClassData{prior = -0.14107859825990549,+ unseen = -4.955827057601261,+ likelihoods =+ HashMap.fromList+ [("exactly <time-of-day>", -4.255612709818223),+ ("at <time-of-day>", -2.3838105329166317),+ ("about <time-of-day>", -2.8693183486983322),+ ("time-of-day (latent)", -1.259880436264232),+ ("quarter after|past <integer> (hour-of-day)",+ -4.255612709818223),+ ("until <time-of-day>", -3.339321977944068),+ ("hour", -0.7591051483517427), ("minute", -4.255612709818223),+ ("after <time-of-day>", -3.8501476017100584)],+ n = 66},+ koData =+ ClassData{prior = -2.0281482472922856,+ unseen = -3.4011973816621555,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -2.6741486494265287),+ ("time-of-day (latent)", -1.0647107369924282),+ ("hour", -0.9694005571881036)],+ n = 10}}),+ ("<integer> + '\"",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.40546510810816444),+ ("integer (0..19)", -1.0986122886681098)],+ n = 4}}),+ ("July",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hour (grain)",+ Classifier{okData =+ ClassData{prior = -1.9661128563728327,+ unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -0.15082288973458366,+ unseen = -3.8066624897703196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 43}}),+ ("<ordinal> quarter",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..19th)quarter (grain)", -0.916290731874155),+ ("quarter", -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)quarter (grain)", -0.916290731874155),+ ("quarter", -0.916290731874155)],+ n = 1}}),+ ("saturday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("May",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("intersect",+ Classifier{okData =+ ClassData{prior = -0.30818059400012193,+ unseen = -6.182084906716631,+ likelihoods =+ HashMap.fromList+ [("last <cycle>sunday", -5.486869473092628),+ ("hourday", -4.388257184424518),+ ("on a named-day<day-of-month> (non ordinal) <named-month>",+ -5.486869473092628),+ ("<day-of-month> (non ordinal) <named-month><time-of-day> o'clock",+ -5.486869473092628),+ ("dayhour", -2.3513752571634776),+ ("daymonth", -4.570578741218473),+ ("next <cycle>friday", -5.486869473092628),+ ("monthyear", -3.8774315606585272),+ ("friday<day-of-month> (non ordinal) <named-month>",+ -5.081404364984463),+ ("yearhour", -5.486869473092628),+ ("intersect<time-of-day> o'clock", -4.793722292532682),+ ("tuesdaythis <cycle>", -5.486869473092628),+ ("christmasyear", -5.486869473092628),+ ("on a named-dayfrom <time-of-day> - <time-of-day> (interval)",+ -5.081404364984463),+ ("saturday<time-of-day> o'clock", -5.486869473092628),+ ("absorption of , after named daydd/mm/yyyy",+ -5.081404364984463),+ ("<time-of-day> am|pmintersect", -5.486869473092628),+ ("intersect<time> <part-of-day>", -4.793722292532682),+ ("Marchyear", -5.486869473092628),+ ("saturdayat <time-of-day>", -5.081404364984463),+ ("saturday<time> <part-of-day>", -5.081404364984463),+ ("dd/mm<time-of-day> o'clock", -5.486869473092628),+ ("on a named-dayat <time-of-day>", -4.793722292532682),+ ("today<time-of-day> o'clock", -5.486869473092628),+ ("at <time-of-day>on a named-day", -5.486869473092628),+ ("on a named-daybetween <datetime> and <datetime> (interval)",+ -5.486869473092628),+ ("intersect by ','year", -5.486869473092628),+ ("on <date><time-of-day> o'clock", -4.793722292532682),+ ("next <cycle>monday", -5.486869473092628),+ ("on a named-daybetween <time-of-day> and <time-of-day> (interval)",+ -5.486869473092628),+ ("exactly <time-of-day>tomorrow", -5.486869473092628),+ ("on a named-day<time> <part-of-day>", -5.081404364984463),+ ("monthhour", -4.570578741218473),+ ("on <date>between <datetime> and <datetime> (interval)",+ -5.486869473092628),+ ("last <day-of-week> of <time>year", -5.486869473092628),+ ("on a named-day<time-of-day> o'clock", -5.486869473092628),+ ("next <cycle>March", -5.486869473092628),+ ("todayat <time-of-day>", -4.793722292532682),+ ("on <date>between <time-of-day> and <time-of-day> (interval)",+ -5.486869473092628),+ ("on <date>at <time-of-day>", -4.793722292532682),+ ("thursday<time> timezone", -5.081404364984463),+ ("on <date>about <time-of-day>", -4.793722292532682),+ ("dayday", -3.184284380098582),+ ("on <date><time> <part-of-day>", -4.570578741218473),+ ("dd/mmabout <time-of-day>", -5.081404364984463),+ ("<day-of-month> (ordinal)intersect", -5.486869473092628),+ ("hourhour", -4.388257184424518),+ ("saturday<day-of-month> (non ordinal) <named-month>",+ -5.486869473092628),+ ("thursdayat <time-of-day>", -5.486869473092628),+ ("today/tomorrow/yesterday afternoon<hour-of-day> <integer> (as relative minutes)",+ -5.081404364984463),+ ("intersect<day-of-month> (non ordinal) <named-month>",+ -4.388257184424518),+ ("dayyear", -3.4074279314127915),+ ("tuesdayafter <duration>", -5.486869473092628),+ ("tomorrow<time-of-day> o'clock", -5.486869473092628),+ ("<time-of-day> o'clocktomorrow", -4.793722292532682),+ ("<day-of-month> (non ordinal) <named-month>intersect",+ -5.486869473092628),+ ("thursdaybetween <time-of-day> and <time-of-day> (interval)",+ -5.486869473092628),+ ("thursdaybetween <datetime> and <datetime> (interval)",+ -5.486869473092628),+ ("<day-of-month>(ordinal) <named-month>year",+ -5.486869473092628),+ ("<day-of-month> (ordinal)tuesday", -5.486869473092628),+ ("hourminute", -4.793722292532682),+ ("thursdayhh:mm", -5.486869473092628),+ ("this <cycle>wednesday", -5.486869473092628),+ ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",+ -5.486869473092628),+ ("<day-of-month> (non ordinal) <named-month><time> <part-of-day>",+ -5.081404364984463),+ ("on <date><day-of-month> (non ordinal) <named-month>",+ -5.486869473092628),+ ("Aprilabout <time-of-day>", -5.486869473092628),+ ("thursdayfrom <datetime> - <datetime> (interval)",+ -5.486869473092628),+ ("<day-of-month> (ordinal)February", -5.486869473092628),+ ("thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.793722292532682),+ ("absorption of , after named day<day-of-month> (non ordinal) <named-month>",+ -4.570578741218473),+ ("today/tomorrow/yesterday evening<time-of-day> o'clock",+ -5.486869473092628),+ ("fridayintersect", -4.793722292532682),+ ("on <date><time-of-day> - <time-of-day> (interval)",+ -5.486869473092628),+ ("on <date><datetime> - <datetime> (interval)",+ -5.486869473092628),+ ("this <cycle>monday", -5.486869473092628),+ ("April<time-of-day> o'clock", -5.486869473092628),+ ("next <cycle>wednesday", -5.486869473092628),+ ("hh:mmintersect", -5.081404364984463),+ ("thursday<datetime> - <datetime> (interval)",+ -5.081404364984463),+ ("<day-of-month> (ordinal)July", -5.486869473092628),+ ("thursday<time-of-day> - <time-of-day> (interval)",+ -5.081404364984463),+ ("yearmonth", -5.486869473092628),+ ("at <time-of-day>intersect", -5.081404364984463),+ ("on <date>from <time-of-day> - <time-of-day> (interval)",+ -5.081404364984463),+ ("<time> <part-of-day>from <time-of-day> - <time-of-day> (interval)",+ -5.486869473092628),+ ("dayminute", -2.7788192719904172),+ ("<time> <part-of-day>from <datetime> - <datetime> (interval)",+ -5.486869473092628),+ ("intersectyear", -4.793722292532682),+ ("<time-of-day> am|pmsaturday", -5.486869473092628),+ ("<ordinal> <cycle> of <time>year", -5.486869473092628),+ ("minuteday", -3.289644895756408),+ ("absorption of , after named dayintersect",+ -5.486869473092628),+ ("Julyyear", -5.486869473092628),+ ("year<time-of-day> o'clock", -5.486869473092628),+ ("Octoberyear", -4.388257184424518),+ ("hh:mmon <date>", -5.081404364984463),+ ("today/tomorrow/yesterday afternoonat <time-of-day>",+ -5.486869473092628),+ ("dd/mmyear", -5.486869473092628),+ ("tuesdayin <duration>", -5.486869473092628),+ ("Septemberyear", -5.081404364984463),+ ("at <time-of-day>on <date>", -5.081404364984463),+ ("absorption of , after named daydd/mm", -5.081404364984463),+ ("intersectintersect", -5.486869473092628),+ ("hh:mmon a named-day", -5.486869473092628),+ ("weekday", -4.100575111972737),+ ("dayweek", -4.793722292532682),+ ("weekyear", -5.081404364984463),+ ("on <date>February", -5.486869473092628),+ ("<month> dd-dd (interval)year", -5.486869473092628),+ ("Dutch King dayyear", -5.486869473092628),+ ("tomorrowat <time-of-day>", -5.081404364984463),+ ("next <cycle>tuesday", -5.486869473092628),+ ("monday<day-of-month> (non ordinal) <named-month>",+ -5.486869473092628),+ ("at <time-of-day>tomorrow", -5.486869473092628),+ ("monday<named-month> <day-of-month> (non ordinal)",+ -5.486869473092628),+ ("<day-of-month> (non ordinal) <named-month>about <time-of-day>",+ -5.486869473092628),+ ("on a named-day<time-of-day> - <time-of-day> (interval)",+ -5.486869473092628),+ ("today/tomorrow/yesterday eveningat <time-of-day>",+ -5.081404364984463),+ ("last <cycle> of <time>year", -5.081404364984463),+ ("on a named-day<datetime> - <datetime> (interval)",+ -5.486869473092628),+ ("<day-of-month> (non ordinal) <named-month>year",+ -4.570578741218473),+ ("April<time> <part-of-day>", -5.081404364984463)],+ n = 169},+ koData =+ ClassData{prior = -1.327205444749884, unseen = -5.5909869805108565,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -4.894101477840304),+ ("dayhour", -3.5078071167204135),+ ("on a named-dayafter <time-of-day>", -4.894101477840304),+ ("July<day-of-month> (non ordinal) <named-month>",+ -4.894101477840304),+ ("daymonth", -3.977810745966149),+ ("monthday", -4.48863636973214),+ ("monthyear", -3.7954891891721947),+ ("yearhour", -4.894101477840304),+ ("intersect<time-of-day> o'clock", -4.894101477840304),+ ("on a named-dayfrom <time-of-day> - <time-of-day> (interval)",+ -4.48863636973214),+ ("<day-of-month> (ordinal)wednesday", -4.48863636973214),+ ("Julyintersect", -4.894101477840304),+ ("thursdayafter <time-of-day>", -4.894101477840304),+ ("intersect<time> <part-of-day>", -4.894101477840304),+ ("Marchyear", -4.894101477840304),+ ("<day-of-month> (ordinal)year", -4.894101477840304),+ ("on a named-dayat <time-of-day>", -4.894101477840304),+ ("on a named-daybetween <datetime> and <datetime> (interval)",+ -4.894101477840304),+ ("tuesdayafter <time-of-day>", -4.894101477840304),+ ("on a named-daybetween <time-of-day> and <time-of-day> (interval)",+ -4.894101477840304),+ ("monthhour", -3.977810745966149),+ ("on <date>between <datetime> and <datetime> (interval)",+ -4.894101477840304),+ ("todayat <time-of-day>", -4.894101477840304),+ ("on <date>between <time-of-day> and <time-of-day> (interval)",+ -4.894101477840304),+ ("on <date>at <time-of-day>", -4.894101477840304),+ ("on <date>about <time-of-day>", -4.894101477840304),+ ("dayday", -3.5078071167204135),+ ("hourhour", -4.200954297280359),+ ("thursdayat <time-of-day>", -4.894101477840304),+ ("dayyear", -4.200954297280359),+ ("thursdaybetween <time-of-day> and <time-of-day> (interval)",+ -4.894101477840304),+ ("thursdaybetween <datetime> and <datetime> (interval)",+ -4.894101477840304),+ ("<day-of-month> (ordinal)tuesday", -4.48863636973214),+ ("thursdayhh:mm", -4.48863636973214),+ ("Aprilabout <time-of-day>", -4.894101477840304),+ ("thursdayfrom <datetime> - <datetime> (interval)",+ -4.894101477840304),+ ("Aprilyear", -4.894101477840304),+ ("<day-of-month> (ordinal)sunday", -4.48863636973214),+ ("thursdayfrom <time-of-day> - <time-of-day> (interval)",+ -4.200954297280359),+ ("mondayFebruary", -4.894101477840304),+ ("on <date><time-of-day> - <time-of-day> (interval)",+ -4.894101477840304),+ ("yearuntil <time-of-day>", -4.48863636973214),+ ("thursday<time-of-day> - <time-of-day> (interval)",+ -4.48863636973214),+ ("<named-month> <day-of-month> (non ordinal)August",+ -4.894101477840304),+ ("August<day-of-month> (non ordinal) <named-month>",+ -4.894101477840304),+ ("on <date>from <time-of-day> - <time-of-day> (interval)",+ -4.48863636973214),+ ("dayminute", -2.409194828052304),+ ("thursday<part-of-day> of <time>", -4.894101477840304),+ ("Julyyear", -4.48863636973214),+ ("Octoberyear", -4.894101477840304),+ ("today/tomorrow/yesterday afternoonat <time-of-day>",+ -4.48863636973214),+ ("year<time> <part-of-day>", -4.894101477840304),+ ("today/tomorrow/yesterday afternoon<time-of-day> o'clock",+ -4.894101477840304),+ ("yearday", -4.48863636973214),+ ("absorption of , after named dayFebruary", -4.894101477840304),+ ("<day-of-month> (non ordinal) <named-month>about <time-of-day>",+ -4.894101477840304),+ ("after <time-of-day>year", -4.894101477840304),+ ("on a named-day<time-of-day> - <time-of-day> (interval)",+ -4.894101477840304),+ ("on <date>after <time-of-day>", -4.894101477840304),+ ("<day-of-month> (non ordinal) <named-month>year",+ -4.894101477840304)],+ n = 61}}),+ ("<ordinal> <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.7047480922384253),+ ("ordinals (first..19th)week (grain)intersect",+ -1.7047480922384253),+ ("weekmonth", -1.2992829841302609),+ ("ordinals (first..19th)day (grain)October",+ -1.7047480922384253),+ ("ordinals (first..19th)week (grain)October",+ -1.7047480922384253)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("year (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("dd/mm/yyyydd/mm", -2.2512917986064953),+ ("minuteminute", -2.2512917986064953),+ ("time-of-day (latent)time-of-day (latent)",+ -2.2512917986064953),+ ("hh:mmhh:mm", -2.2512917986064953),+ ("dayday", -1.845826690498331),+ ("dd/mm/yyyydd/mm/yyyy", -2.2512917986064953),+ ("hourhour", -2.2512917986064953)],+ n = 4},+ koData =+ ClassData{prior = -1.0986122886681098, unseen = -2.772588722239781,+ likelihoods =+ HashMap.fromList+ [("dayhour", -2.0149030205422647),+ ("hh:mmtime-of-day (latent)", -2.0149030205422647),+ ("minutehour", -2.0149030205422647),+ ("dd/mm/yyyytime-of-day (latent)", -2.0149030205422647)],+ n = 2}}),+ ("after tomorrow",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.295836866004329,+ likelihoods =+ HashMap.fromList+ [("week", -1.466337068793427),+ ("month (grain)", -2.5649493574615367),+ ("year (grain)", -2.159484249353372),+ ("week (grain)", -1.466337068793427),+ ("quarter", -2.5649493574615367), ("year", -2.159484249353372),+ ("month", -2.5649493574615367),+ ("quarter (grain)", -2.5649493574615367)],+ n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("from <time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.5596157879354228, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.252762968495368),+ ("time-of-day (latent)time-of-day (latent)",+ -1.9459101490553135),+ ("hh:mmhh:mm", -1.252762968495368),+ ("hourhour", -1.9459101490553135)],+ n = 4},+ koData =+ ClassData{prior = -0.8472978603872037,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.0986122886681098),+ ("minutehour", -1.0986122886681098)],+ n = 3}}),+ ("yyyy-mm-dd",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("year (latent)",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 1}}),+ ("couple",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("dd/mm/yyyy",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<ordinal> quarter <year>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("quarteryear", -0.6931471805599453),+ ("ordinal (digits)quarter (grain)year", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("today/tomorrow/yesterday morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("after lunch",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("monday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods = HashMap.fromList [("", 0.0)], n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter to|till|before <integer> (hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Allerheiligen",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> of <time>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.044522437723423,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.0498221244986778),+ ("ordinals (first..19th)sundayMay", -2.3025850929940455),+ ("ordinals (first..19th)tuesdayOctober", -2.3025850929940455),+ ("ordinals (first..19th)sundayJune", -2.3025850929940455),+ ("ordinals (first..19th)wednesdayintersect",+ -1.8971199848858813),+ ("ordinals (first..19th)tuesdayintersect",+ -2.3025850929940455)],+ n = 6},+ koData =+ ClassData{prior = -1.0986122886681098, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.252762968495368),+ ("ordinals (first..19th)wednesdayOctober", -1.540445040947149),+ ("ordinals (first..19th)tuesdaySeptember",+ -1.9459101490553135)],+ n = 3}}),+ ("the <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("April",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("today/tomorrow/yesterday evening",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.2188758248682006,+ likelihoods = HashMap.fromList [("", 0.0)], n = 23},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<part-of-day> of <time>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("hourhour", -0.6931471805599453),+ ("morningtime-of-day (latent)", -0.6931471805599453)],+ n = 1}}),+ ("valentine's day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("now",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number,number uur",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <part-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("afternoon", -1.252762968495368),+ ("hour", -0.8472978603872037), ("evening", -1.252762968495368)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -1.252762968495368),+ ("ordinal (digits)February", -1.252762968495368),+ ("month", -0.8472978603872037)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("numbers prefix with -, negative or minus",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -9.53101798043249e-2),+ ("fractional number", -2.3978952727983707)],+ n = 20}}),+ ("new year's eve",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tomorrow",+ Classifier{okData =+ ClassData{prior = -0.2876820724517809,+ unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -1.3862943611198906,+ unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),+ ("Mother's Day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("friday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half to|till|before <integer> (hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("half an hour",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}}),+ ("June",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("afternoon",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("February",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("week", -1.4816045409242156),+ ("year (grain)", -2.3978952727983707),+ ("week (grain)", -1.4816045409242156),+ ("day", -2.3978952727983707), ("quarter", -2.3978952727983707),+ ("year", -2.3978952727983707),+ ("quarter (grain)", -2.3978952727983707),+ ("day (grain)", -2.3978952727983707)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("minute (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("night",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("sunday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about <time-of-day>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.58351893845611,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -1.4759065198095778),+ ("time-of-day (latent)", -1.4759065198095778),+ ("quarter after|past <integer> (hour-of-day)",+ -2.8622008809294686),+ ("hour", -0.8472978603872037), ("minute", -2.8622008809294686)],+ n = 15},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("time-of-day (latent)",+ Classifier{okData =+ ClassData{prior = -0.3925617032722565, unseen = -4.02535169073515,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.24613306953890846),+ ("integer (0..19)", -1.6094379124341003)],+ n = 52},+ koData =+ ClassData{prior = -1.1249295969854831, unseen = -3.367295829986474,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)", -0.2411620568168881),+ ("integer (0..19)", -1.9459101490553135),+ ("couple", -2.639057329615259)],+ n = 25}}),+ ("year",+ Classifier{okData =+ ClassData{prior = -0.19105523676270922,+ unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 19},+ koData =+ ClassData{prior = -1.749199854809259, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 4}}),+ ("last <day-of-week> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods =+ HashMap.fromList+ [("daymonth", -0.916290731874155),+ ("sundayMarch", -1.6094379124341003),+ ("mondayMarch", -1.6094379124341003),+ ("sundayintersect", -1.6094379124341003)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> <unit-of-duration>",+ Classifier{okData =+ ClassData{prior = -1.207415148516909, unseen = -4.406719247264253,+ likelihoods =+ HashMap.fromList+ [("week", -2.315007612992603),+ ("integer (0..19)year (grain)", -3.295836866004329),+ ("integer (numeric)day (grain)", -2.7850112422383386),+ ("couplehour (grain)", -3.7013019741124937),+ ("integer (0..19)second (grain) ", -3.7013019741124937),+ ("integer (0..19)hour (grain)", -3.0081547935525483),+ ("second", -3.7013019741124937),+ ("integer (numeric)year (grain)", -3.7013019741124937),+ ("day", -2.7850112422383386), ("year", -3.0081547935525483),+ ("integer (numeric)week (grain)", -3.295836866004329),+ ("integer (0..19)month (grain)", -3.7013019741124937),+ ("hour", -2.6026896854443837), ("month", -3.7013019741124937),+ ("integer (numeric)minute (grain)", -2.4485390056171257),+ ("integer (0..19)minute (grain)", -3.295836866004329),+ ("minute", -2.1972245773362196),+ ("integer (numeric)hour (grain)", -3.7013019741124937),+ ("integer (0..19)week (grain)", -2.6026896854443837)],+ n = 29},+ koData =+ ClassData{prior = -0.3552032733272762, unseen = -5.075173815233827,+ likelihoods =+ HashMap.fromList+ [("week", -3.6826098411003407),+ ("integer (0..19)year (grain)", -3.970291913552122),+ ("integer (numeric)day (grain)", -3.6826098411003407),+ ("integer (0..19)second (grain) ", -4.375757021660286),+ ("integer (0..19)hour (grain)", -2.871679624884012),+ ("second", -3.6826098411003407),+ ("integer (numeric)second (grain) ", -3.970291913552122),+ ("integer (numeric)year (grain)", -3.970291913552122),+ ("day", -3.2771447329921766), ("year", -3.459466289786131),+ ("integer (numeric)week (grain)", -3.970291913552122),+ ("integer (0..19)month (grain)", -3.970291913552122),+ ("hour", -1.2402628057311365), ("month", -3.459466289786131),+ ("integer (numeric)minute (grain)", -3.970291913552122),+ ("integer (0..19)minute (grain)", -3.970291913552122),+ ("integer (numeric)month (grain)", -3.970291913552122),+ ("minute", -3.459466289786131),+ ("coupleday (grain)", -4.375757021660286),+ ("integer (numeric)hour (grain)", -1.4313180424938456),+ ("integer (0..19)day (grain)", -4.375757021660286),+ ("integer (0..19)week (grain)", -4.375757021660286)],+ n = 68}}),+ ("ordinals (first..19th)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> am|pm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("time-of-day (latent)", -1.7047480922384253),+ ("hh:mm", -1.7047480922384253),+ ("until <time-of-day>", -1.7047480922384253),+ ("hour", -1.2992829841302609), ("minute", -1.7047480922384253)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> after <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>christmas", -0.6931471805599453),+ ("yearday", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("today/tomorrow/yesterday afternoon",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("hh:mm",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.6888794541139363,+ likelihoods = HashMap.fromList [("", 0.0)], n = 38},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter after|past <integer> (hour-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -1.5040773967762742),+ ("time-of-day (latent)", -1.0986122886681098),+ ("hour", -0.8109302162163288)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<duration> before <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods =+ HashMap.fromList+ [("minuteminute", -1.3862943611198906),+ ("<integer> <unit-of-duration>time-of-day (latent)",+ -1.3862943611198906),+ ("minutehour", -1.3862943611198906),+ ("<integer> <unit-of-duration>half to|till|before <integer> (hour-of-day)",+ -1.3862943611198906)],+ n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("quarter of an hour",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("intersect by ','",+ Classifier{okData =+ ClassData{prior = -8.701137698962981e-2,+ unseen = -3.5553480614894135,+ likelihoods =+ HashMap.fromList+ [("wednesday<day-of-month> (non ordinal) <named-month>",+ -2.833213344056216),+ ("friday<day-of-month> (non ordinal) <named-month>",+ -2.833213344056216),+ ("dayday", -1.128465251817791), ("dayyear", -2.833213344056216),+ ("fridaydd/mm", -2.4277482359480516),+ ("fridaydd/mm/yyyy", -2.4277482359480516),+ ("fridayintersect", -2.833213344056216),+ ("sunday<named-month> <day-of-month> (non ordinal)",+ -2.833213344056216),+ ("monday<day-of-month> (non ordinal) <named-month>",+ -2.4277482359480516),+ ("<named-month> <day-of-month> (non ordinal)year",+ -2.833213344056216)],+ n = 11},+ koData =+ ClassData{prior = -2.4849066497880004, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("daymonth", -1.9459101490553135),+ ("sundayFebruary", -1.9459101490553135)],+ n = 1}}),+ ("second (grain) ",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("day", -0.8109302162163288), ("sunday", -1.5040773967762742),+ ("tuesday", -1.0986122886681098)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("EOM|End of month",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("March",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (ordinal)",+ Classifier{okData =+ ClassData{prior = -1.3862943611198906,+ unseen = -2.0794415416798357,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..19th)", -0.8472978603872037),+ ("ordinal (digits)", -0.5596157879354228)],+ n = 5},+ koData =+ ClassData{prior = -0.2876820724517809, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..19th)", -0.5306282510621704),+ ("ordinal (digits)", -0.8873031950009028)],+ n = 15}}),+ ("until <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.40546510810816444,+ unseen = -3.7376696182833684,+ likelihoods =+ HashMap.fromList+ [("<time> <part-of-day>", -2.327277705584417),+ ("<time-of-day> o'clock", -2.1041341542702074),+ ("time-of-day (latent)", -1.9218125974762528),+ ("<time-of-day> am|pm", -3.0204248861443626),+ ("EOM|End of month", -3.0204248861443626),+ ("hour", -1.074514737089049), ("month", -3.0204248861443626)],+ n = 14},+ koData =+ ClassData{prior = -1.0986122886681098, unseen = -3.332204510175204,+ likelihoods =+ HashMap.fromList+ [("dd/mm", -2.6026896854443837),+ ("dd/mm/yyyy", -2.6026896854443837),+ ("half to|till|before <integer> (hour-of-day)",+ -2.1972245773362196),+ ("day", -2.1972245773362196), ("hh:mm", -1.9095425048844386),+ ("minute", -1.5040773967762742)],+ n = 7}}),+ ("after <duration>",+ Classifier{okData =+ ClassData{prior = -0.10536051565782628,+ unseen = -3.258096538021482,+ likelihoods =+ HashMap.fromList+ [("week", -2.120263536200091), ("second", -2.5257286443082556),+ ("day", -2.5257286443082556),+ ("<integer> <unit-of-duration>", -1.0216512475319814),+ ("hour", -1.8325814637483102), ("minute", -2.120263536200091),+ ("<integer> kwartier", -2.5257286443082556)],+ n = 9},+ koData =+ ClassData{prior = -2.3025850929940455,+ unseen = -2.3025850929940455,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>", -1.5040773967762742),+ ("hour", -1.5040773967762742)],+ n = 1}}),+ ("evening",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("decimal number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ("<time-of-day> until",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("wednesday", -1.8718021769015913),+ ("monday", -1.466337068793427), ("day", -1.1786549963416462),+ ("hour", -1.8718021769015913),+ ("week-end", -1.8718021769015913)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("week", -1.540445040947149),+ ("month (grain)", -1.9459101490553135),+ ("year (grain)", -1.9459101490553135),+ ("week (grain)", -1.540445040947149),+ ("year", -1.9459101490553135), ("month", -1.9459101490553135)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("christmas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("new year's day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Sinterklaas",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods = HashMap.fromList [("", 0.0)], n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("next n <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.828641396489095,+ likelihoods =+ HashMap.fromList+ [("week", -3.1135153092103742),+ ("integer (0..19)year (grain)", -3.1135153092103742),+ ("integer (numeric)day (grain)", -3.1135153092103742),+ ("integer (0..19)second (grain) ", -3.1135153092103742),+ ("second", -3.1135153092103742),+ ("integer (numeric)year (grain)", -3.1135153092103742),+ ("day", -2.4203681286504293), ("year", -2.70805020110221),+ ("integer (numeric)week (grain)", -3.1135153092103742),+ ("integer (0..19)month (grain)", -3.1135153092103742),+ ("hour", -2.70805020110221), ("month", -2.70805020110221),+ ("integer (numeric)minute (grain)", -3.1135153092103742),+ ("integer (0..19)minute (grain)", -3.1135153092103742),+ ("integer (numeric)month (grain)", -3.1135153092103742),+ ("minute", -2.70805020110221),+ ("coupleday (grain)", -3.1135153092103742),+ ("integer (numeric)hour (grain)", -2.70805020110221),+ ("integer (0..19)day (grain)", -3.1135153092103742)],+ n = 13},+ koData =+ ClassData{prior = -infinity, unseen = -2.995732273553991,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tuesday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("about|exactly <duration>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1}}),+ ("halloween day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("by the end of <time>",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("half to|till|before <integer> (hour-of-day)",+ -1.7346010553881064),+ ("time-of-day (latent)", -1.4469189829363254),+ ("hh:mm", -2.1400661634962708), ("hour", -1.4469189829363254),+ ("minute", -1.4469189829363254)],+ n = 6}}),+ ("in <duration>",+ Classifier{okData =+ ClassData{prior = -4.652001563489282e-2,+ unseen = -3.970291913552122,+ likelihoods =+ HashMap.fromList+ [("week", -2.5649493574615367), ("second", -3.258096538021482),+ ("number,number uur", -3.258096538021482),+ ("day", -2.8526314299133175), ("year", -3.258096538021482),+ ("<integer> <unit-of-duration>", -1.006804739414987),+ ("hour", -2.159484249353372),+ ("<integer> and an half hour", -3.258096538021482),+ ("minute", -1.6486586255873816),+ ("<integer> kwartier", -3.258096538021482)],+ n = 21},+ koData =+ ClassData{prior = -3.0910424533583156,+ unseen = -2.5649493574615367,+ likelihoods =+ HashMap.fromList+ [("<integer> <unit-of-duration>", -1.791759469228055),+ ("hour", -1.791759469228055)],+ n = 1}}),+ ("<datetime> - <datetime> (interval)",+ Classifier{okData =+ ClassData{prior = -0.2076393647782445,+ unseen = -3.6375861597263857,+ likelihoods =+ HashMap.fromList+ [("intersecthh:mm", -2.001480000210124),+ ("on <date>hh:mm", -2.917770732084279),+ ("at <time-of-day>hh:mm", -2.917770732084279),+ ("minuteminute", -1.213022639845854),+ ("hh:mmhh:mm", -2.001480000210124),+ ("dayday", -2.2246235515243336),+ ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)",+ -2.512305623976115),+ ("dd/mmdd/mm", -2.917770732084279)],+ n = 13},+ koData =+ ClassData{prior = -1.6739764335716716, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("<named-month> <day-of-month> (non ordinal)July",+ -2.1400661634962708),+ ("daymonth", -1.7346010553881064),+ ("minuteminute", -2.1400661634962708),+ ("hh:mmhh:mm", -2.1400661634962708),+ ("<named-month> <day-of-month> (non ordinal)August",+ -2.1400661634962708)],+ n = 3}}),+ ("<integer> and an half hour",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (0..19)", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("relative minutes to|till|before|after <integer> (time-of-day)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("hour", -1.2992829841302609),+ ("integer (numeric)half to|till|before <integer> (hour-of-day)",+ -1.7047480922384253),+ ("integer (numeric)time-of-day (latent)", -1.7047480922384253),+ ("integer (20..90)time-of-day (latent)", -1.7047480922384253),+ ("minute", -1.7047480922384253)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> - <time-of-day> (interval)",+ Classifier{okData =+ ClassData{prior = -0.9808292530117262,+ unseen = -2.9444389791664407,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>hh:mm", -2.1972245773362196),+ ("minuteminute", -0.9444616088408514),+ ("hh:mmhh:mm", -1.0986122886681098)],+ n = 6},+ koData =+ ClassData{prior = -0.4700036292457356, unseen = -3.295836866004329,+ likelihoods =+ HashMap.fromList+ [("hh:mmtime-of-day (latent)", -1.1786549963416462),+ ("minuteminute", -2.159484249353372),+ ("hh:mmhh:mm", -2.159484249353372),+ ("minutehour", -1.0608719606852628),+ ("at <time-of-day>time-of-day (latent)", -2.5649493574615367)],+ n = 10}}),+ ("winter",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last n <cycle>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.713572066704308,+ likelihoods =+ HashMap.fromList+ [("week", -2.5902671654458267),+ ("integer (0..19)year (grain)", -2.995732273553991),+ ("integer (numeric)day (grain)", -2.5902671654458267),+ ("second", -2.5902671654458267),+ ("integer (numeric)second (grain) ", -2.5902671654458267),+ ("integer (numeric)year (grain)", -2.995732273553991),+ ("day", -2.5902671654458267), ("year", -2.5902671654458267),+ ("integer (numeric)week (grain)", -2.995732273553991),+ ("integer (0..19)month (grain)", -2.995732273553991),+ ("month", -2.5902671654458267),+ ("integer (numeric)minute (grain)", -2.995732273553991),+ ("integer (0..19)minute (grain)", -2.995732273553991),+ ("integer (numeric)month (grain)", -2.995732273553991),+ ("minute", -2.5902671654458267),+ ("integer (0..19)week (grain)", -2.995732273553991)],+ n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -2.833213344056216,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("nth <time> after <time>",+ Classifier{okData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("dayday", -0.916290731874155),+ ("ordinals (first..19th)tuesdayintersect", -0.916290731874155)],+ n = 1},+ koData =+ ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,+ likelihoods =+ HashMap.fromList+ [("ordinals (first..19th)tuesdaychristmas", -0.916290731874155),+ ("dayday", -0.916290731874155)],+ n = 1}}),+ ("<named-month> <day-of-month> (non ordinal)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -3.1780538303479458,+ likelihoods =+ HashMap.fromList+ [("Augustinteger (numeric)", -1.749199854809259),+ ("Aprilinteger (numeric)", -2.4423470353692043),+ ("month", -0.832909122935104),+ ("Februaryinteger (numeric)", -1.749199854809259),+ ("Julyinteger (numeric)", -2.03688192726104)],+ n = 9},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month> (non ordinal) <named-month>",+ Classifier{okData =+ ClassData{prior = -0.3448404862917295,+ unseen = -3.7612001156935624,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)September", -2.639057329615259),+ ("integer (numeric)April", -2.639057329615259),+ ("integer (numeric)August", -3.044522437723423),+ ("integer (numeric)February", -1.6582280766035324),+ ("month", -0.8472978603872037),+ ("integer (numeric)July", -2.639057329615259),+ ("integer (numeric)March", -2.3513752571634776)],+ n = 17},+ koData =+ ClassData{prior = -1.2321436812926323,+ unseen = -3.1354942159291497,+ likelihoods =+ HashMap.fromList+ [("integer (numeric)August", -2.3978952727983707),+ ("month", -1.0116009116784799),+ ("integer (numeric)October", -2.3978952727983707),+ ("integer (numeric)July", -1.2992829841302609)],+ n = 7}}),+ ("this|next <day-of-week>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("wednesday", -1.8718021769015913),+ ("monday", -0.9555114450274363), ("day", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<time-of-day> after",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("<time-of-day> o'clock", -0.6931471805599453),+ ("hour", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("ordinal (digits)",+ Classifier{okData =+ ClassData{prior = -0.8109302162163288, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -0.587786664902119, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}),+ ("quarter (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("last <cycle> of <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.70805020110221,+ likelihoods =+ HashMap.fromList+ [("day (grain)October", -1.9459101490553135),+ ("daymonth", -1.540445040947149),+ ("day (grain)intersect", -1.9459101490553135),+ ("weekmonth", -1.540445040947149),+ ("week (grain)intersect", -1.9459101490553135),+ ("week (grain)September", -1.9459101490553135)],+ n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<day-of-month>(ordinal) <named-month> year",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("ordinal (digits)July", -0.6931471805599453),+ ("month", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("morning",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("week-end",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("after <time-of-day>",+ Classifier{okData =+ ClassData{prior = -0.587786664902119, unseen = -2.995732273553991,+ likelihoods =+ HashMap.fromList+ [("at <time-of-day>", -1.845826690498331),+ ("<time-of-day> o'clock", -1.845826690498331),+ ("time-of-day (latent)", -2.2512917986064953),+ ("hour", -1.1526795099383855)],+ n = 5},+ koData =+ ClassData{prior = -0.8109302162163288, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("intersect", -2.1400661634962708),+ ("day", -1.4469189829363254), ("hh:mm", -2.1400661634962708),+ ("christmas", -1.7346010553881064),+ ("minute", -2.1400661634962708)],+ n = 4}}),+ ("day (grain)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods = HashMap.fromList [("", 0.0)], n = 12},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<month> dd-dd (interval)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.639057329615259,+ likelihoods =+ HashMap.fromList+ [("October", -1.8718021769015913), ("July", -0.9555114450274363),+ ("month", -0.7731898882334817)],+ n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Dutch King day",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("summer",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<hour-of-day> <integer> (as relative minutes)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.890371757896165,+ likelihoods =+ HashMap.fromList+ [("hour", -0.7537718023763802),+ ("at <time-of-day>integer (numeric)", -2.1400661634962708),+ ("<time-of-day> o'clockinteger (numeric)",+ -0.8873031950009028)],+ n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("<integer> kwartier",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("integer (0..19)", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("this <time>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods =+ HashMap.fromList+ [("day", -1.2992829841302609), ("hour", -1.7047480922384253),+ ("winter", -1.7047480922384253),+ ("week-end", -1.7047480922384253),+ ("summer", -1.7047480922384253)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("within <duration>",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList+ [("week", -0.6931471805599453),+ ("<integer> <unit-of-duration>", -0.6931471805599453)],+ n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("before yesterday",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("August",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}})]
Duckling/Ranking/Classifiers/PL_XX.hs view
@@ -1205,6 +1205,13 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.3025850929940455,+ likelihoods = HashMap.fromList [("", 0.0)], n = 8}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.044522437723423,
Duckling/Ranking/Classifiers/PT_XX.hs view
@@ -52,6 +52,13 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("S\225bada",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("<dim time> da tarde", Classifier{okData = ClassData{prior = -0.24686007793152578, unseen = -4.0943445622221,@@ -117,15 +124,22 @@ likelihoods = HashMap.fromList [], n = 0}}), ("<named-month|named-day> past", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.1972245773362196,+ ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList- [("day", -0.6931471805599453),- ("named-day", -0.6931471805599453)],+ [("Ter\231a-feira", -1.5040773967762742),+ ("Domingo", -1.0986122886681098), ("day", -0.8109302162163288)], n = 3}, koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,+ ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("Abril",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.3862943611198906,+ likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("proximo <cycle> ", Classifier{okData = ClassData{prior = -0.5596157879354228, unseen = -2.70805020110221,@@ -157,86 +171,109 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("Julho",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("intersect by `da` or `de`", Classifier{okData =- ClassData{prior = -1.8325814637483102, unseen = -4.574710978503383,+ ClassData{prior = -1.8325814637483102, unseen = -4.736198448394496, likelihoods = HashMap.fromList- [("day of month (1st)named-month", -3.1780538303479458),- ("daymonth", -2.772588722239781),+ [("daymonth", -2.9356283494842854), ("<day-of-month> de <named-month>two time tokens separated by \",\"2",- -3.871201010907891),+ -4.034240638152395), ("<day-of-month> de <named-month>intersect",- -3.871201010907891),+ -4.034240638152395), ("<day-of-month> de <named-month>two time tokens separated by \",\"",- -3.871201010907891),- ("dayday", -3.1780538303479458),- ("dia <day-of-month> (non ordinal)named-month",- -3.4657359027997265),- ("dayyear", -1.9252908618525775),- ("named-dayproximo <cycle> ", -3.871201010907891),- ("dd-dd <month>(interval)year", -3.871201010907891),- ("named-day<cycle> (que vem)", -3.871201010907891),- ("two time tokens separated by \",\"2year",- -3.4657359027997265),- ("intersectyear", -3.871201010907891),- ("<day-of-month> de <named-month>year", -2.4849066497880004),- ("two time tokens separated by \",\"year", -3.4657359027997265),- ("dayweek", -3.1780538303479458),- ("named-day<cycle> passado", -3.871201010907891)],+ -4.034240638152395),+ ("dayday", -3.34109345759245),+ ("Quart-feira<cycle> (que vem)", -4.034240638152395),+ ("dayyear", -2.088330489097082),+ ("dd-dd <month>(interval)year", -4.034240638152395),+ ("day of month (1st)Mar\231o", -3.34109345759245),+ ("two time tokens separated by \",\"2year", -3.628775530044231),+ ("intersectyear", -4.034240638152395),+ ("<day-of-month> de <named-month>year", -2.6479462770325046),+ ("dia <day-of-month> (non ordinal)Fevereiro",+ -3.628775530044231),+ ("two time tokens separated by \",\"year", -3.628775530044231),+ ("Domingo<cycle> passado", -4.034240638152395),+ ("dayweek", -3.34109345759245),+ ("Quart-feiraproximo <cycle> ", -4.034240638152395)], n = 24}, koData =- ClassData{prior = -0.1743533871447778, unseen = -5.707110264748875,+ ClassData{prior = -0.1743533871447778, unseen = -5.762051382780177, likelihoods = HashMap.fromList [("time-of-day (latent)<datetime> - <datetime> (interval)",- -4.605170185988091),- ("hourday", -2.870569130599985),- ("monthday", -4.31748811353631),- ("monthyear", -3.506557897319982),- ("yearhour", -3.624340932976365),- ("houryear", -3.0647251450409425),+ -4.660289485209171),+ ("hourday", -2.9256884298210646),+ ("year (latent)Abril", -4.660289485209171),+ ("year (latent)Julho", -3.967142304649226),+ ("time-of-day (latent)Fevereiro", -3.8129916248219673),+ ("monthday", -4.37260741275739),+ ("monthyear", -3.561677196541061),+ ("yearhour", -3.6794602321974446),+ ("houryear", -3.119844444262022),+ ("year (latent)Maio", -4.149463861443181), ("time-of-day (latent)two time tokens separated by \",\"2",- -4.605170185988091),- ("time-of-day (latent)intersect", -3.0647251450409425),+ -4.660289485209171),+ ("Setembroyear", -3.967142304649226),+ ("time-of-day (latent)Setembro", -3.967142304649226),+ ("time-of-day (latent)intersect", -3.119844444262022), ("year (latent)<time-of-day> <part-of-day>",- -5.0106352940962555),- ("year (latent)intersect", -4.31748811353631),+ -5.065754593317335),+ ("\224s <time-of-day>Julho", -5.065754593317335),+ ("year (latent)intersect", -4.37260741275739),+ ("Setembrointersect", -5.065754593317335), ("intersect by `da` or `de`two time tokens separated by \",\"",- -5.0106352940962555),+ -5.065754593317335), ("year (latent)amanh\227 pela <part-of-day>",- -5.0106352940962555),- ("hourmonth", -1.8325814637483102),+ -5.065754593317335),+ ("hourmonth", -1.8877007629693896), ("time-of-day (latent)intersect by `da` or `de`",- -3.2188758248682006),- ("monthmonth", -5.0106352940962555),- ("dayyear", -5.0106352940962555),- ("year (latent)named-month", -2.3025850929940455),- ("named-monthyear", -3.506557897319982),- ("year (latent)<dim time> da manha", -5.0106352940962555),- ("de <datetime> - <datetime> (interval)named-month",- -5.0106352940962555),- ("\224s <time-of-day>named-month", -4.605170185988091),- ("yearmonth", -2.3025850929940455),- ("two time tokens separated by \",\"2year", -4.605170185988091),- ("intersect by `da` or `de`intersect", -5.0106352940962555),- ("intersectyear", -5.0106352940962555),+ -3.2739951240892804),+ ("monthmonth", -5.065754593317335),+ ("Setembrotwo time tokens separated by \",\"2",+ -5.065754593317335),+ ("year (latent)Fevereiro", -3.8129916248219673),+ ("time-of-day (latent)Dezembro", -5.065754593317335),+ ("dayyear", -5.065754593317335),+ ("time-of-day (latent)Julho", -4.149463861443181),+ ("time-of-day (latent)Abril", -4.660289485209171),+ ("de <datetime> - <datetime> (interval)Janeiro",+ -5.065754593317335),+ ("year (latent)<dim time> da manha", -5.065754593317335),+ ("time-of-day (latent)Mar\231o", -3.967142304649226),+ ("year (latent)Janeiro", -5.065754593317335),+ ("year (latent)Dezembro", -5.065754593317335),+ ("yearmonth", -2.3577043922151253),+ ("two time tokens separated by \",\"2year", -4.660289485209171),+ ("Setembrotwo time tokens separated by \",\"",+ -5.065754593317335),+ ("intersect by `da` or `de`intersect", -5.065754593317335),+ ("intersectyear", -5.065754593317335), ("intersect by `da` or `de`two time tokens separated by \",\"2",- -5.0106352940962555),- ("<day-of-month> de <named-month>year", -5.0106352940962555),- ("two time tokens separated by \",\"year", -4.605170185988091),+ -5.065754593317335),+ ("time-of-day (latent)Maio", -4.149463861443181),+ ("<day-of-month> de <named-month>year", -5.065754593317335),+ ("Maioyear", -4.660289485209171),+ ("year (latent)Setembro", -3.967142304649226),+ ("\224s <time-of-day>Janeiro", -5.065754593317335),+ ("two time tokens separated by \",\"year", -4.660289485209171), ("time-of-day (latent)two time tokens separated by \",\"",- -4.605170185988091),- ("intersect by `da` or `de`year", -3.506557897319982),- ("named-monthtwo time tokens separated by \",\"2",- -5.0106352940962555),+ -4.660289485209171),+ ("intersect by `da` or `de`year", -3.561677196541061), ("year (latent)<datetime> - <datetime> (interval)",- -4.605170185988091),- ("yearday", -5.0106352940962555),- ("named-monthintersect", -5.0106352940962555),- ("named-monthtwo time tokens separated by \",\"",- -5.0106352940962555),- ("time-of-day (latent)named-month", -2.336486644669727)],+ -4.660289485209171),+ ("yearday", -5.065754593317335),+ ("time-of-day (latent)Janeiro", -5.065754593317335),+ ("Julhoyear", -5.065754593317335),+ ("year (latent)Mar\231o", -3.967142304649226)], n = 126}}), ("<hour-of-day> and half", Classifier{okData =@@ -259,34 +296,52 @@ likelihoods = HashMap.fromList [], n = 0}}), ("two time tokens separated by \",\"", Classifier{okData =- ClassData{prior = -1.0360919316867756, unseen = -3.58351893845611,+ ClassData{prior = -1.0360919316867756,+ unseen = -3.6375861597263857, likelihoods = HashMap.fromList- [("intersectnamed-day", -2.8622008809294686),- ("intersect by `da` or `de`named-day", -2.8622008809294686),- ("dayday", -1.252762968495368),- ("de <year>named-day", -2.8622008809294686),- ("named-dayintersect", -2.456735772821304),- ("named-dayintersect by `da` or `de`", -2.456735772821304),- ("yearnamed-day", -2.8622008809294686),- ("named-day<day-of-month> de <named-month>",- -2.169053700369523),- ("yearday", -2.456735772821304)],+ [("yearSexta-feira", -2.917770732084279),+ ("dayday", -1.3083328196501787),+ ("de <year>Sexta-feira", -2.917770732084279),+ ("Sexta-feiraintersect", -2.512305623976115),+ ("intersectSexta-feira", -2.917770732084279),+ ("Sexta-feira<day-of-month> de <named-month>",+ -2.512305623976115),+ ("Sexta-feiraintersect by `da` or `de`", -2.512305623976115),+ ("intersect by `da` or `de`Sexta-feira", -2.917770732084279),+ ("yearday", -2.512305623976115),+ ("Segunda-feira<day-of-month> de <named-month>",+ -2.917770732084279)], n = 11}, koData =- ClassData{prior = -0.4382549309311553,- unseen = -3.9889840465642745,+ ClassData{prior = -0.4382549309311553, unseen = -4.02535169073515, likelihoods = HashMap.fromList- [("hourday", -2.3608540011180215),- ("dayhour", -1.4853852637641216),- ("daymonth", -2.583997552432231),- ("monthday", -2.871679624884012),- ("intersectnamed-day", -2.871679624884012),- ("intersect by `da` or `de`named-day", -2.3608540011180215),- ("named-dayintersect", -2.871679624884012),- ("named-dayintersect by `da` or `de`", -1.405342556090585)],+ [("hourday", -2.3978952727983707),+ ("dayhour", -1.5224265354444706),+ ("daymonth", -2.6210388241125804),+ ("monthday", -2.908720896564361),+ ("Segunda-feiraintersect by `da` or `de`", -2.908720896564361),+ ("Sexta-feiraintersect", -2.908720896564361),+ ("intersectSexta-feira", -2.908720896564361),+ ("Sexta-feiraintersect by `da` or `de`", -1.6094379124341003),+ ("intersect by `da` or `de`Sexta-feira", -2.3978952727983707)], n = 20}}),+ ("Sexta-feira",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("integer (0..19)",+ Classifier{okData =+ ClassData{prior = -1.9048194970694474e-2,+ unseen = -3.9889840465642745,+ likelihoods = HashMap.fromList [("", 0.0)], n = 52},+ koData =+ ClassData{prior = -3.970291913552122, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("ordinals (primeiro..10)", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453,@@ -297,19 +352,29 @@ ("<day-of-month> de <named-month>", Classifier{okData = ClassData{prior = -7.410797215372185e-2,- unseen = -4.02535169073515,+ unseen = -4.189654742026425, likelihoods = HashMap.fromList- [("number (0..15)named-month", -1.927891643552635),- ("integer (numeric)named-month", -1.0116009116784799),- ("month", -0.7114963192281418)],+ [("integer (numeric)Fevereiro", -2.228477120840324),+ ("integer (numeric)Mar\231o", -3.0757749812275272),+ ("integer (0..19)Maio", -3.0757749812275272),+ ("integer (numeric)Abril", -3.481240089335692),+ ("integer (numeric)Julho", -3.481240089335692),+ ("integer (numeric)Dezembro", -3.481240089335692),+ ("integer (numeric)Janeiro", -3.481240089335692),+ ("month", -0.878550403891308),+ ("integer (0..19)Julho", -3.481240089335692),+ ("integer (0..19)Abril", -3.481240089335692),+ ("integer (numeric)Maio", -3.0757749812275272),+ ("integer (0..19)Mar\231o", -2.7880929087757464),+ ("integer (numeric)Setembro", -2.382627800667582)], n = 26}, koData =- ClassData{prior = -2.639057329615259, unseen = -2.0794415416798357,+ ClassData{prior = -2.639057329615259, unseen = -2.890371757896165, likelihoods = HashMap.fromList- [("integer (numeric)named-month", -0.8472978603872037),- ("month", -0.8472978603872037)],+ [("integer (numeric)Julho", -1.7346010553881064),+ ("month", -1.7346010553881064)], n = 2}}), ("<time-of-day> <part-of-day>", Classifier{okData =@@ -344,7 +409,7 @@ ("hourhour", -2.6026896854443837), ("time-of-day (latent)morning", -3.295836866004329), ("year (latent)afternoon", -2.1972245773362196),- ("named-monthmorning", -3.295836866004329),+ ("Fevereiromorning", -3.295836866004329), ("year (latent)evening", -2.890371757896165), ("time-of-day (latent)afternoon", -2.890371757896165), ("year (latent)morning", -2.379546134130174),@@ -362,12 +427,28 @@ ("monthyear", -2.1972245773362196), ("monthhour", -1.791759469228055), ("monthmonth", -2.1972245773362196),- ("named-monthyear (latent)", -2.1972245773362196),- ("named-monthtime-of-day (latent)", -2.1972245773362196),- ("named-month<day-of-month> de <named-month>",+ ("Dezembrotime-of-day (latent)", -2.1972245773362196),+ ("Dezembro<day-of-month> de <named-month>", -2.1972245773362196),- ("named-monthintersect by `da` or `de`", -1.791759469228055)],+ ("Dezembroyear (latent)", -2.1972245773362196),+ ("Dezembrointersect by `da` or `de`", -1.791759469228055)], n = 5}}),+ ("Maio",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("", 0.0)], n = 4},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("number (21..29 31..39 .. 91..99)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.6094379124341003,+ likelihoods =+ HashMap.fromList [("tens (20..90)integer (0..19)", 0.0)],+ n = 3},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("<time-of-day> horas", Classifier{okData = ClassData{prior = -0.7731898882334817,@@ -390,119 +471,121 @@ n = 7}}), ("intersect", Classifier{okData =- ClassData{prior = -0.702716631576096, unseen = -5.1298987149230735,+ ClassData{prior = -0.702716631576096, unseen = -5.14166355650266, likelihoods = HashMap.fromList [("<day-of-month> de <named-month>in the <part-of-day>",- -4.02535169073515),- ("dayhour", -2.3513752571634776),+ -4.037186148382152),+ ("dayhour", -2.3632097148104805), ("<day-of-month> de <named-month>two time tokens separated by \",\"2",- -4.430816798843313),+ -4.442651256490317), ("nowquinze para as <hour-of-day> (as relative minutes)",- -4.430816798843313),- ("intersectnamed-day", -4.430816798843313),- ("now\224s <time-of-day>", -4.02535169073515),+ -4.442651256490317),+ ("Quart-feiraamanh\227 pela <part-of-day>", -4.442651256490317),+ ("now\224s <time-of-day>", -4.037186148382152), ("<day-of-month> de <named-month>intersect",- -4.430816798843313),- ("now<hour-of-day> and 3/4", -4.430816798843313),- ("intersect by `da` or `de`named-day", -4.430816798843313),+ -4.442651256490317),+ ("now<hour-of-day> and 3/4", -4.442651256490317), ("<day-of-month> de <named-month>two time tokens separated by \",\"",- -4.430816798843313),- ("dayday", -2.9267394020670396),- ("hourhour", -4.430816798843313),- ("named-day\224s <time-of-day>", -4.430816798843313),- ("dayyear", -2.4159137783010487),- ("minutehour", -3.1780538303479458),+ -4.442651256490317),+ ("Segunda-feirain the <part-of-day>", -4.442651256490317),+ ("Quart-feira<time-of-day> <part-of-day>", -4.442651256490317),+ ("yearSexta-feira", -4.442651256490317),+ ("dayday", -2.9385738597140425),+ ("hourhour", -4.442651256490317),+ ("dayyear", -2.4277482359480516),+ ("de <year>Sexta-feira", -4.442651256490317),+ ("minutehour", -3.1898882879949486), ("<hour-of-day> and quinzein the <part-of-day>",- -4.02535169073515),- ("de <year>named-day", -4.430816798843313),+ -4.037186148382152), ("intersect by `da` or `de`in the <part-of-day>",- -4.02535169073515),- ("now<hour-of-day> and <relative minutes>", -4.430816798843313),- ("named-dayin the <part-of-day>", -4.430816798843313),- ("tomorrow<time-of-day> horas", -4.02535169073515),+ -4.037186148382152),+ ("now<hour-of-day> and <relative minutes>", -4.442651256490317),+ ("tomorrow<time-of-day> horas", -4.037186148382152), ("now<integer> para as <hour-of-day> (as relative minutes)",- -4.430816798843313),+ -4.442651256490317), ("\224s <time-of-day>in the <part-of-day>",- -3.7376696182833684),- ("named-dayintersect", -4.430816798843313),- ("named-dayamanh\227 pela <part-of-day>", -4.430816798843313),- ("dayminute", -3.1780538303479458),- ("named-dayintersect by `da` or `de`", -4.430816798843313),- ("yearnamed-day", -4.430816798843313),- ("dd-dd <month>(interval)de <year>", -4.430816798843313),- ("named-day<day-of-month> de <named-month>",- -4.430816798843313),- ("named-day<time-of-day> <part-of-day>", -4.430816798843313),+ -3.7495040759303713),+ ("Sexta-feiraintersect", -4.442651256490317),+ ("dayminute", -3.1898882879949486),+ ("intersectSexta-feira", -4.442651256490317),+ ("Sexta-feira<day-of-month> de <named-month>",+ -4.442651256490317),+ ("dd-dd <month>(interval)de <year>", -4.442651256490317),+ ("Sexta-feiraintersect by `da` or `de`", -4.442651256490317),+ ("intersect by `da` or `de`Sexta-feira", -4.442651256490317), ("dia <day-of-month> de <named-month>in the <part-of-day>",- -4.02535169073515),- ("yearday", -4.02535169073515),- ("named-day<dim time> da manha", -4.430816798843313),+ -4.037186148382152),+ ("yearday", -4.037186148382152), ("two time tokens separated by \",\"de <year>",- -4.02535169073515),- ("dd[/-]mmyear", -4.430816798843313),+ -4.037186148382152),+ ("dd[/-]mmyear", -4.442651256490317),+ ("Quart-feira\224s <time-of-day>", -4.442651256490317), ("<day-of-month> de <named-month>de <year>",- -3.044522437723423),- ("tomorrowdepois das <time-of-day>", -4.02535169073515),+ -3.056356895370426),+ ("Quart-feira<dim time> da manha", -4.442651256490317),+ ("tomorrowdepois das <time-of-day>", -4.037186148382152), ("<hour-of-day> and <relative minutes>in the <part-of-day>",- -4.02535169073515),+ -4.037186148382152), ("two time tokens separated by \",\"2de <year>",- -4.02535169073515),- ("intersectde <year>", -4.430816798843313)],+ -4.037186148382152),+ ("intersectde <year>", -4.442651256490317)], n = 52}, koData =- ClassData{prior = -0.6836684366054016, unseen = -5.14166355650266,+ ClassData{prior = -0.6836684366054016, unseen = -5.153291594497779, likelihoods = HashMap.fromList- [("hourday", -2.9385738597140425),- ("dayhour", -3.056356895370426),- ("daymonth", -4.442651256490317),- ("monthday", -3.3440389678222067),- ("named-month\224s <time-of-day>", -4.442651256490317),- ("monthyear", -2.9385738597140425),- ("intersectnamed-day", -4.037186148382152),- ("now\224s <time-of-day>", -4.037186148382152),- ("houryear", -2.496741107435003),+ [("hourday", -2.9502698994772336),+ ("dayhour", -3.068052935133617),+ ("daymonth", -4.454347296253507),+ ("monthday", -3.355735007585398),+ ("monthyear", -2.9502698994772336),+ ("now\224s <time-of-day>", -4.048882188145344),+ ("houryear", -2.5084371471981943),+ ("Dezembro\224s <time-of-day>", -4.454347296253507), ("<time-of-day> am|pm<day-of-month> de <named-month>",- -4.442651256490317),- ("intersect by `da` or `de`named-day", -3.5263605246161616),- ("monthhour", -3.1898882879949486),+ -4.454347296253507),+ ("Fevereiroin the <part-of-day>", -4.048882188145344),+ ("monthhour", -3.2015843277581397),+ ("Setembrointersect", -4.454347296253507), ("intersect by `da` or `de`two time tokens separated by \",\"",- -4.442651256490317),- ("hourmonth", -4.442651256490317),+ -4.454347296253507),+ ("hourmonth", -4.454347296253507),+ ("Julhode <year>", -4.454347296253507), ("<time-of-day> am|pmintersect by `da` or `de`",- -4.442651256490317),- ("dayyear", -4.442651256490317),+ -4.454347296253507),+ ("Setembrotwo time tokens separated by \",\"2",+ -4.454347296253507),+ ("dayyear", -4.454347296253507), ("intersect by `da` or `de`\224s <time-of-day>",- -4.442651256490317),+ -4.454347296253507), ("intersect by `da` or `de`in the <part-of-day>",- -4.037186148382152),- ("now<hour-of-day> and <relative minutes>", -4.442651256490317),- ("daysecond", -4.442651256490317),- ("named-dayright now", -4.442651256490317),- ("named-dayintersect", -4.442651256490317),- ("dayminute", -4.037186148382152),- ("named-monthde <year>", -2.9385738597140425),- ("intersect by `da` or `de`intersect", -4.442651256490317),+ -4.048882188145344),+ ("Setembrode <year>", -3.355735007585398),+ ("now<hour-of-day> and <relative minutes>", -4.454347296253507),+ ("daysecond", -4.454347296253507),+ ("Ter\231a-feiraright now", -4.454347296253507),+ ("Sexta-feiraintersect", -4.454347296253507),+ ("dayminute", -4.048882188145344),+ ("Setembrotwo time tokens separated by \",\"",+ -4.454347296253507),+ ("intersect by `da` or `de`intersect", -4.454347296253507),+ ("intersectSexta-feira", -4.048882188145344), ("intersect by `da` or `de`two time tokens separated by \",\"2",- -4.442651256490317),- ("named-dayintersect by `da` or `de`", -3.3440389678222067),- ("named-monthin the <part-of-day>", -4.037186148382152),- ("named-monthtwo time tokens separated by \",\"2",- -4.442651256490317),+ -4.454347296253507),+ ("Sexta-feiraintersect by `da` or `de`", -3.355735007585398),+ ("intersect by `da` or `de`Sexta-feira", -3.5380565643793527), ("two time tokens separated by \",\"de <year>",- -4.037186148382152),- ("intersect by `da` or `de`de <year>", -2.9385738597140425),- ("named-monthintersect", -4.442651256490317),+ -4.048882188145344),+ ("intersect by `da` or `de`de <year>", -2.9502698994772336), ("<day-of-month> de <named-month>\224s <time-of-day>",- -4.442651256490317),+ -4.454347296253507),+ ("Maiode <year>", -4.048882188145344), ("<day-of-month> de <named-month>de <year>",- -4.442651256490317),+ -4.454347296253507), ("two time tokens separated by \",\"2de <year>",- -4.037186148382152),- ("intersectde <year>", -4.442651256490317),- ("named-monthtwo time tokens separated by \",\"",- -4.442651256490317)],+ -4.048882188145344),+ ("intersectde <year>", -4.454347296253507)], n = 53}}), ("season", Classifier{okData =@@ -520,33 +603,36 @@ likelihoods = HashMap.fromList [], n = 0}}), ("two time tokens separated by \",\"2", Classifier{okData =- ClassData{prior = -1.0360919316867756, unseen = -3.58351893845611,+ ClassData{prior = -1.0360919316867756,+ unseen = -3.6375861597263857, likelihoods = HashMap.fromList- [("intersectnamed-day", -2.8622008809294686),- ("intersect by `da` or `de`named-day", -2.8622008809294686),- ("dayday", -1.252762968495368),- ("de <year>named-day", -2.8622008809294686),- ("named-dayintersect", -2.456735772821304),- ("named-dayintersect by `da` or `de`", -2.456735772821304),- ("yearnamed-day", -2.8622008809294686),- ("named-day<day-of-month> de <named-month>",- -2.169053700369523),- ("yearday", -2.456735772821304)],+ [("yearSexta-feira", -2.917770732084279),+ ("dayday", -1.3083328196501787),+ ("de <year>Sexta-feira", -2.917770732084279),+ ("Sexta-feiraintersect", -2.512305623976115),+ ("intersectSexta-feira", -2.917770732084279),+ ("Sexta-feira<day-of-month> de <named-month>",+ -2.512305623976115),+ ("Sexta-feiraintersect by `da` or `de`", -2.512305623976115),+ ("intersect by `da` or `de`Sexta-feira", -2.917770732084279),+ ("yearday", -2.512305623976115),+ ("Segunda-feira<day-of-month> de <named-month>",+ -2.917770732084279)], n = 11}, koData =- ClassData{prior = -0.4382549309311553,- unseen = -3.9889840465642745,+ ClassData{prior = -0.4382549309311553, unseen = -4.02535169073515, likelihoods = HashMap.fromList- [("hourday", -2.3608540011180215),- ("dayhour", -1.4853852637641216),- ("daymonth", -2.583997552432231),- ("monthday", -2.871679624884012),- ("intersectnamed-day", -2.871679624884012),- ("intersect by `da` or `de`named-day", -2.3608540011180215),- ("named-dayintersect", -2.871679624884012),- ("named-dayintersect by `da` or `de`", -1.405342556090585)],+ [("hourday", -2.3978952727983707),+ ("dayhour", -1.5224265354444706),+ ("daymonth", -2.6210388241125804),+ ("monthday", -2.908720896564361),+ ("Segunda-feiraintersect by `da` or `de`", -2.908720896564361),+ ("Sexta-feiraintersect", -2.908720896564361),+ ("intersectSexta-feira", -2.908720896564361),+ ("Sexta-feiraintersect by `da` or `de`", -1.6094379124341003),+ ("intersect by `da` or `de`Sexta-feira", -2.3978952727983707)], n = 20}}), ("year (latent)", Classifier{okData =@@ -557,10 +643,9 @@ likelihoods = HashMap.fromList [("integer (numeric)", -0.6061358035703156),- ("number (0..15)", -1.0116009116784799),- ("numbers prefix with -, negative or minus",- -3.0910424533583156),- ("number (20..90)", -3.0910424533583156)],+ ("integer (0..19)", -1.0116009116784799),+ ("negative numbers", -3.0910424533583156),+ ("tens (20..90)", -3.0910424533583156)], n = 40}}), ("n[ao] <date>", Classifier{okData =@@ -568,8 +653,7 @@ likelihoods = HashMap.fromList [("dia <day-of-month> (non ordinal)", -1.252762968495368),- ("day", -0.8472978603872037),- ("named-day", -1.252762968495368)],+ ("Domingo", -1.252762968495368), ("day", -0.8472978603872037)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906,@@ -618,7 +702,7 @@ ("hourhour", -2.639057329615259), ("time-of-day (latent)morning", -3.332204510175204), ("year (latent)afternoon", -2.2335922215070942),- ("named-monthmorning", -3.332204510175204),+ ("Fevereiromorning", -3.332204510175204), ("year (latent)evening", -2.9267394020670396), ("time-of-day (latent)afternoon", -2.9267394020670396), ("year (latent)morning", -2.4159137783010487),@@ -643,18 +727,25 @@ ("hour", -2.2512917986064953), ("month", -2.9444389791664407), ("minute", -1.845826690498331)], n = 15}}),- ("dia <day-of-month> (non ordinal)",+ ("Segunda-feira", Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Fevereiro",+ Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 6},+ likelihoods = HashMap.fromList [("", 0.0)], n = 6}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),- ("named-month",+ ("dia <day-of-month> (non ordinal)", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.4657359027997265,- likelihoods = HashMap.fromList [("", 0.0)], n = 30},+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 6}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -670,7 +761,7 @@ ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList- [("integer (numeric)named-month", -0.6931471805599453),+ [("integer (numeric)Fevereiro", -0.6931471805599453), ("month", -0.6931471805599453)], n = 2}, koData =@@ -687,14 +778,20 @@ koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),- ("number (0..15)",+ ("Ter\231a-feira", Classifier{okData =- ClassData{prior = -1.9048194970694474e-2,- unseen = -3.9889840465642745,- likelihoods = HashMap.fromList [("", 0.0)], n = 52},+ ClassData{prior = 0.0, unseen = -2.9444389791664407,+ likelihoods = HashMap.fromList [("", 0.0)], n = 17}, koData =- ClassData{prior = -3.970291913552122, unseen = -1.0986122886681098,- likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("Domingo",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.0794415416798357,+ likelihoods = HashMap.fromList [("", 0.0)], n = 6},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("antes das <time-of-day>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004,@@ -706,21 +803,12 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),- ("numbers prefix with -, negative or minus",- Classifier{okData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0},- koData =- ClassData{prior = 0.0, unseen = -1.791759469228055,- likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 4}}), ("dd-dd <month>(interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList- [("named-month", -0.6931471805599453),- ("month", -0.6931471805599453)],+ [("Julho", -0.6931471805599453), ("month", -0.6931471805599453)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098,@@ -761,19 +849,12 @@ likelihoods = HashMap.fromList [("integer (numeric)noon", -1.7047480922384253),- ("hour", -0.7884573603642702),- ("number (0..15)noon", -1.0116009116784799)],+ ("integer (0..19)noon", -1.0116009116784799),+ ("hour", -0.7884573603642702)], n = 4}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),- ("number (20..90)",- Classifier{okData =- ClassData{prior = 0.0, unseen = -1.9459101490553135,- likelihoods = HashMap.fromList [("", 0.0)], n = 5},- koData =- ClassData{prior = -infinity, unseen = -0.6931471805599453,- likelihoods = HashMap.fromList [], n = 0}}), ("<dim time> da manha", Classifier{okData = ClassData{prior = -0.262364264467491, unseen = -3.4339872044851463,@@ -793,7 +874,7 @@ likelihoods = HashMap.fromList [("intersect by `da` or `de`", -2.0794415416798357),- ("named-month", -2.0794415416798357),+ ("Fevereiro", -2.0794415416798357), ("time-of-day (latent)", -2.0794415416798357), ("hour", -2.0794415416798357), ("month", -1.6739764335716716)], n = 3}}),@@ -811,6 +892,13 @@ koData = ClassData{prior = -infinity, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.5649493574615367,+ likelihoods = HashMap.fromList [("", 0.0)], n = 11}}), ("passados n <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367,@@ -825,6 +913,13 @@ koData = ClassData{prior = -infinity, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [], n = 0}}),+ ("Janeiro",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("afternoon", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357,@@ -844,47 +939,54 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("Dezembro",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.0986122886681098,+ likelihoods = HashMap.fromList [("", 0.0)], n = 1},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("time-of-day (latent)", Classifier{okData = ClassData{prior = -0.9328200338253656, unseen = -3.332204510175204, likelihoods = HashMap.fromList [("integer (numeric)", -1.0986122886681098),- ("number (0..15)", -0.46262352194811296)],+ ("integer (0..19)", -0.46262352194811296)], n = 24}, koData = ClassData{prior = -0.4999559515290868, unseen = -3.713572066704308, likelihoods = HashMap.fromList [("integer (numeric)", -0.5108256237659907),- ("number (0..15)", -1.0498221244986778),- ("number (20..90)", -2.995732273553991)],+ ("integer (0..19)", -1.0498221244986778),+ ("tens (20..90)", -2.995732273553991)], n = 37}}), ("<hour-of-day> and <relative minutes>", Classifier{okData = ClassData{prior = -0.2719337154836418, unseen = -3.713572066704308, likelihoods = HashMap.fromList- [("\224s <time-of-day>number (0..15)", -2.3025850929940455),- ("time-of-day (latent)number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)",- -2.5902671654458267),- ("\224s <time-of-day>number (20..90)", -2.5902671654458267),- ("\224s <time-of-day>number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)",+ [("\224s <time-of-day>tens (20..90)", -2.5902671654458267),+ ("time-of-day (latent)integer (0..19)", -2.0794415416798357),+ ("time-of-day (latent)tens (20..90)", -2.5902671654458267),+ ("nooninteger (0..19)", -2.995732273553991),+ ("time-of-day (latent)number (21..29 31..39 .. 91..99)", -2.5902671654458267),- ("time-of-day (latent)number (0..15)", -2.0794415416798357), ("hour", -0.8556661100577202),- ("time-of-day (latent)number (20..90)", -2.5902671654458267),- ("noonnumber (0..15)", -2.995732273553991)],+ ("\224s <time-of-day>number (21..29 31..39 .. 91..99)",+ -2.5902671654458267),+ ("\224s <time-of-day>integer (0..19)", -2.3025850929940455)], n = 16}, koData = ClassData{prior = -1.4350845252893227, unseen = -2.9444389791664407, likelihoods = HashMap.fromList- [("\224s <time-of-day>number (20..90)", -1.791759469228055),- ("time-of-day (latent)number (0..15)", -2.1972245773362196),- ("hour", -1.0986122886681098),- ("time-of-day (latent)number (20..90)", -1.791759469228055)],+ [("\224s <time-of-day>tens (20..90)", -1.791759469228055),+ ("time-of-day (latent)integer (0..19)", -2.1972245773362196),+ ("time-of-day (latent)tens (20..90)", -1.791759469228055),+ ("hour", -1.0986122886681098)], n = 5}}), ("year", Classifier{okData =@@ -901,62 +1003,61 @@ ClassData{prior = -0.6443570163905132, unseen = -4.174387269895637, likelihoods = HashMap.fromList- [("week", -2.772588722239781),- ("number (0..15)ano (grain)", -3.0602707946915624),+ [("number (21..29 31..39 .. 91..99)hora (grain)",+ -3.4657359027997265),+ ("week", -2.772588722239781),+ ("integer (0..19)segundo (grain)", -3.4657359027997265), ("integer (numeric)hora (grain)", -3.4657359027997265), ("integer (numeric)dia (grain)", -3.4657359027997265),- ("number (0..15)segundo (grain)", -3.4657359027997265),+ ("integer (0..19)ano (grain)", -3.0602707946915624), ("second", -3.4657359027997265),+ ("integer (0..19)semana (grain)", -2.772588722239781), ("integer (numeric)ano (grain)", -3.4657359027997265),+ ("integer (0..19)mes (grain)", -3.0602707946915624),+ ("integer (0..19)hora (grain)", -2.772588722239781), ("integer (numeric)minutos (grain)", -2.772588722239781),- ("number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)hora (grain)",- -3.4657359027997265), ("day", -3.0602707946915624), ("year", -2.772588722239781),- ("number (0..15)mes (grain)", -3.0602707946915624),- ("number (0..15)hora (grain)", -2.772588722239781),+ ("integer (0..19)minutos (grain)", -3.0602707946915624), ("hour", -2.367123614131617), ("month", -3.0602707946915624),- ("number (0..15)dia (grain)", -3.4657359027997265),- ("number (0..15)minutos (grain)", -3.0602707946915624), ("minute", -2.367123614131617),- ("number (0..15)semana (grain)", -2.772588722239781)],+ ("integer (0..19)dia (grain)", -3.4657359027997265)], n = 21}, koData = ClassData{prior = -0.7444404749474959, unseen = -4.110873864173311, likelihoods = HashMap.fromList [("week", -2.995732273553991),- ("number (0..15)ano (grain)", -3.4011973816621555), ("integer (numeric)hora (grain)", -2.70805020110221), ("integer (numeric)dia (grain)", -2.995732273553991),+ ("integer (0..19)ano (grain)", -3.4011973816621555), ("integer (numeric)mes (grain)", -3.4011973816621555), ("second", -2.995732273553991),+ ("integer (0..19)semana (grain)", -3.4011973816621555), ("integer (numeric)semana (grain)", -3.4011973816621555), ("integer (numeric)ano (grain)", -2.995732273553991),+ ("integer (0..19)mes (grain)", -2.995732273553991),+ ("integer (0..19)hora (grain)", -2.995732273553991), ("integer (numeric)minutos (grain)", -2.995732273553991), ("day", -2.995732273553991), ("integer (numeric)segundo (grain)", -2.995732273553991),- ("year", -2.70805020110221),- ("number (0..15)mes (grain)", -2.995732273553991),- ("number (0..15)hora (grain)", -2.995732273553991),- ("hour", -2.3025850929940455), ("month", -2.70805020110221),- ("minute", -2.995732273553991),- ("number (0..15)semana (grain)", -3.4011973816621555)],+ ("year", -2.70805020110221), ("hour", -2.3025850929940455),+ ("month", -2.70805020110221), ("minute", -2.995732273553991)], n = 19}}), ("proximas n <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.2188758248682006, likelihoods = HashMap.fromList- [("number (0..15)ano (grain)", -2.4849066497880004),- ("integer (numeric)hora (grain)", -2.4849066497880004),+ [("integer (numeric)hora (grain)", -2.4849066497880004), ("integer (numeric)dia (grain)", -2.4849066497880004),+ ("integer (0..19)ano (grain)", -2.4849066497880004), ("second", -2.4849066497880004),+ ("integer (0..19)mes (grain)", -2.4849066497880004), ("integer (numeric)minutos (grain)", -2.4849066497880004), ("day", -2.4849066497880004), ("integer (numeric)segundo (grain)", -2.4849066497880004),- ("year", -2.4849066497880004),- ("number (0..15)mes (grain)", -2.4849066497880004),- ("hour", -2.4849066497880004), ("month", -2.4849066497880004),+ ("year", -2.4849066497880004), ("hour", -2.4849066497880004),+ ("month", -2.4849066497880004), ("minute", -2.4849066497880004)], n = 6}, koData =@@ -1000,19 +1101,17 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),- ("named-day",+ ("Quart-feira", Classifier{okData =- ClassData{prior = 0.0, unseen = -4.174387269895637,- likelihoods = HashMap.fromList [("", 0.0)], n = 63},+ ClassData{prior = 0.0, unseen = -2.3978952727983707,+ likelihoods = HashMap.fromList [("", 0.0)], n = 9}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),- ("number (21..29 31..39 41..49 51..59 61..69 71..79 81..89 91..99)",+ ("Quinta-feira", Classifier{okData =- ClassData{prior = 0.0, unseen = -1.6094379124341003,- likelihoods =- HashMap.fromList [("number (20..90)number (0..15)", 0.0)],- n = 3},+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -1054,18 +1153,25 @@ likelihoods = HashMap.fromList [("day", -0.6931471805599453),- ("named-day", -0.6931471805599453)],+ ("Quart-feira", -0.6931471805599453)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),+ ("Setembro",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("<part-of-day> dessa semana", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList- [("day", -0.6931471805599453),- ("named-day", -0.6931471805599453)],+ [("Ter\231a-feira", -0.6931471805599453),+ ("day", -0.6931471805599453)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098,@@ -1108,9 +1214,8 @@ [("week", -1.791759469228055), ("integer (numeric)semana (grain)", -1.791759469228055), ("integer (numeric)ano (grain)", -1.791759469228055),- ("year", -1.791759469228055),- ("number (0..15)mes (grain)", -1.791759469228055),- ("month", -1.791759469228055)],+ ("integer (0..19)mes (grain)", -1.791759469228055),+ ("year", -1.791759469228055), ("month", -1.791759469228055)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.9459101490553135,@@ -1146,6 +1251,14 @@ koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}),+ ("negative numbers",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.791759469228055,+ likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],+ n = 4}}), ("<datetime> - <datetime> (interval)", Classifier{okData = ClassData{prior = -1.791759469228055, unseen = -3.1354942159291497,@@ -1173,14 +1286,14 @@ ("monthmonth", -2.9444389791664407), ("hourhour", -2.9444389791664407), ("dayyear", -2.9444389791664407),- ("named-month<day-of-month> de <named-month>",+ ("Dezembro<day-of-month> de <named-month>", -2.9444389791664407), ("intersect by `da` or `de`<day-of-month> de <named-month>", -2.538973871058276), ("intersect by `da` or `de`intersect by `da` or `de`", -2.538973871058276),- ("dd[/-]mmyear", -2.9444389791664407),- ("named-monthintersect by `da` or `de`", -2.538973871058276)],+ ("Dezembrointersect by `da` or `de`", -2.538973871058276),+ ("dd[/-]mmyear", -2.9444389791664407)], n = 10}}), ("segundo (grain)", Classifier{okData =@@ -1189,6 +1302,20 @@ koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),+ ("Mar\231o",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}),+ ("tens (20..90)",+ Classifier{okData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5},+ koData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0}}), ("dia (grain)", Classifier{okData = ClassData{prior = -0.5596157879354228, unseen = -1.791759469228055,@@ -1211,14 +1338,15 @@ likelihoods = HashMap.fromList [], n = 0}}), ("this|next <day-of-week>", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.044522437723423,+ ClassData{prior = 0.0, unseen = -3.0910424533583156, likelihoods = HashMap.fromList- [("day", -0.6931471805599453),- ("named-day", -0.6931471805599453)],+ [("Segunda-feira", -1.6582280766035324),+ ("Ter\231a-feira", -1.0986122886681098),+ ("day", -0.7419373447293773)], n = 9}, koData =- ClassData{prior = -infinity, unseen = -1.0986122886681098,+ ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("natal", Classifier{okData =@@ -1313,10 +1441,10 @@ likelihoods = HashMap.fromList [("week", -1.791759469228055), ("second", -1.791759469228055),+ ("integer (0..19)semana (grain)", -1.791759469228055), ("integer (numeric)minutos (grain)", -1.791759469228055), ("integer (numeric)segundo (grain)", -1.791759469228055),- ("minute", -1.791759469228055),- ("number (0..15)semana (grain)", -1.791759469228055)],+ ("minute", -1.791759469228055)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.9459101490553135,@@ -1327,10 +1455,10 @@ likelihoods = HashMap.fromList [("season", -2.1102132003465894),+ ("Segunda-feira", -2.1102132003465894), ("dia <day-of-month> (non ordinal)", -2.1102132003465894),- ("day", -1.1939224684724346),- ("named-day", -2.1102132003465894),- ("hour", -1.8870696490323797), ("evening", -2.3978952727983707),+ ("day", -1.1939224684724346), ("hour", -1.8870696490323797),+ ("evening", -2.3978952727983707), ("week-end", -2.3978952727983707)], n = 13}, koData =
Duckling/Ranking/Classifiers/SV_XX.hs view
@@ -23,23 +23,23 @@ = HashMap.fromList [("<time> timezone", Classifier{okData =- ClassData{prior = 0.0, unseen = -3.044522437723423,+ ClassData{prior = 0.0, unseen = -3.4339872044851463, likelihoods = HashMap.fromList- [("at <time-of-day>", -1.2039728043259361),- ("hh:mm", -1.6094379124341003), ("hour", -1.6094379124341003),- ("minute", -1.2039728043259361)],- n = 8},+ [("at <time-of-day>", -1.3217558399823195),+ ("hh:mm", -1.455287232606842), ("hour", -2.0149030205422647),+ ("minute", -1.0033021088637848)],+ n = 13}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData =- ClassData{prior = -0.7600866632350547, unseen = -4.882801922586371,+ ClassData{prior = -0.832909122935104, unseen = -4.882801922586371, likelihoods = HashMap.fromList [("", 0.0)], n = 130}, koData =- ClassData{prior = -0.630408839926522, unseen = -5.0106352940962555,- likelihoods = HashMap.fromList [("", 0.0)], n = 148}}),+ ClassData{prior = -0.570544858467613, unseen = -5.14166355650266,+ likelihoods = HashMap.fromList [("", 0.0)], n = 169}}), ("the day before yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -109,24 +109,25 @@ likelihoods = HashMap.fromList [], n = 0}}), ("at <time-of-day>", Classifier{okData =- ClassData{prior = -0.2607262624632527, unseen = -4.624972813284271,+ ClassData{prior = -0.3014753945841168,+ unseen = -4.7535901911063645, likelihoods = HashMap.fromList- [("<time> timezone", -3.5165082281731497),- ("time-of-day (latent)", -1.2139231351791042),+ [("<time> timezone", -3.1354942159291497),+ ("time-of-day (latent)", -1.3437347467010947), ("relative minutes after|past <integer> (hour-of-day)",- -3.5165082281731497),- ("hh:mm", -2.0501711593797225),- ("<time-of-day> sharp", -3.5165082281731497),- ("hour", -1.149384614041533), ("minute", -1.7819071727850433)],- n = 47},+ -3.6463198396951406),+ ("hh:mm", -1.8545603704670852),+ ("<time-of-day> sharp", -3.6463198396951406),+ ("hour", -1.2791962255635234), ("minute", -1.5668782980153044)],+ n = 54}, koData =- ClassData{prior = -1.4718165345580525, unseen = -3.58351893845611,+ ClassData{prior = -1.3460204619819507, unseen = -3.828641396489095, likelihoods = HashMap.fromList- [("time-of-day (latent)", -0.8472978603872037),- ("hour", -0.8472978603872037)],- n = 14}}),+ [("time-of-day (latent)", -0.8109302162163288),+ ("hour", -0.8109302162163288)],+ n = 19}}), ("absorption of , after named day", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1354942159291497,@@ -302,143 +303,142 @@ likelihoods = HashMap.fromList [], n = 0}}), ("intersect", Classifier{okData =- ClassData{prior = -0.4131871542020747,- unseen = -5.8289456176102075,+ ClassData{prior = -0.4318772076479415, unseen = -5.877735781779639, likelihoods = HashMap.fromList- [("Onsdagthis <cycle>", -5.1328529268205045),- ("Torsdag<time> timezone", -4.43970574626056),+ [("Onsdagthis <cycle>", -5.181783550292085),+ ("Torsdag<time> timezone", -3.929020581796717), ("<datetime> - <datetime> (interval)on <date>",- -4.034240638152395),+ -4.083171261623976), ("<time-of-day> - <time-of-day> (interval)on <date>",- -4.034240638152395),- ("hourday", -5.1328529268205045),- ("dayhour", -2.8815611282140097),- ("daymonth", -2.992786763324234),- ("monthyear", -3.1179499062782403),+ -4.083171261623976),+ ("hourday", -5.181783550292085), ("dayhour", -2.93049175168559),+ ("daymonth", -3.0417173867958143),+ ("monthyear", -3.1668805297498204), ("Torsdagbetween <time-of-day> and <time-of-day> (interval)",- -5.1328529268205045),- ("Mandagon <date>", -5.1328529268205045),- ("intersecthh:mm", -5.1328529268205045),+ -5.181783550292085),+ ("Mandagon <date>", -5.181783550292085),+ ("yyyy-mm-ddat <time-of-day>", -4.48863636973214),+ ("intersecthh:mm", -5.181783550292085), ("Torsdagbetween <datetime> and <datetime> (interval)",- -5.1328529268205045),- ("Torsdagat <time-of-day>", -4.727387818712341),- ("Marsyear", -5.1328529268205045),+ -5.181783550292085),+ ("Torsdagat <time-of-day>", -4.26549281841793),+ ("Marsyear", -5.181783550292085), ("intersect by \"of\", \"from\", \"'s\"year",- -4.727387818712341),- ("Oktoberyear", -3.5234150143864045),+ -4.77631844218392),+ ("Oktoberyear", -3.572345637857985), ("Torsdagfrom <time-of-day> - <time-of-day> (interval)",- -4.727387818712341),+ -4.77631844218392), ("Torsdagfrom <datetime> - <datetime> (interval)",- -4.727387818712341),- ("last <day-of-week> of <time>year", -5.1328529268205045),- ("todayat <time-of-day>", -4.727387818712341),- ("the <day-of-month> (ordinal)Februari", -5.1328529268205045),- ("dayday", -3.2610507499189136),- ("dd/mmat <time-of-day>", -4.21656219494635),- ("intersect by \",\"hh:mm", -4.21656219494635),- ("dayyear", -3.34109345759245),- ("tomorrow<time-of-day> sharp", -4.727387818712341),+ -4.77631844218392),+ ("last <day-of-week> of <time>year", -5.181783550292085),+ ("todayat <time-of-day>", -4.77631844218392),+ ("the <day-of-month> (ordinal)Februari", -5.181783550292085),+ ("dayday", -3.3099813733904937),+ ("dd/mmat <time-of-day>", -4.26549281841793),+ ("intersect by \",\"hh:mm", -4.26549281841793),+ ("dayyear", -3.39002408106403),+ ("tomorrow<time-of-day> sharp", -4.77631844218392), ("<day-of-month>(ordinal) <named-month>year",- -4.727387818712341),+ -4.77631844218392), ("Onsdag<named-month> <day-of-month> (non ordinal)",- -5.1328529268205045),- ("Onsdagthis <time>", -4.43970574626056),+ -5.181783550292085),+ ("Onsdagthis <time>", -4.48863636973214), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",- -4.034240638152395),- ("tomorrowuntil <time-of-day>", -4.727387818712341),+ -4.083171261623976),+ ("tomorrowuntil <time-of-day>", -4.77631844218392), ("absorption of , after named day<day-of-month> (non ordinal) <named-month>",- -4.43970574626056),- ("after <time-of-day>at <time-of-day>", -4.727387818712341),- ("the <day-of-month> (ordinal)Mars", -4.034240638152395),+ -4.48863636973214),+ ("after <time-of-day>at <time-of-day>", -4.77631844218392),+ ("the <day-of-month> (ordinal)Mars", -4.083171261623976), ("intersect by \",\"<day-of-month> (non ordinal) <named-month>",- -4.727387818712341),- ("Mandagthis <cycle>", -5.1328529268205045),- ("tomorrowafter <time-of-day>", -4.727387818712341),+ -4.77631844218392),+ ("Mandagthis <cycle>", -5.181783550292085),+ ("tomorrowafter <time-of-day>", -4.77631844218392), ("from <time-of-day> - <time-of-day> (interval)on <date>",- -4.21656219494635),- ("dayminute", -2.7814776696570274),+ -4.26549281841793),+ ("dayminute", -2.5076349008655563), ("from <datetime> - <datetime> (interval)on <date>",- -4.43970574626056),- ("on <date>Mars", -4.034240638152395),- ("<ordinal> <cycle> of <time>year", -4.727387818712341),- ("minuteday", -2.5301632413761213),+ -4.48863636973214),+ ("on <date>Mars", -4.083171261623976),+ ("<ordinal> <cycle> of <time>year", -4.77631844218392),+ ("minuteday", -2.5790938648477013), ("absorption of , after named dayintersect",- -5.1328529268205045),- ("yearhh:mm", -5.1328529268205045),- ("Tisdagthis <time>", -4.727387818712341),- ("Onsdagnext <cycle>", -5.1328529268205045),+ -5.181783550292085),+ ("yearhh:mm", -5.181783550292085),+ ("Tisdagthis <time>", -4.77631844218392),+ ("Onsdagnext <cycle>", -5.181783550292085), ("absorption of , after named dayintersect by \",\"",- -4.727387818712341),- ("Sondaglast <cycle>", -5.1328529268205045),- ("dd/mmyear", -4.727387818712341),- ("Septemberyear", -4.21656219494635),- ("at <time-of-day>on <date>", -5.1328529268205045),+ -4.77631844218392),+ ("Sondaglast <cycle>", -5.181783550292085),+ ("dd/mmyear", -4.77631844218392),+ ("Septemberyear", -4.26549281841793),+ ("at <time-of-day>on <date>", -5.181783550292085), ("between <time-of-day> and <time-of-day> (interval)on <date>",- -5.1328529268205045),+ -5.181783550292085), ("between <datetime> and <datetime> (interval)on <date>",- -5.1328529268205045),- ("dayweek", -3.880089958325137),- ("Tisdagthis <cycle>", -5.1328529268205045),- ("on <date>Februari", -5.1328529268205045),- ("weekyear", -4.21656219494635),- ("hh:mmtomorrow", -4.43970574626056),- ("tomorrowat <time-of-day>", -3.880089958325137),- ("at <time-of-day>tomorrow", -4.727387818712341),+ -5.181783550292085),+ ("dayweek", -3.929020581796717),+ ("Tisdagthis <cycle>", -5.181783550292085),+ ("on <date>Februari", -5.181783550292085),+ ("weekyear", -4.26549281841793),+ ("hh:mmtomorrow", -4.48863636973214),+ ("tomorrowat <time-of-day>", -3.929020581796717),+ ("at <time-of-day>tomorrow", -4.77631844218392), ("Sondag<day-of-month> (non ordinal) <named-month>",- -5.1328529268205045),- ("last <cycle> of <time>year", -4.21656219494635),+ -5.181783550292085),+ ("last <cycle> of <time>year", -4.26549281841793), ("<day-of-month> (non ordinal) <named-month>year",- -4.727387818712341),- ("yearminute", -5.1328529268205045)],- n = 129},+ -4.77631844218392),+ ("yearminute", -5.181783550292085)],+ n = 137}, koData =- ClassData{prior = -1.0833448165373212, unseen = -5.365976015021851,+ ClassData{prior = -1.0477930402718967, unseen = -5.442417710521793, likelihoods = HashMap.fromList- [("OnsdagFebruari", -4.66814498514948),- ("dayhour", -3.164067588373206),- ("daymonth", -2.103195627687943),- ("monthday", -3.751854253275325),- ("monthyear", -3.751854253275325),+ [("OnsdagFebruari", -4.74493212836325),+ ("dayhour", -2.7990219793079367),+ ("daymonth", -2.1799827709017134),+ ("monthday", -3.828641396489095),+ ("monthyear", -3.828641396489095), ("Torsdagbetween <time-of-day> and <time-of-day> (interval)",- -4.66814498514948),- ("Mandagon <date>", -4.2626798770413155),+ -4.74493212836325),+ ("Mandagon <date>", -4.339467020255086),+ ("yyyy-mm-ddat <time-of-day>", -4.051784947803305), ("Torsdagbetween <datetime> and <datetime> (interval)",- -4.66814498514948),- ("Torsdagat <time-of-day>", -3.751854253275325),- ("Marsyear", -3.9749978045895347),+ -4.74493212836325),+ ("Torsdagat <time-of-day>", -3.240854731586976),+ ("Marsyear", -4.051784947803305), ("intersect by \"of\", \"from\", \"'s\"year",- -3.56953269648137),+ -3.6463198396951406), ("Torsdagfrom <time-of-day> - <time-of-day> (interval)",- -4.66814498514948),+ -4.74493212836325), ("Torsdagfrom <datetime> - <datetime> (interval)",- -4.2626798770413155),- ("Mandagintersect", -4.2626798770413155),- ("absorption of , after named dayJuli", -4.2626798770413155),- ("hourmonth", -4.2626798770413155),- ("dd/mmat <time-of-day>", -3.751854253275325),- ("dayyear", -3.2818506240295893),+ -4.339467020255086),+ ("Mandagintersect", -4.339467020255086),+ ("absorption of , after named dayJuli", -4.339467020255086),+ ("hourmonth", -4.339467020255086),+ ("dd/mmat <time-of-day>", -3.828641396489095),+ ("dayyear", -3.3586377672433594), ("<named-month> <day-of-month> (non ordinal)Augusti",- -3.751854253275325),+ -3.828641396489095), ("Augusti<day-of-month> (non ordinal) <named-month>",- -3.751854253275325),- ("Onsdagthis <time>", -3.4153820166541116),- ("Aprilyear", -4.66814498514948),- ("yearmonth", -4.66814498514948),- ("until <time-of-day>on <date>", -4.66814498514948),- ("Torsdaghh:mm", -4.66814498514948),- ("dayminute", -3.2818506240295893),- ("minuteday", -3.164067588373206),- ("Tisdagthis <time>", -3.751854253275325),- ("hh:mmon <date>", -3.2818506240295893),- ("on <date>Februari", -4.2626798770413155),- ("absorption of , after named dayFebruari",- -3.9749978045895347),- ("intersectFebruari", -4.2626798770413155),- ("Mandagthis <time>", -4.66814498514948),- ("Sondagthis <time>", -4.2626798770413155)],- n = 66}}),+ -3.828641396489095),+ ("Onsdagthis <time>", -3.492169159867882),+ ("Aprilyear", -4.74493212836325),+ ("yearmonth", -4.74493212836325),+ ("until <time-of-day>on <date>", -4.74493212836325),+ ("Torsdaghh:mm", -4.339467020255086),+ ("dayminute", -3.040184036124825),+ ("minuteday", -3.240854731586976),+ ("Tisdagthis <time>", -3.828641396489095),+ ("hh:mmon <date>", -3.3586377672433594),+ ("on <date>Februari", -4.339467020255086),+ ("absorption of , after named dayFebruari", -4.051784947803305),+ ("intersectFebruari", -4.339467020255086),+ ("Mandagthis <time>", -4.74493212836325),+ ("Sondagthis <time>", -4.339467020255086)],+ n = 74}}), ("<ordinal> <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.890371757896165,@@ -540,8 +540,8 @@ n = 5}}), ("yyyy-mm-dd", Classifier{okData =- ClassData{prior = 0.0, unseen = -1.3862943611198906,- likelihoods = HashMap.fromList [("", 0.0)], n = 2},+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -613,8 +613,8 @@ likelihoods = HashMap.fromList [], n = 0}}), ("Torsdag", Classifier{okData =- ClassData{prior = 0.0, unseen = -2.890371757896165,- likelihoods = HashMap.fromList [("", 0.0)], n = 16},+ ClassData{prior = 0.0, unseen = -3.044522437723423,+ likelihoods = HashMap.fromList [("", 0.0)], n = 19}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}),@@ -729,9 +729,9 @@ ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData =- ClassData{prior = 0.0, unseen = -3.2188758248682006,+ ClassData{prior = 0.0, unseen = -3.4339872044851463, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 23}}),+ n = 29}}), ("in|during the <part-of-day>", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098,@@ -799,6 +799,13 @@ koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.1972245773362196,+ likelihoods = HashMap.fromList [("", 0.0)], n = 7}}), ("afternoon", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098,@@ -865,29 +872,30 @@ n = 2}}), ("time-of-day (latent)", Classifier{okData =- ClassData{prior = -0.8950133334268701, unseen = -3.713572066704308,+ ClassData{prior = -0.9473813189441862, unseen = -3.713572066704308, likelihoods = HashMap.fromList [("integer (numeric)", -5.129329438755058e-2), ("integer (0..19)", -2.995732273553991)], n = 38}, koData =- ClassData{prior = -0.525266307920785, unseen = -4.060443010546419,+ ClassData{prior = -0.4906229164484712, unseen = -4.143134726391533, likelihoods = HashMap.fromList- [("integer (numeric)", -0.2363887780642304),- ("integer (0..19)", -1.55814461804655)],- n = 55}}),+ [("integer (numeric)", -0.21511137961694557),+ ("integer (0..19)", -1.6422277352570913)],+ n = 60}}), ("year", Classifier{okData =- ClassData{prior = -0.14842000511827333,+ ClassData{prior = -0.24686007793152578, unseen = -3.295836866004329, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], n = 25}, koData =- ClassData{prior = -1.9810014688665833, unseen = -1.791759469228055,+ ClassData{prior = -1.5198257537444133,+ unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],- n = 4}}),+ n = 7}}), ("last <day-of-week> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707,@@ -1044,11 +1052,11 @@ n = 5}}), ("hh:mm", Classifier{okData =- ClassData{prior = -2.197890671877523e-2,- unseen = -3.8501476017100584,- likelihoods = HashMap.fromList [("", 0.0)], n = 45},+ ClassData{prior = -1.9418085857101627e-2,+ unseen = -3.970291913552122,+ likelihoods = HashMap.fromList [("", 0.0)], n = 51}, koData =- ClassData{prior = -3.828641396489095, unseen = -1.0986122886681098,+ ClassData{prior = -3.951243718581427, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("quarter after|past <integer> (hour-of-day)", Classifier{okData =
Duckling/Ranking/Classifiers/VI_XX.hs view
@@ -608,6 +608,13 @@ ("quarter (grain)integer (numeric)time-of-day (latent)", -1.0986122886681098)], n = 1}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -2.4849066497880004,+ likelihoods = HashMap.fromList [("", 0.0)], n = 10}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055,
Duckling/Ranking/Classifiers/ZH_CN.hs view
@@ -414,6 +414,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Classifiers/ZH_HK.hs view
@@ -414,6 +414,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Classifiers/ZH_MO.hs view
@@ -414,6 +414,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Classifiers/ZH_TW.hs view
@@ -414,6 +414,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Classifiers/ZH_XX.hs view
@@ -400,6 +400,13 @@ koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}),+ ("fractional number",+ Classifier{okData =+ ClassData{prior = -infinity, unseen = -0.6931471805599453,+ likelihoods = HashMap.fromList [], n = 0},+ koData =+ ClassData{prior = 0.0, unseen = -1.9459101490553135,+ likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("Sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -3.0910424533583156,
Duckling/Ranking/Extraction.hs view
@@ -37,8 +37,8 @@ featRules = Text.concat $ mapMaybe rule (children node) grains = mapMaybe (\x -> case token x of- Token Duration (DurationData {TDuration.grain = g}) -> Just $ showt g- Token Time (TimeData {TTime.timeGrain = g}) -> Just $ showt g+ Token Duration DurationData{TDuration.grain = g} -> Just $ showt g+ Token Time TimeData{TTime.timeGrain = g} -> Just $ showt g Token TimeGrain g -> Just $ showt g _ -> Nothing ) $ children node
Duckling/Ranking/Types.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE NoRebindableSyntax #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Ranking.Types ( Feature
Duckling/Rules.hs view
@@ -28,12 +28,14 @@ import qualified Duckling.Rules.CS as CSRules import qualified Duckling.Rules.DA as DARules import qualified Duckling.Rules.DE as DERules+import qualified Duckling.Rules.EL as ELRules import qualified Duckling.Rules.EN as ENRules import qualified Duckling.Rules.ES as ESRules import qualified Duckling.Rules.ET as ETRules import qualified Duckling.Rules.FR as FRRules import qualified Duckling.Rules.GA as GARules import qualified Duckling.Rules.HE as HERules+import qualified Duckling.Rules.HI as HIRules import qualified Duckling.Rules.HR as HRRules import qualified Duckling.Rules.HU as HURules import qualified Duckling.Rules.ID as IDRules@@ -43,6 +45,7 @@ import qualified Duckling.Rules.KO as KORules import qualified Duckling.Rules.MY as MYRules import qualified Duckling.Rules.NB as NBRules+import qualified Duckling.Rules.NE as NERules import qualified Duckling.Rules.NL as NLRules import qualified Duckling.Rules.PL as PLRules import qualified Duckling.Rules.PT as PTRules@@ -80,12 +83,14 @@ defaultRules CS = CSRules.defaultRules defaultRules DA = DARules.defaultRules defaultRules DE = DERules.defaultRules+defaultRules EL = ELRules.defaultRules defaultRules EN = ENRules.defaultRules defaultRules ES = ESRules.defaultRules defaultRules ET = ETRules.defaultRules defaultRules FR = FRRules.defaultRules defaultRules GA = GARules.defaultRules defaultRules HE = HERules.defaultRules+defaultRules HI = HIRules.defaultRules defaultRules HR = HRRules.defaultRules defaultRules HU = HURules.defaultRules defaultRules ID = IDRules.defaultRules@@ -95,6 +100,7 @@ defaultRules KO = KORules.defaultRules defaultRules MY = MYRules.defaultRules defaultRules NB = NBRules.defaultRules+defaultRules NE = NERules.defaultRules defaultRules NL = NLRules.defaultRules defaultRules PL = PLRules.defaultRules defaultRules PT = PTRules.defaultRules@@ -112,12 +118,14 @@ localeRules CS = CSRules.localeRules localeRules DA = DARules.localeRules localeRules DE = DERules.localeRules+localeRules EL = ELRules.localeRules localeRules EN = ENRules.localeRules localeRules ES = ESRules.localeRules localeRules ET = ETRules.localeRules localeRules FR = FRRules.localeRules localeRules GA = GARules.localeRules localeRules HE = HERules.localeRules+localeRules HI = HIRules.localeRules localeRules HR = HRRules.localeRules localeRules HU = HURules.localeRules localeRules ID = IDRules.localeRules@@ -127,6 +135,7 @@ localeRules KO = KORules.localeRules localeRules MY = MYRules.localeRules localeRules NB = NBRules.localeRules+localeRules NE = NERules.localeRules localeRules NL = NLRules.localeRules localeRules PL = PLRules.localeRules localeRules PT = PTRules.localeRules@@ -144,12 +153,14 @@ langRules CS = CSRules.langRules langRules DA = DARules.langRules langRules DE = DERules.langRules+langRules EL = ELRules.langRules langRules EN = ENRules.langRules langRules ES = ESRules.langRules langRules ET = ETRules.langRules langRules FR = FRRules.langRules langRules GA = GARules.langRules langRules HE = HERules.langRules+langRules HI = HIRules.langRules langRules HR = HRRules.langRules langRules HU = HURules.langRules langRules ID = IDRules.langRules@@ -159,6 +170,7 @@ langRules KO = KORules.langRules langRules MY = MYRules.langRules langRules NB = NBRules.langRules+langRules NE = NERules.langRules langRules NL = NLRules.langRules langRules PL = PLRules.langRules langRules PT = PTRules.langRules
Duckling/Rules/AR.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Rules.AR ( defaultRules , langRules@@ -18,8 +18,15 @@ import Duckling.Dimensions.Types import Duckling.Locale import Duckling.Types+import qualified Duckling.AmountOfMoney.AR.Rules as AmountOfMoney+import qualified Duckling.Duration.AR.Rules as Duration import qualified Duckling.Numeral.AR.Rules as Numeral import qualified Duckling.Ordinal.AR.Rules as Ordinal+import qualified Duckling.Quantity.AR.Rules as Quantity+import qualified Duckling.Temperature.AR.Rules as Temperature+import qualified Duckling.Time.AR.Rules as Time+import qualified Duckling.TimeGrain.AR.Rules as TimeGrain+import qualified Duckling.Volume.AR.Rules as Volume defaultRules :: Some Dimension -> [Rule] defaultRules = langRules@@ -28,17 +35,17 @@ localeRules _ _ = [] langRules :: Some Dimension -> [Rule]-langRules (This AmountOfMoney) = []+langRules (This AmountOfMoney) = AmountOfMoney.rules langRules (This Distance) = []-langRules (This Duration) = []+langRules (This Duration) = Duration.rules langRules (This Email) = [] langRules (This Numeral) = Numeral.rules langRules (This Ordinal) = Ordinal.rules langRules (This PhoneNumber) = []-langRules (This Quantity) = []+langRules (This Quantity) = Quantity.rules langRules (This RegexMatch) = []-langRules (This Temperature) = []-langRules (This Time) = []-langRules (This TimeGrain) = []+langRules (This Temperature) = Temperature.rules+langRules (This Time) = Time.rules+langRules (This TimeGrain) = TimeGrain.rules langRules (This Url) = []-langRules (This Volume) = []+langRules (This Volume) = Volume.rules
Duckling/Rules/BG.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.BG ( defaultRules
Duckling/Rules/CS.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.CS ( defaultRules
Duckling/Rules/Common.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Rules.Common ( rules ) where@@ -19,6 +19,7 @@ import qualified Duckling.Distance.Rules as Distance import qualified Duckling.Duration.Rules as Duration import qualified Duckling.Email.Rules as Email+import qualified Duckling.Numeral.Rules as Numeral import qualified Duckling.PhoneNumber.Rules as PhoneNumber import qualified Duckling.Temperature.Rules as Temperature import qualified Duckling.Url.Rules as Url@@ -29,7 +30,7 @@ rules (This Distance) = Distance.rules rules (This Duration) = Duration.rules rules (This Email) = Email.rules-rules (This Numeral) = []+rules (This Numeral) = Numeral.rules rules (This Ordinal) = [] rules (This PhoneNumber) = PhoneNumber.rules rules (This Quantity) = []
Duckling/Rules/DA.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.DA ( defaultRules
Duckling/Rules/DE.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.DE ( defaultRules
+ Duckling/Rules/EL.hs view
@@ -0,0 +1,47 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+++module Duckling.Rules.EL+ ( defaultRules+ , langRules+ , localeRules+ ) where++import Duckling.Dimensions.Types+import Duckling.Locale+import Duckling.Types+import qualified Duckling.Duration.EL.Rules as Duration+import qualified Duckling.Numeral.EL.Rules as Numeral+import qualified Duckling.Ordinal.EL.Rules as Ordinal+import qualified Duckling.Time.EL.Rules as Time+import qualified Duckling.TimeGrain.EL.Rules as TimeGrain++defaultRules :: Some Dimension -> [Rule]+defaultRules = langRules++localeRules :: Region -> Some Dimension -> [Rule]+localeRules _ _ = []++langRules :: Some Dimension -> [Rule]+langRules (This AmountOfMoney) = []+langRules (This Distance) = []+langRules (This Duration) = Duration.rules+langRules (This Email) = []+langRules (This Numeral) = Numeral.rules+langRules (This Ordinal) = Ordinal.rules+langRules (This PhoneNumber) = []+langRules (This Quantity) = []+langRules (This RegexMatch) = []+langRules (This Temperature) = []+langRules (This Time) = Time.rules+langRules (This TimeGrain) = TimeGrain.rules+langRules (This Url) = []+langRules (This Volume) = []
Duckling/Rules/EN.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Rules.EN ( defaultRules , langRules@@ -29,9 +29,18 @@ import qualified Duckling.Quantity.EN.Rules as Quantity import qualified Duckling.Temperature.EN.Rules as Temperature import qualified Duckling.Time.EN.Rules as Time+import qualified Duckling.Time.EN.AU.Rules as TimeAU+import qualified Duckling.Time.EN.BZ.Rules as TimeBZ import qualified Duckling.Time.EN.CA.Rules as TimeCA import qualified Duckling.Time.EN.GB.Rules as TimeGB+import qualified Duckling.Time.EN.IE.Rules as TimeIE+import qualified Duckling.Time.EN.IN.Rules as TimeIN+import qualified Duckling.Time.EN.JM.Rules as TimeJM+import qualified Duckling.Time.EN.NZ.Rules as TimeNZ+import qualified Duckling.Time.EN.PH.Rules as TimePH+import qualified Duckling.Time.EN.TT.Rules as TimeTT import qualified Duckling.Time.EN.US.Rules as TimeUS+import qualified Duckling.Time.EN.ZA.Rules as TimeZA import qualified Duckling.TimeGrain.EN.Rules as TimeGrain import qualified Duckling.Volume.EN.Rules as Volume @@ -39,14 +48,24 @@ defaultRules dim@(This Time) = [ TimeUS.ruleMMDD , TimeUS.ruleMMDDYYYY+ , TimeUS.ruleMMDDYYYYDot , TimeUS.ruleThanksgiving ] ++ langRules dim defaultRules dim = langRules dim localeRules :: Region -> Some Dimension -> [Rule]+localeRules AU (This Time) = TimeAU.rules+localeRules BZ (This Time) = TimeBZ.rules localeRules CA (This Time) = TimeCA.rules localeRules GB (This Time) = TimeGB.rules+localeRules IE (This Time) = TimeIE.rules+localeRules IN (This Time) = TimeIN.rules+localeRules JM (This Time) = TimeJM.rules+localeRules NZ (This Time) = TimeNZ.rules+localeRules PH (This Time) = TimePH.rules+localeRules TT (This Time) = TimeTT.rules localeRules US (This Time) = TimeUS.rules+localeRules ZA (This Time) = TimeZA.rules localeRules _ _ = [] langRules :: Some Dimension -> [Rule]
Duckling/Rules/ES.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.ES ( defaultRules
Duckling/Rules/ET.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.ET ( defaultRules
Duckling/Rules/FR.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.FR ( defaultRules
Duckling/Rules/GA.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.GA ( defaultRules
Duckling/Rules/HE.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.HE ( defaultRules
+ Duckling/Rules/HI.hs view
@@ -0,0 +1,43 @@+--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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}++module Duckling.Rules.HI+ ( defaultRules+ , langRules+ , localeRules+ ) where++import Duckling.Dimensions.Types+import Duckling.Locale+import Duckling.Types+import qualified Duckling.Numeral.HI.Rules as Numeral+import qualified Duckling.Ordinal.HI.Rules as Ordinal++defaultRules :: Some Dimension -> [Rule]+defaultRules = langRules++localeRules :: Region -> Some Dimension -> [Rule]+localeRules _ _ = []++langRules :: Some Dimension -> [Rule]+langRules (This AmountOfMoney) = []+langRules (This Distance) = []+langRules (This Duration) = []+langRules (This Numeral) = Numeral.rules+langRules (This Email) = []+langRules (This Ordinal) = Ordinal.rules+langRules (This PhoneNumber) = []+langRules (This Quantity) = []+langRules (This RegexMatch) = []+langRules (This Temperature) = []+langRules (This Time) = []+langRules (This TimeGrain) = []+langRules (This Url) = []+langRules (This Volume) = []
Duckling/Rules/HR.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.HR ( defaultRules
Duckling/Rules/HU.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.HU ( defaultRules
Duckling/Rules/ID.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.ID ( defaultRules
Duckling/Rules/IT.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.IT ( defaultRules
Duckling/Rules/JA.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.JA ( defaultRules
Duckling/Rules/KA.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.KA ( defaultRules
Duckling/Rules/KO.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.KO ( defaultRules
Duckling/Rules/MY.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.MY ( defaultRules
Duckling/Rules/NB.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.NB ( defaultRules
+ Duckling/Rules/NE.hs view
@@ -0,0 +1,42 @@+--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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}++module Duckling.Rules.NE+ ( defaultRules+ , langRules+ , localeRules+ ) where++import Duckling.Dimensions.Types+import Duckling.Locale+import Duckling.Types+import qualified Duckling.Numeral.NE.Rules as Numeral++defaultRules :: Some Dimension -> [Rule]+defaultRules = langRules++localeRules :: Region -> Some Dimension -> [Rule]+localeRules _ _ = []++langRules :: Some Dimension -> [Rule]+langRules (This AmountOfMoney) = []+langRules (This Distance) = []+langRules (This Duration) = []+langRules (This Numeral) = Numeral.rules+langRules (This Email) = []+langRules (This Ordinal) = []+langRules (This PhoneNumber) = []+langRules (This Quantity) = []+langRules (This RegexMatch) = []+langRules (This Temperature) = []+langRules (This Time) = []+langRules (This TimeGrain) = []+langRules (This Url) = []+langRules (This Volume) = []
Duckling/Rules/NL.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Rules.NL ( defaultRules , langRules@@ -22,6 +22,7 @@ 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.Time.NL.Rules as Time import qualified Duckling.TimeGrain.NL.Rules as TimeGrain import qualified Duckling.Volume.NL.Rules as Volume @@ -42,7 +43,7 @@ langRules (This Quantity) = [] langRules (This RegexMatch) = [] langRules (This Temperature) = []-langRules (This Time) = []+langRules (This Time) = Time.rules langRules (This TimeGrain) = TimeGrain.rules langRules (This Url) = [] langRules (This Volume) = Volume.rules
Duckling/Rules/PL.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.PL ( defaultRules
Duckling/Rules/PT.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.PT ( defaultRules
Duckling/Rules/RO.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.RO ( defaultRules
Duckling/Rules/RU.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Rules.RU ( defaultRules , langRules@@ -18,8 +18,14 @@ import Duckling.Dimensions.Types import Duckling.Locale import Duckling.Types+import qualified Duckling.AmountOfMoney.RU.Rules as AmountOfMoney+import qualified Duckling.Distance.RU.Rules as Distance+import qualified Duckling.Duration.RU.Rules as Duration import qualified Duckling.Numeral.RU.Rules as Numeral import qualified Duckling.Ordinal.RU.Rules as Ordinal+import qualified Duckling.Quantity.RU.Rules as Quantity+import qualified Duckling.TimeGrain.RU.Rules as TimeGrain+import qualified Duckling.Volume.RU.Rules as Volume defaultRules :: Some Dimension -> [Rule] defaultRules = langRules@@ -28,17 +34,17 @@ localeRules _ _ = [] langRules :: Some Dimension -> [Rule]-langRules (This AmountOfMoney) = []-langRules (This Distance) = []-langRules (This Duration) = []+langRules (This AmountOfMoney) = AmountOfMoney.rules+langRules (This Distance) = Distance.rules+langRules (This Duration) = Duration.rules langRules (This Email) = [] langRules (This Numeral) = Numeral.rules langRules (This Ordinal) = Ordinal.rules langRules (This PhoneNumber) = []-langRules (This Quantity) = []+langRules (This Quantity) = Quantity.rules langRules (This RegexMatch) = [] langRules (This Temperature) = [] langRules (This Time) = []-langRules (This TimeGrain) = []+langRules (This TimeGrain) = TimeGrain.rules langRules (This Url) = []-langRules (This Volume) = []+langRules (This Volume) = Volume.rules
Duckling/Rules/SV.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.SV ( defaultRules
Duckling/Rules/TR.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.TR ( defaultRules
Duckling/Rules/UK.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.UK ( defaultRules
Duckling/Rules/VI.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.VI ( defaultRules
Duckling/Rules/ZH.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Rules.ZH ( defaultRules
+ Duckling/Temperature/AR/Corpus.hs view
@@ -0,0 +1,50 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Temperature.AR.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Temperature.Types+import Duckling.Testing.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale AR Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (TemperatureValue Celsius 37)+ [ "37° سلزيوس"+ , "37 ° سلزيوس"+ , "37 درجة سلزيوس"+ , "سبع وثلاثون سلزيوس"+ ]+ , examples (TemperatureValue Fahrenheit 70)+ [ "70° فهرنهايت"+ , "70 درجة فهرنهايت"+ , "سبعون فهرنهايت"+ ]+ , examples (TemperatureValue Degree 45)+ [ "45°"+ , "45 درجة"+ , "45 درجه مئوية"+ ]+ , examples (TemperatureValue Degree (-2))+ [ "-2°"+ , "- 2 درجة"+ , "درجتين تحت الصفر"+ , "2 تحت الصفر"+ ]+ ]
+ Duckling/Temperature/AR/Rules.hs view
@@ -0,0 +1,100 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Temperature.AR.Rules+ ( rules+ ) where++import Data.Maybe+import Data.String+import Prelude++import Duckling.Dimensions.Types+import Duckling.Temperature.Helpers+import Duckling.Temperature.Types (TemperatureData(..))+import Duckling.Types+import qualified Duckling.Temperature.Types as TTemperature++ruleTemperatureDegrees :: Rule+ruleTemperatureDegrees = Rule+ { name = "<latent temp> degrees"+ , pattern =+ [ dimension Temperature+ , regex "(درج([ةه]|ات)( مئوي[ةه])?)|°"+ ]+ , prod = \tokens -> case tokens of+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Degree td+ _ -> Nothing+ }++ruleTemperatureTwoDegrees :: Rule+ruleTemperatureTwoDegrees = Rule+ { name = "two degrees"+ , pattern =+ [ regex "درجت(ين|ان)"+ ]+ , prod = \_ -> Just . Token Temperature $ TemperatureData+ { TTemperature.unit = Nothing+ , TTemperature.value = 2+ }+ }++ruleTemperatureCelsius :: Rule+ruleTemperatureCelsius = Rule+ { name = "<temp> Celsius"+ , pattern =+ [ dimension Temperature+ , regex "(درج([ةه]|ات) )?سي?لي?[سز]ي?وس"+ ]+ , prod = \tokens -> case tokens of+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Celsius td+ _ -> Nothing+ }++ruleTemperatureFahrenheit :: Rule+ruleTemperatureFahrenheit = Rule+ { name = "<temp> Fahrenheit"+ , pattern =+ [ dimension Temperature+ , regex "(درج([ةه]|ات) )?ف(ا|ي)?هرنها?يت"+ ]+ , prod = \tokens -> case tokens of+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Fahrenheit td+ _ -> Nothing+ }++ruleTemperatureBelowZero :: Rule+ruleTemperatureBelowZero = Rule+ { name = "<temp> below zero"+ , pattern =+ [ dimension Temperature+ , regex "تحت الصفر"+ ]+ , prod = \tokens -> case tokens of+ (Token Temperature td@TemperatureData {TTemperature.value = v}:+ _) -> case TTemperature.unit td of+ Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $+ td {TTemperature.value = - v}+ _ -> Just . Token Temperature $ td {TTemperature.value = - v}+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleTemperatureDegrees+ , ruleTemperatureTwoDegrees+ , ruleTemperatureCelsius+ , ruleTemperatureFahrenheit+ , ruleTemperatureBelowZero+ ]
Duckling/Temperature/EN/Corpus.hs view
@@ -9,10 +9,11 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Temperature.EN.Corpus- ( corpus ) where+ ( corpus+ ) where -import Prelude import Data.String+import Prelude import Duckling.Temperature.Types import Duckling.Testing.Types
Duckling/Temperature/EN/Rules.hs view
@@ -10,17 +10,18 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Temperature.EN.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe-import Prelude import Data.String+import Prelude import Duckling.Dimensions.Types import Duckling.Temperature.Helpers-import qualified Duckling.Temperature.Types as TTemperature import Duckling.Temperature.Types (TemperatureData(..)) import Duckling.Types+import qualified Duckling.Temperature.Types as TTemperature ruleTemperatureDegrees :: Rule ruleTemperatureDegrees = Rule@@ -30,9 +31,9 @@ , regex "(deg(ree?)?s?\\.?)|°" ] , prod = \tokens -> case tokens of- (Token Temperature td:_) -> Just . Token Temperature $- withUnit TTemperature.Degree td- _ -> Nothing+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Degree td+ _ -> Nothing } ruleTemperatureCelsius :: Rule@@ -43,9 +44,9 @@ , regex "c(el[cs]?(ius)?)?\\.?" ] , prod = \tokens -> case tokens of- (Token Temperature td:_) -> Just . Token Temperature $- withUnit TTemperature.Celsius td- _ -> Nothing+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Celsius td+ _ -> Nothing } ruleTemperatureFahrenheit :: Rule@@ -56,9 +57,9 @@ , regex "f(ah?rh?eh?n(h?eit)?)?\\.?" ] , prod = \tokens -> case tokens of- (Token Temperature td:_) -> Just . Token Temperature $- withUnit TTemperature.Fahrenheit td- _ -> Nothing+ (Token Temperature td:_) -> Just . Token Temperature $+ withUnit TTemperature.Fahrenheit td+ _ -> Nothing } ruleTemperatureBelowZero :: Rule@@ -69,11 +70,11 @@ , regex "below zero" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->- case TTemperature.unit td of- Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $- td {TTemperature.value = - v}- _ -> Just . Token Temperature $ td {TTemperature.value = - v}+ (Token Temperature td@TemperatureData {TTemperature.value = v}:+ _) -> case TTemperature.unit td of+ Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $+ td {TTemperature.value = - v}+ _ -> Just . Token Temperature $ td {TTemperature.value = - v} _ -> Nothing }
Duckling/Temperature/ES/Rules.hs view
@@ -68,7 +68,7 @@ , regex "bajo cero" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}
Duckling/Temperature/FR/Rules.hs view
@@ -68,7 +68,7 @@ , regex "en dessous de (0|z(é|e)ro)" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}
Duckling/Temperature/GA/Rules.hs view
@@ -68,7 +68,7 @@ , regex "faoi bhun (0|n(a|á)id)" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}
Duckling/Temperature/Helpers.hs view
@@ -7,8 +7,8 @@ {-# LANGUAGE GADTs #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Temperature.Helpers ( isLatent , withUnit@@ -26,7 +26,7 @@ -- Patterns isLatent :: Predicate-isLatent (Token Temperature (TemperatureData {TTemperature.unit = Nothing})) =+isLatent (Token Temperature TemperatureData{TTemperature.unit = Nothing}) = True isLatent _ = False
Duckling/Temperature/PT/Rules.hs view
@@ -68,7 +68,7 @@ , regex "((graus?)|°)?( abaixo (de)? zero)" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}
Duckling/Temperature/TR/Rules.hs view
@@ -69,7 +69,7 @@ , dimension Temperature ] , prod = \tokens -> case tokens of- (_:Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (_:Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}@@ -85,7 +85,7 @@ , regex "s\305f\305r\305n alt\305nda" ] , prod = \tokens -> case tokens of- (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->+ (Token Temperature td@TemperatureData{TTemperature.value = v}:_) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = - v}
Duckling/Testing/Types.hs view
@@ -44,10 +44,10 @@ examplesCustom check = map (, check) simpleCheck :: ToJSON a => a -> TestPredicate-simpleCheck json _ (Resolved {jsonValue = v}) = toJSON json == v+simpleCheck json _ Resolved{jsonValue = v} = toJSON json == v parserCheck :: Eq a => a -> (Value -> Maybe a) -> TestPredicate-parserCheck expected parse _ (Resolved {jsonValue = v}) =+parserCheck expected parse _ Resolved{jsonValue = v} = maybe False (expected ==) $ parse v examples :: ToJSON a => a -> [Text] -> [Example]
+ Duckling/Time/AR/Corpus.hs view
@@ -0,0 +1,332 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.AR.Corpus+ ( corpus+ , negativeCorpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)+import Duckling.Testing.Types hiding (examples)++context :: Context+context = testContext {locale = makeLocale AR Nothing}++corpus :: Corpus+corpus = (context, allExamples)++negativeCorpus :: NegativeCorpus+negativeCorpus = (context, examples)+ where+ examples =+ [ "حب"+ ]++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 12, 4, 30, 0) Second)+ [ "حالا"+ , "الان"+ , "في هذه اللحظة"+ ]+ , examples (datetime (2013, 2, 12, 0, 0, 0) Day)+ [ "اليوم"+ , "في هذا اليوم"+ ]+ , examples (datetime (2013, 2, 1, 0, 0, 0) Day)+ [ "2/2013"+ , "الاول من شهر شباط"+ , "الاول من شباط"+ , "في اول شباط"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Day)+ [ "امس"+ , "البارحة"+ , "اليوم الماضي"+ , "اليوم السابق"+ , "اليوم المنصرم"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "غدا"+ , "بكرة"+ , "يوم غد"+ , "بكرا"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "الاثنين"+ , "هذا الاثنين"+ , "يوم الاثنين في 18 شباط"+ , "الاثنين 18 شباط"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "الثلاثاء"+ , "الثلاثاء التاسع عشر من هذا الشهر"+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "الجمعة"+ , "الجمعه"+ , "يوم الجمعة 15 شباط"+ ]+ , examples (datetime (2013, 8, 15, 0, 0, 0) Day)+ [ "الخميس 15 اغسطس"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "الخميس"+ , "الخميس الموافق 14 شهر شباط"+ ]+ , examples (datetime (2013, 2, 16, 0, 0, 0) Day)+ [ "السبت"+ , "السبت السادس عشر"+ ]+ , examples (datetime (2013, 2, 17, 0, 0, 0) Day)+ [ "الاحد"+ , "الأحد السابع عشرة"+ ]+ , examples (datetime (2013, 3, 15, 0, 0, 0) Day)+ [ "نص شهر ثلاث"+ , "منتصف اذار"+ , "في نصف شهر مارس"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "الاول من اذار"+ , "1 مارس"+ , "في الاول من مارس"+ , "اليوم الاول من شهر ثلاثة"+ , "بداية شهر 3"+ ]+ , examples (datetime (2013, 4, 4, 0, 0, 0) Day)+ [ "الرابع من ابريل"+ , "الرابع من نيسان"+ , "4 ابريل"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "الثلاثاء القادم"+ , "قرابة الثلاثاء القادم"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "الاربعاء، 13 شباط"+ , "الثالث عشرة من شباط"+ , "الاربعاء الموافق الثالث عشر من شباط 2013"+ ]+ , examples (datetime (2013, 2, 4, 0, 0, 0) Week)+ [ "الاسبوع الماضي"+ , "الاسبوع السابق"+ , "الاسبوع المنصرم"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Week)+ [ "هذا الاسبوع"+ , "الاسبوع الحالي"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Week)+ [ "الاسبوع القادم"+ , "الاسبوع التالي"+ , "الاسبوع المقبل"+ , "الاسبوع الجاي"+ ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Month)+ [ "الشهر الماض" ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Month)+ [ "الشهر التالي" ]+ , examples (datetime (2012, 1, 1, 0, 0, 0) Year)+ [ "السنة السابقة" ]+ , examples (datetime (2014, 1, 1, 0, 0, 0) Year)+ [ "السنة القادمة" ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Year)+ [ "السنة الحالية"+ , "هذه السنة"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "الاحد الماضي"+ , "احد الاسبوع الماضي"+ , "الاحد من الاسبوع الماضي"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Day)+ [ "اثنين الاسبوع الحالي"+ , "الاثنين من هذا الاسبوع"+ ]+ , examples (datetime (2013, 2, 5, 0, 0, 0) Day)+ [ "الثلاثاء الماضي"+ , "يوم الثلاثاء السابق"+ , "ثلاثاء الاسبوع الفائت"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "يوم بعد غد"+ , "اليوم الذي بعد الغد"+ , "اليوم الي بعد بكرة"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "يوم قبل امس"+ , "اليوم القبل البارحة"+ , "اليوم الي قبل امبارح"+ ]+ , examples (datetime (2013, 3, 25, 0, 0, 0) Day)+ [ "اخر اثنين من شهر اذار"+ , "الاثنين الاخير من شهر ثلاثة"+ , "اخر اثنين من الشهر القادم"+ ]+ , examples (datetime (2014, 3, 25, 0, 0, 0) Day)+ [ "الثلاثاء الاخير من شهر مارس السنة القادمة" ]+ , examples (datetime (2013, 10, 3, 0, 0, 0) Day)+ [ "اليوم الثالث من اكتوبر"+ , "اليوم الثالث من شهر عشرة"+ , "ثالث يوم من شهر عشرة"+ ]+ , examples (datetime (2014, 10, 6, 0, 0, 0) Week)+ [ "اول اسبوع بشهر اكتوبر 2014"+ , "الاسبوع الاول من شهر عشرة 2014"+ ]+ , examples (datetime (2015, 10, 31, 0, 0, 0) Day)+ [ "اخر يوم بشهر عشرة سنة 2015"+ , "اليوم الاخير من شهر عشرة سنة 2015"+ ]+ , examples (datetime (2014, 9, 22, 0, 0, 0) Week)+ [ "اخر اسبوع في سبتمبر لعام 2014"+ , "الاسبوع الاخير في الشهر التاسع سنة 2014"+ ]+ , examples (datetime (2013, 10, 1, 0, 0, 0) Day)+ [ "اول ثلاثاء من شهر عشرة"+ , "الثلاثاء الأولى من اكتوبر"+ , "الثلاثا الاول من شهر تشرين الاول"+ ]+ , examples (datetime (2014, 9, 16, 0, 0, 0) Day)+ [ "الثلاثاء الثالث من شهر ايلول من عام 2014"+ , "ثالث يوم ثلاثاء بايلول بعام 2014"+ , "ثالث ثلاثاء في ايلول في سنة 2014"+ ]+ , examples (datetime (2014, 10, 8, 0, 0, 0) Day)+ [ "ثاني اربعاء من شهر اكتوبر من عام 2014"+ , "ثان اربعا في اكتوبر لعام 2014"+ , "الاربعاء الثانية من شهر اكتوبر في سنة 2014"+ ]+ , examples (datetime (2015, 1, 13, 0, 0, 0) Day)+ [ "ثالث ثلاثاء بعد كريسماس 2014"+ ]+ , examples (datetime (2013, 2, 12, 3, 0, 0) Hour)+ [ "الساعة 3 صباحا"+ , "الساعة ثلاثة الصبح"+ , "عند الساعة الثالثة صباحا"+ , "الساعة 3 الفجر"+ , "الثالثة فجرا"+ ]+ , examples (datetime (2013, 2, 12, 3, 18, 0) Minute)+ [ "3:18 صباحا"+ , "الساعة ثلاثة وثمانية عشرة دقيقة صباحا"+ , "الساعة الثالثة و18 دقيقة الصبح"+ , "الساعة 3 و 18 دقيقة صباحا"+ , "عند الثالثة وثمانية عشر دقيقة صباحا"+ ]+ , examples (datetime (2013, 2, 12, 15, 0, 0) Hour)+ [ "الساعة الثالثة عصرا"+ , "بحدود الساعة الثالثة"+ , "حوالي الساعة 3"+ , "الساعة 3 بعد الظهر"+ , "الساعة 3 عصرا"+ , "الساعة 3 العصر"+ ]+ , examples (datetime (2013, 2, 12, 15, 15, 0) Minute)+ [ "الساعة 3 و15 دقيقة عصرا"+ , "الساعة الثالثة وربع العصر"+ , "الثالثة وربع بعد الظهر"+ , "15:15"+ , "الساعة الثالثة وخمسة عشر دقيقة عصرا"+ ]+ , examples (datetime (2013, 2, 12, 15, 20, 0) Minute)+ [ "الساعة ثلاثة وثلث مساءا"+ , "3:20 عصرا"+ ]+ , examples (datetime (2013, 2, 12, 12, 30, 0) Minute)+ [ "الساعة الثانية عشرة ونصف ظهرا"+ , "12:30"+ , "12:30 ظهرا"+ ]+ , examples (datetime (2013, 2, 12, 15, 23, 24) Second)+ [ "15:23:24"+ ]+ , examples (datetime (2013, 2, 12, 11, 45, 0) Minute)+ [ "الساعة 11:45 قبل الظهر"+ , "الساعة 12 الا ربع قبل الظهر"+ , "الساعة الحادية عشر وخمس واربعون دقيقة صباحا"+ , "الساعة الثانية عشر إلا ربعا هذا الصباح"+ ]+ , examples (datetime (2013, 2, 12, 16, 40, 0) Minute)+ [ "الساعة الخامسة الا ثلث بعد العصر"+ , "الساعة خمسة إلا ثلث قبل المغرب"+ , "الساعة الرابعة واربعون دقيقة بعد العصر"+ ]+ , examples (datetime (2013, 2, 12, 20, 0, 0) Hour)+ [ "الساعة 8 بعد المغرب"+ , "الساعة 8 العشاء"+ , "الثامنة هذه الليلة"+ ]+ , examples (datetime (2013, 2, 14, 6, 0, 0) Minute)+ [ "الخميس الساعة 8 بتوقيت GMT"+ , "الخميس الساعة 8 بتوقيت gmt"+ ]+ , examples (datetime (2013, 9, 21, 13, 30, 0) Minute)+ [ "يوم السبت 21/09 الساعة 1:30 بعد الظهر"+ ]+ , examples (datetime (2013, 2, 12, 4, 23, 0) Minute)+ [ "الساعة الرابعة وثلاث وعشرون دقيقة فجرا"+ , "الساعة 4:23 الصبح"+ ]+ , examples (datetimeInterval ((2013, 3, 1, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Day)+ [ "في اوائل اذار"+ , "في أوائل شهر مارس"+ ]+ , examples (datetimeInterval ((2013, 3, 21, 0, 0, 0), (2013, 4, 1, 0, 0, 0)) Day)+ [ "في اواخر اذار"+ , "في أواخر شهر مارس"+ ]+ , examples (datetimeInterval ((2013, 2, 18, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Week)+ [ "الاسابيع الثلاثة القادمة"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 15, 0, 0), (2013, 2, 12, 17, 0, 0)) Hour)+ [ "من الساعة 3 الى الساعة 4 بعد العصر"+ , "من الساعة الثالثة الى الساعة الرابعة مساءا"+ ]+ , examples (datetimeInterval ((2013, 2, 14, 9, 0, 0), (2013, 2, 14, 12, 0, 0)) Hour)+ [ "الخميس من الساعة التاسعة وحتى الساعة الحادية عشرة صباحا"+ ]+ , examples (datetimeInterval ((2013, 7, 13, 0, 0, 0), (2013, 7, 16, 0, 0, 0)) Day)+ [ "يوليو 13-15"+ , "تموز 13 الى 15"+ , "13 الى 15 تموز"+ , "من 13 تموز الى 15 تموز"+ , "من 13 الى 15 يوليو"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 12, 14, 0, 0)) Second)+ [ "حتى الساعة 2:00"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 18, 0, 0), (2013, 2, 13, 0, 0, 0)) Hour)+ [ "هذه الليلة"+ , "الليلة"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 26, 0, 0, 0)) Second)+ [ "خلال اسبوعين"+ ]+ , examples (datetimeInterval ((2013, 9, 1, 0, 0, 0), (2013, 9, 9, 0, 0, 0)) Day)+ [ "من 1-8 شهر ايلول"+ ]+ , examples (datetimeInterval ((2013, 10, 23, 0, 0, 0), (2013, 10, 27, 0, 0, 0)) Day)+ [ "من الثالث والعشرون وحتى السادس والعشرين من شهر اكتوبر"+ ]+ , examples (datetimeInterval ((2013, 8, 27, 0, 0, 0), (2013, 8, 30, 0, 0, 0)) Day)+ [ "اغسطس 27 الى 29"+ , "من 27-29 من الشهر الثامن"+ ]++ ]
+ Duckling/Time/AR/Rules.hs view
@@ -0,0 +1,1836 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.AR.Rules+ ( rules+ ) where++import Data.Maybe+import Data.Text (Text)+import Prelude+import Data.HashMap.Strict ( HashMap)+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers (duration)+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Ordinal.Types (OrdinalData (..))+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.Ordinal.Types as TOrdinal+import qualified Duckling.Time.Types as TTime+import qualified Duckling.TimeGrain.Types as TG++ruleIntersect :: Rule+ruleIntersect = Rule+ { name = "intersect"+ , pattern =+ [ Predicate isNotLatent+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Time td2:_) -> Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleIntersectOf :: Rule+ruleIntersectOf = Rule+ { name = "intersect by \",\", \"of\", \"from\", \"'s\""+ , pattern =+ [ Predicate isNotLatent+ , regex "من|,|،|لـ?|بـ?|الموافق( ل)?"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) -> Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleAbsorbOnTime :: Rule+ruleAbsorbOnTime = Rule+ { name = "on <date>"+ , pattern =+ [ regex "في"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleAbsorbOnADOW :: Rule+ruleAbsorbOnADOW = Rule+ { name = "on a <named-day>"+ , pattern =+ [ regex "يوم"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleAbsorbInMonth :: Rule+ruleAbsorbInMonth = Rule+ { name = "in <named-month>"+ , pattern =+ [ regex "شهر"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Just token+ _ -> Nothing+ }++ruleAbsorbCommaTOD :: Rule+ruleAbsorbCommaTOD = Rule+ { name = "absorption of , after named day"+ , pattern =+ [ Predicate isADayOfWeek+ , regex "[,،]"+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> Just token+ _ -> Nothing+ }++instants :: [(Text, String, TG.Grain, Int)]+instants =+ [ ("right now", "الان|حالا|(في )?هذه اللحظ[ةه]", TG.Second, 0)+ , ("today", "اليوم", TG.Day, 0)+ , ("tomorrow", "((يوم )?(غدا?|الغد))|(بكر[اةه])", TG.Day, 1)+ -- TODO: add regex for more variation of yesterday+ , ("yesterday", "[أا]مس|(ال|ام)بارح[ةه]?", TG.Day, - 1)+ , ("end of month", "(نهاي[ةه] الشهر)", TG.Month, 1)+ , ("end of year", "(نهاي[ةه] (السن[ةه]|العام))", TG.Year, 1)+ ]++ruleInstants :: [Rule]+ruleInstants = map go instants+ where+ go (name, regexPattern, grain, n) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> tt $ cycleNth grain n+ }++ruleNow :: Rule+ruleNow = Rule+ { name = "now"+ , pattern =+ [ regex "ال[اآ]ن|حالا"+ ]+ , prod = \_ -> tt now+ }++ruleThisDOW :: Rule+ruleThisDOW = Rule+ { name = "this <day-of-week>"+ , pattern =+ [ regex "هذا"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleDOWNext :: Rule+ruleDOWNext = Rule+ { name = "<day-of-week> next"+ , pattern =+ [ Predicate isADayOfWeek+ , regex "القادم|التالي|ال[آا]تي?|القادم"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleDOWLast :: Rule+ruleDOWLast = Rule+ { name = "<day-of-week> last"+ , pattern =+ [ Predicate isADayOfWeek+ , regex "السابق|الماضي|المنصرم|الفا[يئ]ت"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ predNth (- 1) True td+ _ -> Nothing+ }++ruleThisTime :: Rule+ruleThisTime = Rule+ { name = "this <time>"+ , pattern =+ [ regex "هذا"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 False td+ _ -> Nothing+ }++ruleNextTime :: Rule+ruleNextTime = Rule+ { name = "<time> next"+ , pattern =+ [ Predicate isNotLatent+ , regex "التالي"+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleLastTime :: Rule+ruleLastTime = Rule+ { name = "last <time>"+ , pattern =+ [ regex "([اآ]خر)"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth (- 1) False td+ _ -> Nothing+ }++-- to match 'عام سابق', 'عامان سابقان' or 'سابقة' and the same for 'منصرم' and 'ماضي'+ruleLastTime2 :: Rule+ruleLastTime2 = Rule+ { name = "<time> last"+ , pattern =+ [ Predicate isNotLatent+ , regex "((ال)?ماضيت?(ان|ين|ة|ه)?|(ال)?منصرمت?(ان|ين|ة|ه)?|(ال)?سابقت?(ان|ين|ة|ه)?)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ predNth (- 1) False td+ _ -> Nothing+ }++ruleLastDOWOfTime :: Rule+ruleLastDOWOfTime = Rule+ { name = "last <day-of-week> of <time>"+ , pattern =+ [ regex "[اآ]خر"+ , Predicate isADayOfWeek+ , regex "من|في"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ tt $ predLastOf td1 td2+ _ -> Nothing+ }++ruleDOWTheLastOfTime :: Rule+ruleDOWTheLastOfTime = Rule+ { name = "<day-of-week> the last of <time>"+ , pattern =+ [ Predicate isADayOfWeek+ , regex "(ال[اأآ]خي?رة?) (من|في|ب|ل)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ tt $ predLastOf td1 td2+ _ -> Nothing+ }++ruleLastCycleOfTime :: Rule+ruleLastCycleOfTime = Rule+ { name = "last <cycle> of <time>"+ , pattern =+ [ regex "[اآ]خر"+ , dimension TimeGrain+ , regex "(من|في|ل|ب)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleLastOf grain td+ _ -> Nothing+ }++ruleCycleLastOfTime :: Rule+ruleCycleLastOfTime = Rule+ { name = "<cycle> last of <time>"+ , pattern =+ [ regex "ال"+ , dimension TimeGrain+ , regex "ال[اأ]خيرة? (من|في|ل|ب)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleLastOf grain td+ _ -> Nothing+ }++ruleNthTimeOfTime :: Rule+ruleNthTimeOfTime = Rule+ { name = "nth <time> of <time>"+ , pattern =+ [ dimension Ordinal+ , dimension Time+ , regex "في|من|ب"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:Token Time td1:_:Token Time td2:_) -> Token Time .+ predNth (TOrdinal.value od - 1) False <$> intersect td2 td1+ _ -> Nothing+ }++ruleTimeNthOfTime :: Rule+ruleTimeNthOfTime = Rule+ { name = "<time> nth of <time>"+ , pattern =+ [ dimension Time+ , dimension Ordinal+ , regex "من|في"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Ordinal od:_:Token Time td2:_) -> Token Time .+ predNth (TOrdinal.value od - 1) False <$> intersect td2 td1+ _ -> Nothing+ }++ruleNthTimeAfterTime :: Rule+ruleNthTimeAfterTime = Rule+ { name = "nth <time> after <time>"+ , pattern =+ [ dimension Ordinal+ , dimension Time+ , regex "بعد"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:Token Time td1:_:Token Time td2:_) ->+ tt $ predNthAfter (TOrdinal.value od - 1) td1 td2+ _ -> Nothing+ }++ruleTimeNthAfterTime :: Rule+ruleTimeNthAfterTime = Rule+ { name = "<time> nth after <time>"+ , pattern =+ [ dimension Time+ , dimension Ordinal+ , regex "بعد"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Ordinal od:_:Token Time td2:_) ->+ tt $ predNthAfter (TOrdinal.value od - 1) td1 td2+ _ -> Nothing+ }++ruleYear :: Rule+ruleYear = Rule+ { name = "year"+ , pattern = [Predicate $ isIntegerBetween 1000 2100]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt $ year n+ _ -> Nothing+ }++ruleYearPastLatent :: Rule+ruleYearPastLatent = Rule+ { name = "past year (latent)"+ , pattern =+ [ Predicate $+ or . sequence [isIntegerBetween (- 10000) 0, isIntegerBetween 25 999]+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ year n+ _ -> Nothing+ }++ruleYearFutureLatent :: Rule+ruleYearFutureLatent = Rule+ { name = "future year (latent)"+ , pattern = [Predicate $ isIntegerBetween 2101 10000]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ year n+ _ -> Nothing+ }++ruleDOMLatent :: Rule+ruleDOMLatent = Rule+ { name = "<day-of-month> (ordinal)"+ , pattern = [Predicate isDOMOrdinal]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ dayOfMonth n+ _ -> Nothing+ }++ruleNamedDOMOrdinal :: Rule+ruleNamedDOMOrdinal = Rule+ { name = "<named-month>|<named-day> <day-of-month> (ordinal)"+ , pattern =+ [ Predicate $ or . sequence [isAMonth, isADayOfWeek]+ , Predicate isDOMOrdinal+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleMonthDOMNumeral :: Rule+ruleMonthDOMNumeral = Rule+ { name = "<named-month> <day-of-month> (non ordinal)"+ , pattern =+ [ Predicate isAMonth+ , Predicate isDOMInteger+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleDOMOfMonth :: Rule+ruleDOMOfMonth = Rule+ { name = "<day-of-month> (ordinal or number) of <named-month>"+ , pattern =+ [ Predicate isDOMValue+ , regex "(من|في|بـ?)"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token:_:Token Time td:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleDOMMonth :: Rule+ruleDOMMonth = Rule+ { name = "<day-of-month> (ordinal or number) <named-month>"+ , pattern =+ [ Predicate isDOMValue+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token:Token Time td:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleDOMOrdinalMonthYear :: Rule+ruleDOMOrdinalMonthYear = Rule+ { name = "<day-of-month>(ordinal) <named-month> year"+ , pattern =+ [ Predicate isDOMOrdinal+ , Predicate isAMonth+ , regex "(\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (token:Token Time td:Token RegexMatch (GroupMatch (match:_)):_) -> do+ intVal <- parseInt match+ dom <- intersectDOM td token+ Token Time <$> intersect dom (year intVal)+ _ -> Nothing+ }++ruleDOMOrdinalDayMonthYear :: Rule+ruleDOMOrdinalDayMonthYear = Rule+ { name = "<day-of-month>(ordinal) <named-month> year"+ , pattern =+ [ Predicate isDOMOrdinal+ , regex "يوم( من| في| بـ?)?"+ , Predicate isAMonth+ , regex "(\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (token:_:Token Time td:Token RegexMatch (GroupMatch (match:_)):_) -> do+ intVal <- parseInt match+ dom <- intersectDOM td token+ Token Time <$> intersect dom (year intVal)+ _ -> Nothing+ }++ruleTODIntegerLatent :: Rule+ruleTODIntegerLatent = Rule+ { name = "time-of-day integer (latent)"+ , pattern =+ [ Predicate $ isIntegerBetween 0 23+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ hour True n+ _ -> Nothing+ }++ruleTODOrdinalLatent :: Rule+ruleTODOrdinalLatent = Rule+ { name = "time-of-day ordinal (latent)"+ , pattern =+ [ Predicate $ isOrdinalBetween 1 24+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ hour True n+ _ -> Nothing+ }++ruleHourTOD :: Rule+ruleHourTOD = Rule+ { name = "at <time-of-day>"+ , pattern =+ [ regex "(ال)?ساع[ةه]"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleAtHourTOD :: Rule+ruleAtHourTOD = Rule+ { name = "at <time-of-day>"+ , pattern =+ [ regex "عند ((ال)?ساع[ةه])?"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleHODAndInteger :: Rule+ruleHODAndInteger = Rule+ { name = "<hour-of-day> and integer"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isAnHourOfDay]+ , regex "و"+ , Predicate $ isIntegerBetween 0 60+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_:Token Numeral NumeralData{TNumeral.value = v}:_) ->+ tt $ hourMinute is12H hours (floor v)+ _ -> Nothing+ }++ruleHODAndIntegerMinutes :: Rule+ruleHODAndIntegerMinutes = Rule+ { name = "<hour-of-day> and integer minutes"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "و"+ , Predicate $ isIntegerBetween 0 60+ , regex "دقيق[ةه]|دقا[ئي]ق"+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_:Token Numeral NumeralData{TNumeral.value = v}:_) ->+ tt $ hourMinute is12H hours (floor v)+ _ -> Nothing+ }++ruleHHMM :: Rule+ruleHHMM = Rule+ { name = "hh:mm"+ , pattern = [regex "((?:[01]?\\d)|(?:2[0-3]))[:.]([0-5]\\d)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ tt $ hourMinute True h m+ _ -> Nothing+ }++ruleHHMMLatent :: Rule+ruleHHMMLatent = Rule+ { name = "hhmm (latent)"+ , pattern =+ [ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ tt . mkLatent $ hourMinute True h m+ _ -> Nothing+ }++ruleHHMMSS :: Rule+ruleHHMMSS = Rule+ { name = "hh:mm:ss"+ , pattern = [regex "((?:[01]?\\d)|(?:2[0-3]))[:.]([0-5]\\d)[:.]([0-5]\\d)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:mm:ss:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ s <- parseInt ss+ tt $ hourMinuteSecond True h m s+ _ -> Nothing+ }++ruleTODAMPM :: Rule+ruleTODAMPM = Rule+ { name = "<time-of-day> am|pm"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "([ap])(\\s|\\.)?m?\\.?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:Token RegexMatch (GroupMatch (_:ap:_)):_) ->+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td+ _ -> Nothing+ }++ruleHONumeral :: Rule+ruleHONumeral = Rule+ { name = "<hour-of-day> <integer>"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isAnHourOfDay]+ , Predicate $ isIntegerBetween 1 59+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:+ token:+ _) -> do+ n <- getIntValue token+ tt $ hourMinute is12H hours n+ _ -> Nothing+ }++ruleHODHalf :: Rule+ruleHODHalf = Rule+ { name = "<hour-of-day> half"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "(و ?)?نصف?( ساع[ةه])?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->+ tt $ hourMinute is12H hours 30+ _ -> Nothing+ }++ruleHODThird :: Rule+ruleHODThird = Rule+ { name = "<hour-of-day> third"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "(و ?)?ثلث( ساع[ةه])?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->+ tt $ hourMinute is12H hours 20+ _ -> Nothing+ }++ruleHODQuarter :: Rule+ruleHODQuarter = Rule+ { name = "<hour-of-day> quarter"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "(و ?)?ربع( ساع[ةه])?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->+ tt $ hourMinute is12H hours 15+ _ -> Nothing+ }++ruleThirdToHOD :: Rule+ruleThirdToHOD = Rule+ { name = "<hour-of-day> till third"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "[إا]لا ثلثا?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> Token Time <$> minutesBefore 20 td+ _ -> Nothing+ }++ruleQuarterToHOD :: Rule+ruleQuarterToHOD = Rule+ { name = "<hour-of-day> till quarter"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "[إا]لا ربعا?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> Token Time <$> minutesBefore 15 td+ _ -> Nothing+ }++ruleHODAndNumeralAfter :: Rule+ruleHODAndNumeralAfter = Rule+ { name = "<hour-of-day>"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "و"+ , Predicate $ isIntegerBetween 1 59+ , regex "(دقيق[ةه]|دقا[ئي]ق)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> do+ n <- getIntValue token+ t <- minutesAfter n td+ Just $ Token Time t+ _ -> Nothing+ }++ruleNumeralAfterHOD :: Rule+ruleNumeralAfterHOD = Rule+ { name = "integer after <hour-of-day>"+ , pattern =+ [ Predicate $ isIntegerBetween 1 59+ , regex "(دقيق[ةه]|دقا[ئي]ق) بعد"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (token:_:Token Time td:_) -> do+ n <- getIntValue token+ t <- minutesAfter n td+ Just $ Token Time t+ _ -> Nothing+ }++ruleHalfAfterHOD :: Rule+ruleHalfAfterHOD = Rule+ { name = "half after <hour-of-day>"+ , pattern =+ [ regex "نصف? ساع[ةه] بعد"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$> minutesAfter 30 td+ _ -> Nothing+ }++ruleThirdAfterHOD :: Rule+ruleThirdAfterHOD = Rule+ { name = "third after <hour-of-day>"+ , pattern =+ [ regex "ثلث ساع[ةه] بعد"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$> minutesAfter 20 td+ _ -> Nothing+ }++ruleQuarterAfterHOD :: Rule+ruleQuarterAfterHOD = Rule+ { name = "quarter after <hour-of-day>"+ , pattern =+ [ regex "ربع ساع[ةه] بعد"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$> minutesAfter 15 td+ _ -> Nothing+ }++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleMMYYYY :: Rule+ruleMMYYYY = Rule+ { name = "mm/yyyy"+ , pattern =+ [ regex "(0?[1-9]|1[0-2])[/-](\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:yy:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ tt $ yearMonthDay y m 1+ _ -> Nothing+ }++ruleYYYYMMDD :: Rule+ruleYYYYMMDD = Rule+ { name = "yyyy-mm-dd"+ , pattern = [regex "(\\d{2,4})-(0?[1-9]|1[0-2])-(3[01]|[12]\\d|0?[1-9])"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (yy:mm:dd:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ d <- parseInt dd+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleNoonMidnightEOD :: Rule+ruleNoonMidnightEOD = Rule+ { name = "noon|midnight|EOD|end of day"+ , pattern = [regex "(ليلا|مساء|نهاية (ال)يوم)|منتصف الليل"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> tt . hour False $+ if match == "منتصف الليل" then 12 else 0+ _ -> Nothing+ }++parOfDaysMap :: HashMap Text (Int, Int)+parOfDaysMap = HashMap.fromList+ [ ( "فجر", (3, 6) )+ , ( "صبح", (0, 12) )+ , ( "صباح", (0, 12) )+ , ( "نهار", (6, 17) )+ , ( "ظهر", (11, 15) )+ , ( "ظهر", (11, 15) )+ , ( "ظهيرة", (11, 15) )+ , ( "عصر", (15, 18) )+ , ( "مغرب", (17, 21) )+ , ( "غداء", (13, 16) )+ , ( "عشاء", (18, 3) )+ , ( "ليلة", (18, 3) )+ , ( "ليله", (18, 3) )+ , ( "مساء", (12, 24) )+ ]++rulePartOfDays :: Rule+rulePartOfDays = Rule+ { name = "part of days"+ , pattern =+ [ regex "(ال)?(صبا?ح|فجر|ظهر|ظهيرة|فطور|إفطار|عصر|مغرب|مساء|عشاء|ليل[ةه]|غداء)ا?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:match:_)):_) -> do+ (start, end) <- HashMap.lookup (Text.toLower match) parOfDaysMap+ td <- interval TTime.Open (hour False start) (hour False end)+ tt . partOfDay $ mkLatent td+ _ -> Nothing+ }++ruleAfterPartOfDays :: Rule+ruleAfterPartOfDays = Rule+ { name = "after part of days"+ , pattern =+ [ regex "بعد ال(فجر|ظهر|ظهيرة|فطور|إفطار|عصر|مغرب|عشاء|ليل|غداء)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ (start, end) <- HashMap.lookup (Text.toLower match) parOfDaysMap+ td <- interval TTime.Open (hour False start) (hour False (end + 1))+ tt . partOfDay $ notLatent td+ _ -> Nothing+ }++ruleBeforePartOfDays :: Rule+ruleBeforePartOfDays = Rule+ { name = "before part of days"+ , pattern =+ [ regex "قبل ال(فجر|ظهر|ظهيرة|فطور|إفطار|عصر|مغرب|عشاء|ليل|غداء)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ (start, end) <- HashMap.lookup (Text.toLower match) parOfDaysMap+ td <- interval TTime.Open (hour False (start - 1)) (hour False end)+ tt . partOfDay $ notLatent td+ _ -> Nothing+ }++ruleEarlyMorning :: Rule+ruleEarlyMorning = Rule+ { name = "early morning"+ , pattern =+ [ regex "(ال)?صبا?ح (((ال)?باكر)|بدري)"+ ]+ , prod = \_ -> Token Time . partOfDay . mkLatent <$>+ interval TTime.Open (hour False 4) (hour False 9)+ }++rulePODIn :: Rule+rulePODIn = Rule+ { name = "in|during the <part-of-day>"+ , pattern =+ [ regex "(في|خلال|في خلال|عند)(وقت )?( ال)?|وقت ال"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++rulePODThis :: Rule+rulePODThis = Rule+ { name = "this <part-of-day>"+ , pattern =+ [ regex "هذ[اه](ال)?"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time . partOfDay . notLatent <$>+ intersect (cycleNth TG.Day 0) td+ _ -> Nothing+ }++ruleTonight :: Rule+ruleTonight = Rule+ { name = "tonight"+ , pattern = [regex "(هذه )?الليل[ةه]"]+ , prod = \_ -> do+ let today = cycleNth TG.Day 0+ evening <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay . notLatent <$> intersect today evening+ }++ruleAfterPartofday :: Rule+ruleAfterPartofday = Rule+ { name = "after lunch/work/school"+ , pattern =+ [ regex "بعد[\\s-]?((ال)?غداء|(ال)?عمل|(ال)?شغل|(ال)?مدرس[ةه])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ (start, end) <- case Text.toLower match of+ "(ال)?غداء" -> Just (hour False 13, hour False 17)+ "(ال)?عمل|(ال)?شغل" -> Just (hour False 17, hour False 21)+ "(ال)?مدرس[ةه]" -> Just (hour False 15, hour False 21)+ _ -> Nothing+ td <- interval TTime.Open start end+ Token Time . partOfDay . notLatent <$>+ intersect (cycleNth TG.Day 0) td+ _ -> Nothing+ }++-- Since part of days are latent, general time intersection is blocked+ruleTimePOD :: Rule+ruleTimePOD = Rule+ { name = "<time> <part-of-day>"+ , pattern =+ [ dimension Time+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:Token Time pod:_) -> Token Time <$> intersect pod td+ _ -> Nothing+ }++ruleWeekend :: Rule+ruleWeekend = Rule+ { name = "week-end"+ , pattern =+ [ regex "(عطل[ةه] )?نهاي[ةه] ال[اأ]سبوع"+ ]+ , prod = \_ -> tt weekend+ }++ruleSeasons :: Rule+ruleSeasons = Rule+ { name = "seasons"+ , pattern = [regex "((ال)?صيف|(ال)?خريف|(ال)?شتاء|(ال)?ربيع)"]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ (start, end) <- case Text.toLower match of+ "الصيف" -> Just $ (monthDay 6 21 , monthDay 9 23)+ "صيف" -> Just $ (monthDay 6 21 , monthDay 9 23)+ "الخريف" -> Just $ (monthDay 9 23 , monthDay 12 21)+ "خريف" -> Just $ (monthDay 9 23 , monthDay 12 21)+ "الشتاء" -> Just $ (monthDay 12 21, monthDay 3 20)+ "شتاء" -> Just $ (monthDay 12 21, monthDay 3 20)+ "الربيع" -> Just $ (monthDay 3 20 , monthDay 6 21)+ "ربيع" -> Just $ (monthDay 3 20 , monthDay 6 21)+ _ -> Nothing+ Token Time <$> interval TTime.Open start end+ _ -> Nothing++ }++ruleTODPrecision :: Rule+ruleTODPrecision = Rule+ { name = "<time-of-day> sharp|exactly"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "(تقريبا)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++rulePrecisionTOD :: Rule+rulePrecisionTOD = Rule+ { name = "about|exactly <time-of-day>"+ , pattern =+ [ regex "(حول|حوالي?|تقريبا|قراب[ةه]|(ب|في )حدود)"+ , Predicate $ isGrainFinerThan TG.Year+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleIntervalMonthDDDD :: Rule+ruleIntervalMonthDDDD = Rule+ { name = "<month> dd-dd (interval)"+ , pattern =+ [ Predicate isAMonth+ , Predicate isDOMValue+ , regex "\\-|[اإ]لى|لـ?|حتى"+ , Predicate isDOMValue+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:+ token1:+ _:+ token2:+ _) -> do+ dom1 <- intersectDOM td token1+ dom2 <- intersectDOM td token2+ Token Time <$> interval TTime.Closed dom1 dom2+ _ -> Nothing+ }++ruleIntervalDDDDMonth :: Rule+ruleIntervalDDDDMonth = Rule+ { name = "dd-dd <month> (interval)"+ , pattern =+ [ Predicate isDOMValue+ , regex "\\-|[اإ]لى|لـ?|حتى"+ , Predicate isDOMValue+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token1:+ _:+ token2:+ Token Time td:+ _) -> do+ dom1 <- intersectDOM td token1+ dom2 <- intersectDOM td token2+ Token Time <$> interval TTime.Closed dom1 dom2+ _ -> Nothing+ }++ruleIntervalFromMonthDDDD :: Rule+ruleIntervalFromMonthDDDD = Rule+ { name = "from <month> dd-dd (interval)"+ , pattern =+ [ regex "من"+ , Predicate isAMonth+ , Predicate isDOMValue+ , regex "\\-|[اإ]لى|لـ?|حتى"+ , Predicate isDOMValue+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Time td:+ token1:+ _:+ token2:+ _) -> do+ dom1 <- intersectDOM td token1+ dom2 <- intersectDOM td token2+ Token Time <$> interval TTime.Closed dom1 dom2+ _ -> Nothing+ }++ruleIntervalFromDDDDMonth :: Rule+ruleIntervalFromDDDDMonth = Rule+ { name = "from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) <named-month> (interval)"+ , pattern =+ [ regex "من|بين"+ , Predicate isDOMValue+ , regex "(و ?)?(\\-|[اإ]لى|لـ?|حتى)"+ , Predicate isDOMValue+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (_:+ token1:+ _:+ token2:+ Token Time td:+ _) -> do+ dom1 <- intersectDOM td token1+ dom2 <- intersectDOM td token2+ Token Time <$> interval TTime.Closed dom1 dom2+ _ -> Nothing+ }++ruleIntervalFromDDDDInMonth :: Rule+ruleIntervalFromDDDDInMonth = Rule+ { name = "from <day-of-month> (ordinal or number) to <day-of-month> (ordinal or number) in <named-month> (interval)"+ , pattern =+ [ regex "من|بين"+ , Predicate isDOMValue+ , regex "(و ?)?(\\-|[اإ]لى|لـ?|حتى)"+ , Predicate isDOMValue+ , regex "من|في"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (_:+ token1:+ _:+ token2:+ _:+ Token Time td:+ _) -> do+ dom1 <- intersectDOM td token1+ dom2 <- intersectDOM td token2+ Token Time <$> interval TTime.Closed dom1 dom2+ _ -> Nothing+ }++-- Blocked for :latent time. May need to accept certain latents only, like hours+ruleIntervalDash :: Rule+ruleIntervalDash = Rule+ { name = "<datetime> - <datetime> (interval)"+ , pattern =+ [ Predicate isNotLatent+ , regex "(و ?)?(\\-|[اإ]لى|حتى)"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleIntervalFrom :: Rule+ruleIntervalFrom = Rule+ { name = "from <datetime> - <datetime> (interval)"+ , pattern =+ [ regex "من"+ , Predicate isNotLatent+ , regex "(و ?)?(\\-|[اإ]لى|لـ?|حتى)"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleIntervalBetween :: Rule+ruleIntervalBetween = Rule+ { name = "between <time> and <time>"+ , pattern =+ [ regex "بين ?((ال)?ساع[ةه])?"+ , dimension Time+ , regex "و ?(بين)? ?((ال)?ساع[ةه])?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++-- Specific for time-of-day, to help resolve ambiguities+ruleIntervalTODDash :: Rule+ruleIntervalTODDash = Rule+ { name = "<time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "(و ?)?(\\-|:|[اإ]لى|لـ?|حتى)"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleIntervalTODFrom :: Rule+ruleIntervalTODFrom = Rule+ { name = "from <time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ regex "(من|بين|)((ال)?ساع[ةه]?)"+ , Predicate isATimeOfDay+ , regex "(و ?)?(\\-|[اإ]لى|لـ?|حتى)((ال)?ساع[ةه]?)"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleIntervalTODBetween :: Rule+ruleIntervalTODBetween = Rule+ { name = "between <time-of-day> and <time-of-day> (interval)"+ , pattern =+ [ regex "بين"+ , Predicate isATimeOfDay+ , regex "و"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleIntervalBy :: Rule+ruleIntervalBy = Rule+ { name = "by <time>"+ , pattern =+ [ regex "حتى"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) ->+ Token Time <$> interval TTime.Open (cycleNth TG.Second 0) td+ _ -> Nothing+ }++ruleIntervalUntilTOD :: Rule+ruleIntervalUntilTOD = Rule+ { name = "until <time-of-day>"+ , pattern =+ [ regex "([اأ]ي وقت)?(قبل|حتى|[إا]لى)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.Before td+ _ -> Nothing+ }++ruleIntervalAfterTOD :: Rule+ruleIntervalAfterTOD = Rule+ { name = "after <time-of-day>"+ , pattern =+ [ regex "([اأ]ي وقت)?(بعد)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.After td+ _ -> Nothing+ }++ruleIntervalSinceTOD :: Rule+ruleIntervalSinceTOD = Rule+ { name = "since <time-of-day>"+ , pattern =+ [ regex "منذ"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.After td+ _ -> Nothing+ }++daysOfWeek :: [(Text, String)]+daysOfWeek =+ [ ( "Monday" , "(ال)?[اإ]ثنين" )+ , ( "Tuesday" , "(ال)?ثلاثاء?" )+ , ( "Wednesday", "(ال)?[اأ]ربعاء?" )+ , ( "Thursday" , "(ال)?خميس" )+ , ( "Friday" , "(ال)?جمع[ةه]" )+ , ( "Saturday" , "(ال)?سبت" )+ , ( "Sunday" , "(ال)?[اأ]حد" )+ ]++ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = zipWith go daysOfWeek [1..7]+ where+ go (name, regexPattern) i = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> tt $ dayOfWeek i+ }++months :: [(Text, String)]+months =+ [ ( "January" , "يناير|كانون (ال)ثاني?" )+ , ( "February" , "فبراير|شباط" )+ , ( "March" , "مارس|[اآ]ذار" )+ , ( "April" , "[اأ]بريل|نيسان" )+ , ( "May" , "مايو|[اأ]ي[اآ]ر" )+ , ( "June" , "يونيو|حزيران" )+ , ( "July" , "يوليو|تموز" )+ , ( "August" , "[اأ]غسطس|[اآ]ب" )+ , ( "September", "سي?بتمبر|[اأ]يلول" )+ , ( "October" , "[اأ]كتوبر|تشرين (ال)?[اأ]ول" )+ , ( "November" , "نوفمبر|تشرين (ال)?ثاني" )+ , ( "December" , "ديسمبر|كانون (ال)?[اأ]ول" )+ ]++ruleMonths :: [Rule]+ruleMonths = zipWith go months [1..12]+ where+ go (name, regexPattern) i = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> tt $ month i+ }++ruleMonthsNumeral :: Rule+ruleMonthsNumeral = Rule+ { name = "month (integer)"+ , pattern =+ [ regex "شهر"+ , Predicate $ isIntegerBetween 1 12+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> do+ n <- getIntValue token+ tt $ month n+ _ -> Nothing+ }++ruleMonthsOrdinal :: Rule+ruleMonthsOrdinal = Rule+ { name = "month (ordinal)"+ , pattern =+ [ regex "الشهر"+ , dimension Ordinal+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> do+ n <- getIntValue token+ tt $ month n+ _ -> Nothing+ }++ruleYearInteger :: Rule+ruleYearInteger = Rule+ { name = "year (integer)"+ , pattern =+ [ regex "سنة|عام"+ , Predicate $ isIntegerBetween 1 3000+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> do+ n <- getIntValue token+ tt $ year n+ _ -> Nothing+ }++rulePartOfMonth :: Rule+rulePartOfMonth = Rule+ { name = "part of <named-month>"+ , pattern =+ [ regex "([اأ]وائل|[اأ]واخر|نهاي[ةه])-?"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):Token Time td:_) -> do+ (sd, (Just end)) <- case Text.toLower match of+ "اوائل" -> Just (1, intersect (dayOfMonth 10) td)+ "أوائل" -> Just (1, intersect (dayOfMonth 10) td)+ "اواخر" -> Just (21, Just $ cycleLastOf TG.Day td)+ "أواخر" -> Just (21, Just $ cycleLastOf TG.Day td)+ _ -> Nothing+ start <- intersect td $ dayOfMonth sd+ Token Time <$> interval TTime.Open start end+ _ -> Nothing+ }++ruleDayOfMonth :: Rule+ruleDayOfMonth = Rule+ { name = "day of <named-month>"+ , pattern =+ [ regex "(بداي[ةه]|منتصف|نصف?|[اآ]خر|نهاي[ةه])-?"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "بداية" -> Token Time <$> intersect (dayOfMonth 1) td+ "بدايه" -> Token Time <$> intersect (dayOfMonth 1) td+ "منتصف" -> Token Time <$> intersect (dayOfMonth 15) td+ "نصف" -> Token Time <$> intersect (dayOfMonth 15) td+ "نص" -> Token Time <$> intersect (dayOfMonth 15) td+ _ -> tt $ cycleLastOf TG.Day td+ _ -> Nothing+ }++usHolidays :: [(Text, String, Int, Int)]+usHolidays =+ [ ( "Christmas" , "(يوم |عطل[ةه] )?((ال)?كري?سماس)" , 12, 25 )+ , ( "Christmas Eve" , "(ليل[ةه] )((ال)?كري?سماس)" , 12, 24 )+ , ( "New Year's Eve" , "(ليل[ةه] )(ر[اأ]س السن[ةه])" , 12, 31 )+ , ( "New Year's Day" , "(يوم |عطل[ةه] )?(ر[اأ]س السن[ةه])" , 1 , 1 )+ , ( "Valentine's Day" , "(عيد|يوم|عطل[ةه])((ال)?حب|(ال)?فالنتا?ين)" , 2 , 14 )+ , ( "Halloween" , "(عيد |يوم |عطل[ةه] )?((ال)?هالوي?ين)" , 10, 31 )+ ]++ruleUSHolidays :: [Rule]+ruleUSHolidays = map go usHolidays+ where+ go (name, regexPattern, m, d) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> tt $ monthDay m d+ }++ruleThisLastNextCycle :: Rule+ruleThisLastNextCycle = Rule+ { name = "this|last <cycle>"+ , pattern =+ [ regex "(هذا|هذه|اخر|آخر)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ Token TimeGrain grain:+ _) -> case Text.toLower match of+ "هذا" -> tt $ cycleNth grain 0+ "هذه" -> tt $ cycleNth grain 0+ "اخر" -> tt . cycleNth grain $ - 1+ "آخر" -> tt . cycleNth grain $ - 1+ _ -> Nothing+ _ -> Nothing+ }++ruleThisLastNextCycle2 :: Rule+ruleThisLastNextCycle2 = Rule+ { name = "this|last the <cycle>"+ , pattern =+ [ regex "(هذا|هذه|اخر|آخر)"+ , regex "(ال)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ _:+ Token TimeGrain grain:+ _) -> case Text.toLower match of+ "هذا" -> tt $ cycleNth grain 0+ "هذه" -> tt $ cycleNth grain 0+ "اخر" -> tt . cycleNth grain $ - 1+ "آخر" -> tt . cycleNth grain $ - 1+ _ -> Nothing+ _ -> Nothing+ }++ruleCycleThisLastNext :: Rule+ruleCycleThisLastNext = Rule+ { name = "<cycle> this|last|next"+ , pattern =+ [ regex "ال"+ , dimension TimeGrain+ , regex "(هذ|القادم|التالي|الحالي|المقبل|الجاي|السابق|الماضي?|الفا[ئي]ت|المنصرم)[اةه]?(ين|ان|ات)?"+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token TimeGrain grain:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "هذ" -> tt $ cycleNth grain 0+ "الحالي" -> tt $ cycleNth grain 0+ "القادم" -> tt $ cycleNth grain 1+ "التالي" -> tt $ cycleNth grain 1+ "المقبل" -> tt $ cycleNth grain 1+ "الجاي" -> tt $ cycleNth grain 1+ "السابق" -> tt . cycleNth grain $ - 1+ "الماضي" -> tt . cycleNth grain $ - 1+ "الماض" -> tt . cycleNth grain $ - 1+ "المنصرم" -> tt . cycleNth grain $ - 1+ "الفائت" -> tt . cycleNth grain $ - 1+ "الفايت" -> tt . cycleNth grain $ - 1+ _ -> Nothing+ _ -> Nothing+ }++ruleCycleTheAfterBeforeTime :: Rule+ruleCycleTheAfterBeforeTime = Rule+ { name = "the <cycle> after|before <time>"+ , pattern =+ [ regex "ال"+ , dimension TimeGrain+ , regex "(الذ?ي |ال)(قبل|بعد)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token TimeGrain grain:+ Token RegexMatch (GroupMatch (_:match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "بعد" -> tt $ cycleNthAfter False grain 1 td+ _ -> tt $ cycleNthAfter False grain (-1) td+ _ -> Nothing+ }++ruleCycleAfterBeforeTime :: Rule+ruleCycleAfterBeforeTime = Rule+ { name = "<cycle> after|before <time>"+ , pattern =+ [ dimension TimeGrain+ , regex "(قبل|بعد)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:+ Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "بعد" -> tt $ cycleNthAfter False grain 1 td+ _ -> tt $ cycleNthAfter False grain (-1) td+ _ -> Nothing+ }++ruleCycleLastN :: Rule+ruleCycleLastN = Rule+ { name = "last n <cycle>"+ , pattern =+ [ regex "([اآ]خر)"+ , Predicate $ isIntegerBetween 1 9999+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:token:Token TimeGrain grain:_) -> do+ n <- getIntValue token+ tt . cycleN True grain $ - n+ _ -> Nothing+ }++ruleCycleNextN :: Rule+ruleCycleNextN = Rule+ { name = "<cycle> n next"+ , pattern =+ [ regex "ال"+ , dimension TimeGrain+ , regex "ال"+ , Predicate $ isIntegerBetween 1 9999+ , regex "(ال)(تالي|قادم)[ةه]?"+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:token:_) -> do+ n <- getIntValue token+ tt $ cycleN True grain n+ _ -> Nothing+ }++ruleCycleOrdinalOfTime :: Rule+ruleCycleOrdinalOfTime = Rule+ { name = "<ordinal> <cycle> of <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , regex "في|من|بـ?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (token:Token TimeGrain grain:_:Token Time td:_) -> do+ n <- getIntValue token+ tt $ cycleNthAfter True grain (n - 1) td+ _ -> Nothing+ }++ruleCycleOrdinalDayOfTime :: Rule+ruleCycleOrdinalDayOfTime = Rule+ { name = "<cycle> <ordinal> day? of <time>"+ , pattern =+ [ dimension TimeGrain+ , dimension Ordinal+ , regex "((ال)?يوم )?(بـ?|في|من)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:token:_:Token Time td:_) -> do+ n <- getIntValue token+ tt $ cycleNthAfter True grain (n - 1) td+ _ -> Nothing+ }++ruleTheCycleTheOrdinalOfTime :: Rule+ruleTheCycleTheOrdinalOfTime = Rule+ { name = "the <cycle> the <ordinal> of <time>"+ , pattern =+ [ regex "ال"+ , dimension TimeGrain+ , dimension Ordinal+ , regex "في|من|بـ?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:token:_:Token Time td:_) -> do+ n <- getIntValue token+ tt $ cycleNthAfter True grain (n - 1) td+ _ -> Nothing+ }+++ruleCycleOrdinalAfterTime :: Rule+ruleCycleOrdinalAfterTime = Rule+ { name = "<ordinal> <cycle> after <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , regex "بعد"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (token:Token TimeGrain grain:_:Token Time td:_) -> do+ n <- getIntValue token+ tt $ cycleNthAfter True grain (n - 1) td+ _ -> Nothing+ }++ruleDurationInWithinAfter :: Rule+ruleDurationInWithinAfter = Rule+ { name = "in|within|after <duration>"+ , pattern =+ [ regex "(في|خلال|بعد)"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ Token Duration dd:+ _) -> case Text.toLower match of+ "خلال" -> Token Time <$>+ interval TTime.Open (cycleNth TG.Second 0) (inDuration dd)+ "بعد" -> tt . withDirection TTime.After $ inDuration dd+ "في" -> tt $ inDuration dd+ _ -> Nothing+ _ -> Nothing+ }++ruleDurationHenceAgo :: Rule+ruleDurationHenceAgo = Rule+ { name = "<duration> hence|ago"+ , pattern =+ [ dimension Duration+ , regex "(مض[تى]|من الان)"+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "من الان" -> tt $ inDuration dd+ _ -> tt $ durationAgo dd+ _ -> Nothing+ }++ruleInNumeral :: Rule+ruleInNumeral = Rule+ { name = "in <number> (implicit minutes)"+ , pattern =+ [ regex "في|خلال"+ , Predicate $ isIntegerBetween 0 60+ ]+ , prod = \tokens -> case tokens of+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) ->+ tt . inDuration . duration TG.Minute $ floor v+ _ -> Nothing+ }++ruleDurationAfterBeforeTime :: Rule+ruleDurationAfterBeforeTime = Rule+ { name = "<duration> after|before|from <time>"+ , pattern =+ [ dimension Duration+ , regex "(من|قبل|بعد)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:+ Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "قبل" -> tt $ durationBefore dd td+ _ -> tt $ durationAfter dd td+ _ -> Nothing+ }++ruleIntervalForDurationFrom :: Rule+ruleIntervalForDurationFrom = Rule+ { name = "for <duration> from <time>"+ , pattern =+ [ regex "لمدة|ل"+ , dimension Duration+ , regex "(من بداي[ةه]|ابتداء ب|بداية من|من)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_:Token Time td1:_) ->+ Token Time <$> interval TTime.Open td1 (durationAfter dd td1)+ _ -> Nothing+}++ruleTimeForDuration :: Rule+ruleTimeForDuration = Rule+ { name = "<time> for <duration>"+ , pattern =+ [ dimension Time+ , regex "لمدة|ل"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Duration dd:_) ->+ Token Time <$> interval TTime.Open td1 (durationAfter dd td1)+ _ -> Nothing+}++ruleTimezone :: Rule+ruleTimezone = Rule+ { name = "<time> timezone"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "(بتوقيت |)?\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT|SCT|SBT|SAST|SAMT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PHT|PHOT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|NCT|MYT|MVT|MUT|MST|MSK|MSD|MMT|MHT|MDT|MAWT|MART|MAGT|MAGST|LINT|LHST|LHDT|KUYT|KST|KRAT|KRAST|KGT|JST|IST|IRST|IRKT|IRKST|IRDT|IOT|IDT|ICT|HOVT|HKT|GYT|GST|GMT|GILT|GFT|GET|GAMT|GALT|FNT|FKT|FKST|FJT|FJST|EST|EGT|EGST|EET|EEST|EDT|ECT|EAT|EAST|EASST|DAVT|ChST|CXT|CVT|CST|COT|CLT|CLST|CKT|CHAST|CHADT|CET|CEST|CDT|CCT|CAT|CAST|BTT|BST|BRT|BRST|BOT|BNT|AZT|AZST|AZOT|AZOST|AWST|AWDT|AST|ART|AQTT|ANAT|ANAST|AMT|AMST|ALMT|AKST|AKDT|AFT|AEST|AEDT|ADT|ACST|ACDT)\\b"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:+ Token RegexMatch (GroupMatch (_:tz:_)):+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleIntersect+ , ruleIntersectOf+ , ruleAbsorbOnTime+ , ruleAbsorbOnADOW+ , ruleAbsorbInMonth+ , ruleAbsorbCommaTOD+ , ruleThisDOW+ , ruleDOWNext+ , ruleDOWLast+ , ruleThisTime+ , ruleNextTime+ , ruleLastTime+ , ruleLastTime2+ , ruleLastDOWOfTime+ , ruleDOWTheLastOfTime+ , ruleLastCycleOfTime+ , ruleCycleLastOfTime+ , ruleNthTimeOfTime+ , ruleTimeNthOfTime+ , ruleNthTimeAfterTime+ , ruleTimeNthAfterTime+ , ruleYear+ , ruleYearPastLatent+ , ruleYearFutureLatent+ , ruleYearInteger+ , ruleMonthsNumeral+ , ruleMonthsOrdinal+ , ruleDOMLatent+ , ruleNamedDOMOrdinal+ , ruleMonthDOMNumeral+ , ruleDOMMonth+ , ruleDOMOfMonth+ , ruleDOMOrdinalMonthYear+ , ruleDOMOrdinalDayMonthYear+ , ruleTODIntegerLatent+ , ruleTODOrdinalLatent+ , ruleAtHourTOD+ , ruleHODAndInteger+ , ruleHODAndIntegerMinutes+ , ruleHourTOD+ , ruleHHMM+ , ruleHHMMLatent+ , ruleHHMMSS+ , ruleTODAMPM+ , ruleHONumeral+ , ruleHODHalf+ , ruleHODThird+ , ruleHODQuarter+ , ruleThirdToHOD+ , ruleQuarterToHOD+ , ruleHODAndNumeralAfter+ , ruleNumeralAfterHOD+ , ruleHalfAfterHOD+ , ruleThirdAfterHOD+ , ruleQuarterAfterHOD+ , ruleDDMM+ , ruleDDMMYYYY+ , ruleYYYYMMDD+ , ruleMMYYYY+ , ruleNoonMidnightEOD+ , rulePartOfDays+ , ruleAfterPartOfDays+ , ruleBeforePartOfDays+ , ruleEarlyMorning+ , rulePODIn+ , rulePODThis+ , ruleTonight+ , ruleAfterPartofday+ , ruleTimePOD+ , ruleWeekend+ , ruleSeasons+ , ruleTODPrecision+ , rulePrecisionTOD+ , ruleIntervalFromMonthDDDD+ , ruleIntervalFromDDDDMonth+ , ruleIntervalFromDDDDInMonth+ , ruleIntervalMonthDDDD+ , ruleIntervalDDDDMonth+ , ruleIntervalDash+ , ruleIntervalFrom+ , ruleIntervalBetween+ , ruleIntervalTODDash+ , ruleIntervalTODFrom+ , ruleIntervalTODBetween+ , ruleIntervalBy+ , ruleIntervalUntilTOD+ , ruleIntervalAfterTOD+ , ruleIntervalSinceTOD+ , ruleThisLastNextCycle+ , ruleThisLastNextCycle2+ , ruleCycleThisLastNext+ , ruleCycleTheAfterBeforeTime+ , ruleCycleAfterBeforeTime+ , ruleCycleLastN+ , ruleCycleNextN+ , ruleTheCycleTheOrdinalOfTime+ , ruleCycleOrdinalOfTime+ , ruleCycleOrdinalDayOfTime+ , ruleCycleOrdinalAfterTime+ , ruleDurationInWithinAfter+ , ruleDurationHenceAgo+ , ruleDurationAfterBeforeTime+ , ruleIntervalForDurationFrom+ , ruleTimeForDuration+ , ruleInNumeral+ , ruleTimezone+ , rulePartOfMonth+ , ruleDayOfMonth+ , ruleNow+ ]+ ++ ruleInstants+ ++ ruleDaysOfWeek+ ++ ruleMonths+ ++ ruleUSHolidays
Duckling/Time/Corpus.hs view
@@ -49,7 +49,7 @@ DucklingTime (Series.ZoneSeriesTime _ tzSeries) = referenceTime ctx check :: ToJSON a => (Context -> a) -> TestPredicate-check f context (Resolved {jsonValue}) = case jsonValue of+check f context Resolved{jsonValue} = case jsonValue of Object o -> toJSON (f context) == (Object $ H.delete "values" o) _ -> False
Duckling/Time/DA/Corpus.hs view
@@ -563,8 +563,11 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "torsdag kl. 8:00 GMT"+ , "torsdag kl. 8:00 gmt" , "torsdag klokken 8:00 GMT"+ , "torsdag klokken 8:00 gmt" , "torsdag 08:00 GMT"+ , "torsdag 08:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "idag kl. 14"
Duckling/Time/DA/Rules.hs view
@@ -23,12 +23,13 @@ import Duckling.Time.Types (TimeData (..)) import Duckling.Regex.Types import Duckling.Types+import qualified Data.Text as Text import qualified Duckling.Ordinal.Types as TOrdinal import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "mandag|man\\.?" ) , ( "Tuesday" , "tirsdag|tirs?\\.?" ) , ( "Wednesday", "onsdag|ons\\.?" )@@ -38,17 +39,8 @@ , ( "Sunday" , "søndag|søn\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "January" , "januar|jan\\.?" ) , ( "February" , "februar|feb\\.?" ) , ( "March" , "marts|mar\\.?" )@@ -63,15 +55,6 @@ , ( "December" , "december|dec\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleTheDayAfterTomorrow :: Rule ruleTheDayAfterTomorrow = Rule { name = "the day after tomorrow"@@ -171,7 +154,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -752,7 +735,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1047,7 +1030,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1110,7 +1093,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1396,7 +1379,7 @@ [ Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . mkLatent $ dayOfMonth v _ -> Nothing }@@ -1607,7 +1590,7 @@ , Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (_:Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt $ dayOfMonth v _ -> Nothing }@@ -1724,7 +1707,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/DE/Corpus.hs view
@@ -583,6 +583,7 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "donnerstag 8:00 GMT"+ , "donnerstag 8:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "heute um 14 Uhr"
Duckling/Time/DE/Rules.hs view
@@ -28,32 +28,23 @@ import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG -instants :: [(Text, TG.Grain, Int, String)]-instants =- [ ( "now" , TG.Second, 0,+ruleInstants :: [Rule]+ruleInstants = mkRuleInstants+ [ ( "now" , TG.Second, 0, "(genau)? ?jetzt|diesen moment|in diesem moment|gerade eben" )- , ( "today" , TG.Day , 0,+ , ( "today" , TG.Day , 0, "heute|(um diese zeit|zu dieser zeit|um diesen zeitpunkt|zu diesem zeitpunkt)" )- , ( "tomorrow" , TG.Day , 1, "morgen" )- , ( "yesterday" , TG.Day , -1, "gestern" )- , ( "after tomorrow" , TG.Day , 2, "(ü)bermorgen" )- , ( "before yesterday", TG.Day , -2, "vorgestern" )- , ( "EOM|End of month", TG.Month , 1, "(das )?ende des monats?" )- , ( "EOY|End of year" , TG.Year , 1,+ , ( "tomorrow" , TG.Day , 1, "morgen" )+ , ( "yesterday" , TG.Day , -1, "gestern" )+ , ( "after tomorrow" , TG.Day , 2, "(ü)bermorgen" )+ , ( "before yesterday", TG.Day , -2, "vorgestern" )+ , ( "EOM|End of month", TG.Month , 1, "(das )?ende des monats?" )+ , ( "EOY|End of year" , TG.Year , 1, "(das )?(EOY|jahr(es)? ?ende|ende (des )?jahr(es)?)" )- ]--ruleInstants :: [Rule]-ruleInstants = map go instants- where- go (name, grain, n, regexPattern) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ cycleNth grain n- }+ ] -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Montag" , "montags?|mo\\.?" ) , ( "Dienstag" , "die?nstags?|di\\.?" ) , ( "Mittwoch" , "mittwochs?|mi\\.?" )@@ -63,17 +54,8 @@ , ( "Sonntag" , "sonntags?|so\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "Januar" , "januar|jan\\.?" ) , ( "Februar" , "februar|feb\\.?" ) , ( "Marz" , "m(ä)rz|m(ä)r\\.?" )@@ -88,67 +70,45 @@ , ( "Dezember" , "dezember|dez\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }--seasons :: [(Text, String, TimeData, TimeData)]-seasons =+ruleSeasons :: [Rule]+ruleSeasons = mkRuleSeasons [ ( "sommer" , "sommer" , monthDay 6 21, monthDay 9 23 ) , ( "herbst" , "herbst" , monthDay 9 23, monthDay 12 21 ) , ( "winter" , "winter" , monthDay 12 21, monthDay 3 20 ) , ( "fruhling", "fr(ü)h(ling|jahr)", monthDay 3 20, monthDay 6 21 ) ] -ruleSeasons :: [Rule]-ruleSeasons = map go seasons- where- go (name, regexPattern, start, end) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> Token Time <$> interval TTime.Open start end- }--holidays :: [(Text, TimeData, String)]-holidays =- [ ( "new year's day" , monthDay 1 1, "neujahr(s?tag)?" )- , ( "valentine's day" , monthDay 2 14, "valentin'?stag" )- , ( "Schweizer Bundesfeiertag" , monthDay 8 1,- "schweiz(er)? (bundes)?feiertag|bundes feiertag" )- , ( "Tag der Deutschen Einheit" , monthDay 10 3,- "tag (der)? deutsc?hen? einheit" )- , ( "Oesterreichischer Nationalfeiertag", monthDay 10 26,- "((ö)sterreichischer?)? nationalfeiertag|national feiertag" )- , ( "halloween day" , monthDay 10 31, "hall?owe?en?" )- , ( "Allerheiligen" , monthDay 11 1,- "allerheiligen?|aller heiligen?" )- , ( "Nikolaus" , monthDay 12 6,- "nikolaus(tag)?|nikolaus tag|nikolo" )- , ( "christmas eve" , monthDay 12 24,- "heilig(er)? abend" )- , ( "christmas" , monthDay 12 25,- "weih?nacht(en|stag)?" )- , ( "new year's eve" , monthDay 12 31,- "silvester" )- , ( "Mother's Day" , nthDOWOfMonth 2 7 5,- "mutt?ertag|mutt?er (tag)?" )- , ( "Father's Day" , nthDOWOfMonth 3 7 6,- "vatt?er( ?tag)?" )- ]- ruleHolidays :: [Rule]-ruleHolidays = map go holidays- where- go (name, date, regexPattern) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt date- }+ruleHolidays = mkRuleHolidays+ [ ( "new year's day" , "neujahr(s?tag)?"+ , monthDay 1 1 )+ , ( "valentine's day" , "valentin'?stag"+ , monthDay 2 14 )+ , ( "Schweizer Bundesfeiertag"+ , "schweiz(er)? (bundes)?feiertag|bundes feiertag"+ , monthDay 8 1 )+ , ( "Tag der Deutschen Einheit" , "tag (der)? deutsc?hen? einheit"+ , monthDay 10 3 )+ , ( "Oesterreichischer Nationalfeiertag"+ , "((ö)sterreichischer?)? nationalfeiertag|national feiertag"+ , monthDay 10 26 )+ , ( "halloween day" , "hall?owe?en?"+ , monthDay 10 31 )+ , ( "Allerheiligen" , "allerheiligen?|aller heiligen?"+ , monthDay 11 1 )+ , ( "Nikolaus" , "nikolaus(tag)?|nikolaus tag|nikolo"+ , monthDay 12 6 )+ , ( "christmas eve" , "heilig(er)? abend"+ , monthDay 12 24 )+ , ( "christmas" , "weih?nacht(en|stag)?"+ , monthDay 12 25 )+ , ( "new year's eve" , "silvester"+ , monthDay 12 31 )+ , ( "Mother's Day" , "mutt?ertag|mutt?er (tag)?"+ , nthDOWOfMonth 2 7 5 )+ , ( "Father's Day" , "vatt?er( ?tag)?"+ , nthDOWOfMonth 3 7 6 )+ ] ruleRelativeMinutesTotillbeforeIntegerHourofday :: Rule ruleRelativeMinutesTotillbeforeIntegerHourofday = Rule@@ -222,7 +182,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -235,7 +195,7 @@ { name = "last <time>" , pattern = [ regex "letzten?|letztes"- , dimension Time+ , Predicate isOkWithThisNext ] , prod = \tokens -> case tokens of (_:Token Time td:_) ->@@ -756,7 +716,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1016,7 +976,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1043,7 +1003,7 @@ , pattern = [ regex "wochen ?ende?" ]- , prod = \_ -> tt weekend+ , prod = \_ -> tt $ mkOkForThisNext weekend } ruleNthTimeAfterTime2 :: Rule@@ -1058,7 +1018,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1071,7 +1031,7 @@ { name = "next <time>" , pattern = [ regex "(n(ä)chste|kommende)[ns]?"- , Predicate isNotLatent+ , Predicate $ and . sequence [isNotLatent, isOkWithThisNext] ] , prod = \tokens -> case tokens of (_:Token Time td:_) ->@@ -1210,7 +1170,7 @@ { name = "this <time>" , pattern = [ regex "diese(n|r|s)?|(im )?laufenden"- , dimension Time+ , Predicate isOkWithThisNext ] , prod = \tokens -> case tokens of (_:Token Time td:_) ->@@ -1326,7 +1286,7 @@ [ Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt $ dayOfMonth v _ -> Nothing }@@ -1340,7 +1300,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -1504,8 +1464,7 @@ (Token RegexMatch (GroupMatch (hh:mm:_)):Token RegexMatch (GroupMatch (ap:_)):_) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } @@ -1559,7 +1518,7 @@ , Predicate $ isGrain TG.Quarter ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) -> tt .+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . cycleNthAfter False TG.Quarter (v - 1) $ cycleNth TG.Year 0 _ -> Nothing }@@ -1572,7 +1531,7 @@ , Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (_:Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt $ dayOfMonth v _ -> Nothing }@@ -1662,7 +1621,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
+ Duckling/Time/EL/Corpus.hs view
@@ -0,0 +1,991 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EL.Corpus+ ( corpus+ , negativeCorpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++context :: Context+context = testContext {locale = makeLocale EL Nothing}++corpus :: Corpus+corpus = (context, allExamples)++negativeCorpus :: NegativeCorpus+negativeCorpus = (context, examples)+ where+ examples =+ [ "ένας ενήληκας"+ , "τρεισήμισι και μισή"+ ]++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 1, 0, 0, 0) Day)+ [ "1/2/2013"+ ]+ , examples (datetime (2013, 2, 12, 4, 30, 0) Second)+ [ "τώρα"+ , "τώρα αμέσως"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "δευτέρα"+ , "δευτέρας"+ , "την δευτέρα"+ , "αυτή τη δευτέρα"+ , "Δευτέρα, 18 Φεβρουαρίου"+ , "Δευτ, 18 Φλεβάρη"+ , "18 Φεβρουαρίου, Δευτ"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "Τρίτη η 19η Φλεβάρη"+ , "Τρίτη, 19 Φεβρουαρίου"+ , "19 Φεβρουαρίου, Τρίτη"+ , "Τρίτη"+ , "την Τρίτη"+ , "την Τρίτη"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "αύριο"+ , "Τετάρτη"+ , "την Τετάρτη"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "Πέμπτη"+ , "πέμπτη"+ , "Πεμ"+ , "πεμ."+ , "την Πέμπτη"+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "παρασκευή"+ , "παρασκευής"+ , "παρ."+ , "την παρασκευή"+ ]+ , examples (datetime (2013, 2, 16, 0, 0, 0) Day)+ [ "σάββατο"+ , "σαββάτο"+ , "σαβ."+ , "την σάββάτον"+ ]+ , examples (datetime (2013, 2, 17, 0, 0, 0) Day)+ [ "Κυριακή"+ , "κυρ"+ , "κυρ."+ , "την κυριακή"+ ]+ , examples (datetime (2013, 8, 13, 0, 0, 0) Day)+ [ "Τρίτη, 13η Αυγούστου"+ ]+ , examples (datetime (2014, 1, 1, 0, 0, 0) Month)+ [ "ιαν"+ , "ιανουάριος"+ , "ιανουαρίου"+ , "γενάρης"+ , "γενάρη"+ ]+ , examples (datetime (2013, 2, 1, 0, 0, 0) Month)+ [ "φεβ"+ , "φλεβάρης"+ , "φλεβάρη"+ , "φεβρουάριο"+ , "φεβρουαρίου"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Month)+ [ "μάρτης"+ , "μάρτη"+ , "μαρτίου"+ , "μάρτιο"+ , "μάρτιον"+ , "μαρ"+ ]+ , examples (datetime (2013, 4, 1, 0, 0, 0) Month)+ [ "απρίλης"+ , "απρ"+ , "απριλίου"+ , "απριλη"+ , "απρίλιον"+ ]+ , examples (datetime (2013, 5, 1, 0, 0, 0) Month)+ [ "μάη"+ , "μαϊου"+ , "μάιο"+ , "μάης"+ ]+ , examples (datetime (2013, 6, 1, 0, 0, 0) Month)+ [ "ιούνιος"+ , "ιουνίου"+ , "ιούνη"+ , "ιούνιον"+ , "ιουν"+ ]+ , examples (datetime (2013, 7, 1, 0, 0, 0) Month)+ [ "Ιουλ"+ , "ιουλίου"+ , "ιούλη"+ , "ιούλιο"+ ]+ , examples (datetime (2013, 8, 1, 0, 0, 0) Month)+ [ "αυγ"+ , "αυγούστου"+ , "αύγουστο"+ ]+ , examples (datetime (2013, 9, 1, 0, 0, 0) Month)+ [ "σεπτ"+ , "σεπτέμβριος"+ , "σεπτεμβρίου"+ ]+ , examples (datetime (2013, 10, 1, 0, 0, 0) Month)+ [ "Οκτ"+ , "οκτώβρης"+ , "οκτώβρη"+ , "οκτωβρίου"+ , "οκτώβριον"+ ]+ , examples (datetime (2013, 11, 1, 0, 0, 0) Month)+ [ "νοεμ"+ , "νοέμβρης"+ , "νοέμβρη"+ , "νοεμβρίου"+ , "νοέμβριον"+ ]+ , examples (datetime (2013, 12, 1, 0, 0, 0) Month)+ [ "δεκ"+ , "δεκέμβρης"+ , "δεκέμβρη"+ , "δεκεμβρίου"+ , "δεκέμβριον"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "η πρώτη του μάρτη"+ , "πρώτη του μάρτη"+ , "πρώτη μάρτη"+ ]+ , examples (datetime (2013, 4, 3, 0, 0, 0) Day)+ [ "τρεις απρίλη"+ , "τρίτη απρίλη"+ ]+ , examples (datetime (2014, 1, 3, 0, 0, 0) Day)+ [ "τρίτη γενάρη"+ ]+ , examples (datetime (2013, 2, 3, 0, 0, 0) Day)+ [ "τρίτη φλεβάρη"+ ]+ , examples (datetime (2013, 3, 3, 0, 0, 0) Day)+ [ "τρίτη μάρτη"+ ]+ , examples (datetime (2013, 5, 3, 0, 0, 0) Day)+ [ "τρίτη μαϊου"+ ]+ , examples (datetime (2013, 9, 3, 0, 0, 0) Day)+ [ "3 σεπτέμβρη"+ , "3 σεπτεμβρίου"+ , "τρίτη σεπτεμβρίου 2013"+ ]+ , examples (datetime (2013, 9, 3, 0, 0, 0) Day)+ [ "3 σεπτέμβρη"+ , "3 σεπτεμβρίου"+ , "τρίτη σεπτεμβρίου"+ , "τρίτη σεπτεμβρίου 2013"+ ]+ , examples (datetime (2013, 10, 3, 0, 0, 0) Day)+ [ "τρίτη οκτ"+ , "τρίτη οκτώβρη"+ ]+ , examples (datetime (2013, 10, 5, 0, 0, 0) Day)+ [ "πέμπτη οκτωβρίου"+ , "πέμπτη οκτώβρη"+ ]+ , examples (datetime (2013, 9, 3, 0, 0, 0) Day)+ [ "3 σεπτέμβρη"+ , "3 σεπτεμβρίου"+ , "τρίτη σεπτεμβρίου 2013"+ ]+ , examples (datetime (2016, 3, 3, 0, 0, 0) Day)+ [ "τρίτη μάρτη 2016"+ , "3 μαρτίου 2016"+ ]+ , examples (datetime (2016, 4, 5, 0, 0, 0) Day)+ [ "πέμπτη απρίλη 2016"+ , "5 απρ 2016"+ ]+ , examples (datetime (2016, 4, 3, 0, 0, 0) Day)+ [ "τρίτη απρίλη 2016"+ , "3 απρίλης 2016"+ ]+ , examples (datetime (2016, 4, 1, 0, 0, 0) Month)+ [ "απρίλη 2016"+ , "απρίλης 2016"+ ]+ , examples (datetime (2017, 10, 1, 0, 0, 0) Month)+ [ "Οκτ 2017"+ , "Οκτώβρης 2017"+ , "Οκτώβριος 2017"+ ]+ , examples (datetime (2016, 3, 3, 0, 0, 0) Day)+ [ "τρίτη μάρτη 2016"+ , "3η μάρτη 2016"+ , "πέμπτη τρίτη μάρτη 2016"+ ]+ , examples (datetime (2013, 3, 25, 0, 0, 0) Day)+ [ "ευαγγελισμός της θεοτόκου"+ , "ευαγγελισμού της θεοτόκου"+ ]+ , examples (datetime (2015, 3, 3, 0, 0, 0) Day)+ [ "3 μαρτίου 2015"+ , "3η μαρτίου 2015"+ , "τρεις μαρτίου 2015"+ , "3/3/2015"+ , "3/3/15"+ , "2015-3-3"+ , "2015-03-03"+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "στις 15 Φεβρουαρίου"+ , "η 15η Φεβρουαρίου"+ , "15 Φεβρουαρίου"+ , "15η Φεβρουαρίου"+ ]+ , examples (datetime (2013, 8, 8, 0, 0, 0) Day)+ [ "8 Αυγ"+ ]+ , examples (datetime (2014, 7, 18, 0, 0, 0) Day)+ [ "Παρασκευή, 18 Ιουλίου"+ , "Ιουλίου 18, Παρασκευή"+ ]+ , examples (datetime (2014, 10, 1, 0, 0, 0) Month)+ [ "Οκτώβριος 2014"+ ]+ , examples (datetime (2015, 4, 14, 0, 0, 0) Day)+ [ "14απριλίου 2015"+ , "14 Απριλίου, 2015"+ , "14η Απριλίου 15"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "την επόμενη Τρίτη"+ , "περίπου την επόμενη Τρίτη"+ ]+ , examples (datetime (2013, 2, 21, 0, 0, 0) Day)+ [ "την επόμενη πέμπτη"+ , "περίπου την επόμενη Πέμπτη"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "μεθεπόμενη παρασκευή"+ ]+ , examples (datetime (2014, 3, 1, 0, 0, 0) Month)+ [ "επόμενος Μάρτης"+ ]+ , examples (datetime (2015, 3, 1, 0, 0, 0) Month)+ [ "μεθεπόμενος Μάρτης"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "Κυριακή, 10 Φεβρουαρίου"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "Τετ, 13Φεβ"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Week)+ [ "αυτή τη βδομάδα"+ , "τρέχουσα εβδομάδα"+ ]+ , examples (datetime (2013, 2, 4, 0, 0, 0) Week)+ [ "περασμένη εβδομάδα"+ , "προηγούμενη εβδομάδα"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Week)+ [ "επόμενη εβδομάδα"+ , "περίπου την επόμενη εβδομάδα"+ ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Month)+ [ "τον προηγούμενο μήνα"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Month)+ [ "τον επόμενο μήνα"+ ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Quarter)+ [ "αυτό το τρίμηνο"+ ]+ , examples (datetime (2013, 4, 1, 0, 0, 0) Quarter)+ [ "το επόμενο τρίμηνο"+ ]+ , examples (datetime (2013, 7, 1, 0, 0, 0) Quarter)+ [ "τρίτο τρίμηνο"+ , "3ο τρίμηνο"+ , "το τρίτο τρίμηνο"+ ]+ , examples (datetime (2018, 10, 1, 0, 0, 0) Quarter)+ [ "4ο τρίμηνο του 2018"+ , "4ο τρίμηνο 2018"+ , "το 4ο τρίμηνο του 2018"+ ]+ , examples (datetime (2012, 1, 1, 0, 0, 0) Year)+ [ "πέρσι"+ , "πέρυσι"+ , "την περασμένη χρονιά"+ ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Year)+ [ "φέτος"+ , "εφέτος"+ , "αυτή τη χρονιά"+ , "αυτό το έτος"+ ]+ , examples (datetime (2014, 1, 1, 0, 0, 0) Year)+ [ "τουχρόνου"+ , "του χρόνου"+ , "την επόμενη χρονιά"+ , "τον επόμενο χρόνο"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "την προηγούμενη Κυριακή"+ , "την περασμένη Κυριακή"+ ]+ , examples (datetime (2013, 2, 5, 0, 0, 0) Day)+ [ "περασμένη τρίτη"+ ]+ , examples (datetime (2013, 2, 7, 0, 0, 0) Day)+ [ "περασμένη πέμπτη"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "επόμενη Τρίτη"+ ]+ , examples (datetime (2013, 2, 20, 0, 0, 0) Day)+ [ "επόμενη τετάρτη"+ ]+ , examples (datetime (2013, 2, 21, 0, 0, 0) Day)+ [ "επόμενη πέμπτη"+ ]+ , examples (datetime (2013, 2, 20, 0, 0, 0) Day)+ [ "Τετάρτη της επόμενης εβδομάδας"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "τη μεθεπόμενη παρασκευή"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Day)+ [ "χθες"+ , "εχθές"+ , "δευτέρα αυτής της εβδομάδας"+ ]+ , examples (datetime (2013, 2, 12, 0, 0, 0) Day)+ [ "τρίτη αυτής της εβδομάδας"+ , "σήμερα"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "τετάρτη αυτής της εβδομάδας"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "μεθαύριο"+ ]+ , examples (datetime (2013, 2, 14, 17, 0, 0) Hour)+ [ "μεθαύριο στις 5μμ"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "προχτές"+ ]+ , examples (datetime (2013, 2, 10, 8, 0, 0) Hour)+ [ "προχθές στις 8πμ"+ ]+ , examples (datetime (2013, 3, 25, 0, 0, 0) Day)+ [ "τελευταία Δευτέρα του Μάρτη"+ ]+ , examples (datetime (2014, 3, 30, 0, 0, 0) Day)+ [ "τελευταία Κυριακή του Μάρτη του 2014"+ ]+ , examples (datetime (2013, 10, 3, 0, 0, 0) Day)+ [ "τρίτη μέρα του Οκτώβρη"+ ]+ , examples (datetime (2014, 10, 6, 0, 0, 0) Week)+ [ "πρώτη βδομάδα του Οκτώβρη του 2014"+ ]+ , examples (datetime (2013, 10, 7, 0, 0, 0) Week)+ [ "η εβδομάδα της 6ης Οκτωβρίου"+ ]+ , examples (datetime (2013, 10, 7, 0, 0, 0) Week)+ [ "η εβδομάδα της 7ης Οκτωβρίου"+ ]+ , examples (datetime (2015, 10, 31, 0, 0, 0) Day)+ [ "η τελευταία μέρα του Οκτωβρίου του 2015"+ , "η τελευταία μέρα στον Οκτώβρη του 2015"+ ]+ , examples (datetime (2014, 9, 22, 0, 0, 0) Week)+ [ "η τελευταία βδομάδα Σεπτεμβρίου του 2014"+ ]+ , examples (datetime (2013, 10, 1, 0, 0, 0) Day)+ [ "πρώτη Τρίτη του Οκτώβρη"+ ]+ , examples (datetime (2013, 2, 12, 16, 0, 0) Hour)+ [ "Τρίτη στις 4 το απόγευμα"+ ]+ , examples (datetime (2013, 2, 13, 16, 0, 0) Hour)+ [ "Τετάρτη στις 4 το απόγευμα"+ ]+ , examples (datetime (2014, 9, 16, 0, 0, 0) Day)+ [ "τρίτη Τρίτη του Σεπτ 2014"+ ]+ , examples (datetime (2014, 10, 1, 0, 0, 0) Day)+ [ "πρώτη Τετάρτη του Οκτωβρίου 2014"+ ]+ , examples (datetime (2014, 10, 8, 0, 0, 0) Day)+ [ "δεύτερη Τετάρτη του Οκτωβρίου 2014"+ ]+ , examples (datetime (2015, 1, 8, 0, 0, 0) Day)+ [ "Τρίτη Πέμπτη μετά τα Χριστούγεννα του 2014"+ ]+ , examples (datetime (2013, 2, 13, 3, 0, 0) Hour)+ [ "στις 3πμ"+ , "3 το πρωί"+ , "3πμ"+ , "3 η ώρα το πρωί"+ , "στις 3 πμ"+ ]+ , examples (datetime (2013, 2, 13, 3, 18, 0) Minute)+ [ "3:18πμ"+ , "3:18π"+ ]+ , examples (datetime (2013, 2, 12, 15, 0, 0) Hour)+ [ "στις 3μμ"+ , "@ 3μμ"+ , "3ΜΜ"+ , "3μμ"+ , "3 η ώρα μμ"+ , "3 η ώρα το απόγευμα"+ , "3 το απόγευμα"+ , "3 και κάτι μμ"+ , "3μμ περίπου"+ , "περίπου 3μμ"+ ]+ , examples (datetime (2013, 2, 12, 15, 15, 0) Minute)+ [ "στα 15 λεπτά μετά τις 3μμ"+ , "ένα τέταρτο μετά τις 3μμ"+ , "3 και τέταρτο μμ"+ , "3:15 το απόγευμα"+ , "15:15"+ , "3:15μμ"+ , "3:15ΜΜ"+ , "3:15μ"+ , "στις 3 και 15"+ ]+ , examples (datetime (2013, 2, 12, 15, 20, 0) Minute)+ [ "20 λεπτά μετά τις 3μμ"+ , "3:20 το απόγευμα"+ , "είκοσι μετά τις 3μμ"+ , "3:20μ"+ , "στις τρεις και είκοσι"+ ]+ , examples (datetime (2013, 2, 12, 15, 30, 0) Minute)+ [ "στις τρεις και μισή μμ"+ , "τρεισήμισι μμ"+ , "Τρεισήμισι μμ"+ , "15:30"+ , "3:30μμ"+ , "3:30ΜΜ"+ , "330 μ.μ."+ , "3:30 μ μ"+ , "3:30 μμ"+ , "τρεις και μισή"+ ]+ , examples (datetime (2013, 2, 12, 15, 23, 24) Second)+ [ "15:23:24"+ ]+ , examples (datetime (2013, 2, 12, 11, 45, 0) Minute)+ [ "ένα τέταρτο πριν το μεσημέρι"+ , "11:45πμ"+ , "δώδεκα παρά τέταρτο"+ , "12 παρά τέταρτο"+ ]+ , examples (datetime (2013, 2, 12, 20, 0, 0) Hour)+ [ "απόψε στις 8"+ , "8 το βράδυ"+ , "στις 8 το βράδυ"+ ]+ , examples (datetime (2013, 9, 20, 19, 30, 0) Minute)+ [ "στις 7:30 μμ την Παρασκευή, 20 Σεπτ"+ ]+ , examples (datetime (2013, 2, 16, 9, 0, 0) Hour)+ [ "το Σάββατο στις 9πμ"+ ]+ , examples (datetime (2014, 7, 18, 19, 0, 0) Minute)+ [ "Παρ, 18 Ιουλ, 2014 07:00 μμ"+ ]+ , examples (datetime (2013, 2, 12, 4, 30, 1) Second)+ [ "σε ένα δεύτερο"+ , "σε ένα δευτερόλεπτο από τώρα"+ , "σε 1\""+ ]+ , examples (datetime (2013, 2, 12, 4, 31, 0) Second)+ [ "σε ένα λεπτό"+ , "σε 1'"+ ]+ , examples (datetime (2013, 2, 12, 4, 32, 0) Second)+ [ "σε 2 λεπτά"+ , "σε 2 λεπτά ακόμα"+ , "2 λεπτά από τώρα"+ ]+ , examples (datetime (2013, 2, 12, 11, 40, 0) Minute)+ [ "20 λεπτά πριν τις 12"+ , "11:40"+ ]+ , examples (datetime (2013, 2, 12, 12, 20, 0) Minute)+ [ "20 λεπτά μετά τις 12"+ , "12:20"+ ]+ , examples (datetime (2013, 2, 12, 4, 33, 0) Second)+ [ "σε τρία λεπτά"+ , "σε μερικά λεπτά"+ ]+ , examples (datetime (2013, 2, 12, 5, 30, 0) Second)+ [ "σε 60 λεπτά"+ ]+ , examples (datetime (2013, 2, 12, 4, 45, 0) Second)+ [ "σε ένα τέταρτο της ώρας"+ , "σε 1/4ω"+ , "σε 1/4 ω"+ , "σε 1/4 της ώρας"+ ]+ , examples (datetime (2013, 2, 12, 5, 0, 0) Second)+ [ "σε μισή ώρα"+ , "σε 1/2ω"+ , "σε 1/2 ω"+ , "σε 1/2 ώρα"+ ]+ , examples (datetime (2013, 2, 12, 5, 15, 0) Second)+ [ "σε τρία τέταρτα της ώρας"+ , "σε 3/4ω"+ , "σε 3/4 ω"+ , "σε 3/4 της ώρας"+ ]+ , examples (datetime (2013, 2, 12, 7, 0, 0) Second)+ [ "σε 2,5 ώρες"+ , "σε 2 και μισή ώρες"+ ]+ , examples (datetime (2013, 2, 12, 5, 30, 0) Minute)+ [ "σε μία ώρα"+ , "σε 1ω"+ ]+ , examples (datetime (2013, 2, 12, 6, 30, 0) Minute)+ [ "σε δύο ώρες"+ , "σε δυο ώρες"+ ]+ , examples (datetime (2013, 2, 12, 7, 30, 0) Minute)+ [ "σε μερικές ώρες"+ ]+ , examples (datetime (2013, 2, 13, 4, 30, 0) Minute)+ [ "σε 24 ώρες"+ ]+ , examples (datetime (2013, 2, 13, 4, 0, 0) Hour)+ [ "σε μία μέρα"+ ]+ , examples (datetime (2013, 2, 13, 4, 30, 0) Second)+ [ "σε μία μέρα από τώρα αμέσως"+ , "σε μία μέρα από τώρα"+ ]+ , examples (datetime (2016, 2, 12, 0, 0, 0) Day)+ [ "3 χρόνια από σήμερα"+ ]+ , examples (datetime (2013, 2, 19, 4, 0, 0) Hour)+ [ "σε 7 μέρες"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "σε μία βδομάδα"+ ]+ , examples (datetime (2013, 2, 12, 5, 0, 0) Second)+ [ "σε περίπου μισή ώρα"+ ]+ , examples (datetime (2013, 2, 5, 4, 0, 0) Hour)+ [ "πριν από 7 μέρες"+ ]+ , examples (datetime (2013, 1, 29, 4, 0, 0) Hour)+ [ "πριν από 14 μέρες"+ , "14 μέρες πριν"+ ]+ , examples (datetime (2013, 2, 5, 0, 0, 0) Day)+ [ "πριν από μια βδομάδα"+ , "πριν από 1 βδομάδα"+ ]+ , examples (datetime (2013, 1, 22, 0, 0, 0) Day)+ [ "πριν από τρεις βδομάδες"+ ]+ , examples (datetime (2012, 11, 12, 0, 0, 0) Day)+ [ "πριν από τρεις μήνες"+ ]+ , examples (datetime (2011, 2, 1, 0, 0, 0) Month)+ [ "πριν από δύο χρόνια"+ ]+ , examples (datetime (1954, 1, 1, 0, 0, 0) Year)+ [ "1954"+ ]+ , examples (datetime (2013, 2, 19, 4, 0, 0) Hour)+ [ "εδώ και 7 μέρες"+ ]+ , examples (datetime (2013, 2, 26, 4, 0, 0) Hour)+ [ "εδώ και 14 μέρες"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "εδώ και μια βδομάδα"+ , "εδώ και 1 βδομάδα"+ ]+ , examples (datetime (2013, 3, 5, 0, 0, 0) Day)+ [ "εδώ και τρεις βδομάδες"+ ]+ , examples (datetime (2013, 5, 12, 0, 0, 0) Day)+ [ "εδώ και τρεις μήνες"+ ]+ , examples (datetime (2015, 2, 1, 0, 0, 0) Month)+ [ "εδώ και δύο χρόνια"+ ]+ , examples (datetime (2013, 12, 25, 0, 0, 0) Day)+ [ "ένα χρόνο μετά τα Χριστούγεννα"+ ]+ , examples (datetimeInterval ((2013, 12, 18, 0, 0, 0), (2013, 12, 29, 0, 0, 0)) Day)+ [ "για 10 μέρες μετά τις 18 Δεκεμβρίου"+ ]+ , examples (datetimeInterval ((2013, 9, 23, 0, 0, 0), (2013, 12, 22, 0, 0, 0)) Day)+ [ "αυτό το φθινόπωρο"+ , "αυτού του φθινοπώρου"+ ]+ , examples (datetimeInterval ((2013, 6, 21, 0, 0, 0), (2013, 9, 24, 0, 0, 0)) Day)+ [ "αυτό το καλοκαίρι"+ , "το τρέχον καλοκαίρι"+ ]+ , examples (datetimeInterval ((2012, 12, 21, 0, 0, 0), (2013, 3, 21, 0, 0, 0)) Day)+ [ "αυτό το χειμώνα"+ ]+ , examples (datetime (2013, 12, 25, 0, 0, 0) Day)+ [ "Χριστούγεννα"+ ]+ , examples (datetime (2013, 12, 31, 0, 0, 0) Day)+ [ "παραμονή πρωτοχρονιάς"+ , "παραμονές πρωτοχρονιάς"+ ]+ , examples (datetime (2014, 1, 1, 0, 0, 0) Day)+ [ "ανήμερα πρωτοχρονιάς"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "του Αγίου Βαλεντίνου"+ , "ημέρα του Αγίου Βαλεντίνου"+ ]+ , examples (datetime (2013, 5, 12, 0, 0, 0) Day)+ [ "ημέρα της μητέρας"+ , "η μέρα της μητέρας"+ ]+ , examples (datetime (2012, 5, 13, 0, 0, 0) Day)+ [ "προηγούμενη μέρα της μητέρας"+ ]+ , examples (datetime (2014, 5, 11, 0, 0, 0) Day)+ [ "η μέρα της μητέρας του 2014"+ ]+ , examples (datetime (2013, 6, 16, 0, 0, 0) Day)+ [ "η μέρα του πατέρα"+ ]+ , examples (datetime (2012, 6, 17, 0, 0, 0) Day)+ [ "προηγούμενη μέρα του πατέρα"+ ]+ , examples (datetime (1996, 6, 16, 0, 0, 0) Day)+ [ "η μέρα του πατέρα το 1996"+ ]+ , examples (datetime (2013, 3, 25, 0, 0, 0) Day)+ [ "η μέρα της επανάστασης"+ ]+ , examples (datetime (2012, 3, 25, 0, 0, 0) Day)+ [ "η περασμένη μέρα της επανάστασης"+ , "η μέρα της επανάστασης της περασμένης χρονιάς"+ , "η μέρα της επανάστασης της περσινής χρονιάς"+ , "η μέρα της επανάστασης πέρσι"+ , "η μέρα της επανάστασης πέρυσι"+ ]+ , examples (datetime (2013, 10, 31, 0, 0, 0) Day)+ [ "halloween"+ , "το halloween του 2013"+ ]+ , examples (datetime (2014, 10, 31, 0, 0, 0) Day)+ [ "το επόμενο halloween"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 18, 0, 0), (2013, 2, 13, 0, 0, 0)) Hour)+ [ "απόψε"+ , "σήμερα το βράδυ"+ , "απόψε το βράδυ"+ ]+ , examples (datetimeInterval ((2013, 2, 8, 18, 0, 0), (2013, 2, 11, 0, 0, 0)) Hour)+ [ "το περασμένο σαββατοκύριακο"+ , "το περασμένο ΣΚ"+ , "το προηγούμενο σαββατοκύριακο"+ , "το προηγούμενο σκ"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 18, 0, 0), (2013, 2, 14, 0, 0, 0)) Hour)+ [ "αύριο βράδυ"+ , "αύριο το βράδυ"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 12, 0, 0), (2013, 2, 13, 18, 0, 0)) Hour)+ [ "αύριο το απόγευμα"+ ]+ , examples (datetimeInterval ((2013, 2, 11, 18, 0, 0), (2013, 2, 12, 0, 0, 0)) Hour)+ [ "χθες το βράδυ"+ ]+ , examples (datetimeInterval ((2013, 2, 15, 18, 0, 0), (2013, 2, 18, 0, 0, 0)) Hour)+ [ "αυτό το σαββατοκύριακο"+ , "αυτό το σκ"+ ]+ , examples (datetimeInterval ((2013, 2, 18, 4, 0, 0), (2013, 2, 18, 12, 0, 0)) Hour)+ [ "δευτέρα το πρωί"+ , "δευτέρα πρωί"+ ]+ , examples (datetimeInterval ((2013, 2, 18, 4, 0, 0), (2013, 2, 18, 9, 0, 0)) Hour)+ [ "Δευτέρα νωρίς το πρωί"+ ]+ , examples (datetimeInterval ((2013, 2, 15, 4, 0, 0), (2013, 2, 15, 12, 0, 0)) Hour)+ [ "15 Φεβρουαρίου το πρωί"+ , "το πρωί της 15ης Φεβρουαρίου"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 29, 58), (2013, 2, 12, 4, 30, 0)) Second)+ [ "τα τελευταία 2 δευτερόλεπτα"+ , "τα τελευταία 2 δεύτερα"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 1), (2013, 2, 12, 4, 30, 4)) Second)+ [ "τα επόμενα 3 δευτερόλεπτα"+ , "τα επόμενα τρία δεύτερα"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 28, 0), (2013, 2, 12, 4, 30, 0)) Minute)+ [ "τα τελευταία 2 λεπτά"+ , "τα τελευταία δύο λεπτά"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 31, 0), (2013, 2, 12, 4, 34, 0)) Minute)+ [ "τα επόμενα 3 λεπτά"+ , "τα επόμενα τρία λεπτά"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 3, 0, 0), (2013, 2, 12, 4, 0, 0)) Hour)+ [ "η τελευταία 1 ώρα"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 5, 0, 0), (2013, 2, 12, 8, 0, 0)) Hour)+ [ "οι επόμενες 3 ώρες"+ , "τις επόμενες τρεις ώρες"+ ]+ , examples (datetimeInterval ((2013, 2, 10, 0, 0, 0), (2013, 2, 12, 0, 0, 0)) Day)+ [ "τελευταίες 2 μέρες"+ , "περασμένες 2 μέρες"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 16, 0, 0, 0)) Day)+ [ "επόμενες τρεις μέρες"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 16, 0, 0, 0)) Day)+ [ "επόμενες μερικές μέρες"+ ]+ , examples (datetimeInterval ((2013, 1, 28, 0, 0, 0), (2013, 2, 11, 0, 0, 0)) Week)+ [ "τελευταίες 2 εβδομάδες"+ ]+ , examples (datetimeInterval ((2013, 2, 18, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Week)+ [ "επόμενες 3 βδομάδες"+ ]+ , examples (datetimeInterval ((2012, 12, 1, 0, 0, 0), (2013, 2, 1, 0, 0, 0)) Month)+ [ "τελευταίοι 2 μήνες"+ , "περασμένοι 2 μήνες"+ ]+ , examples (datetimeInterval ((2013, 3, 1, 0, 0, 0), (2013, 6, 1, 0, 0, 0)) Month)+ [ "επόμενοι 3 μήνες"+ ]+ , examples (datetimeInterval ((2011, 1, 1, 0, 0, 0), (2013, 1, 1, 0, 0, 0)) Year)+ [ "τελευταία 2 χρόνια"+ ]+ , examples (datetimeInterval ((2014, 1, 1, 0, 0, 0), (2017, 1, 1, 0, 0, 0)) Year)+ [ "επόμενα 3 χρόνια"+ ]+ , examples (datetimeInterval ((2013, 7, 13, 0, 0, 0), (2013, 7, 16, 0, 0, 0)) Day)+ [ "13-15 Ιουλίου"+ , "13 με 15 Ιουλίου"+ , "13 Ιουλίου - 15 Ιουλίου"+ , "από τις 13-15 Ιουλίου"+ , "από τις 13 μέχρι τις 15 Ιουλίου"+ , "από τη 13η μέχρι την 15η Ιουλίου"+ ]+ , examples (datetimeInterval ((2013, 8, 8, 0, 0, 0), (2013, 8, 13, 0, 0, 0)) Day)+ [ "8 Αυγ - 12 Αυγ"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 9, 30, 0), (2013, 2, 12, 11, 1, 0)) Minute)+ [ "9:30 - 11:00"+ , "9:30 - 11:00 την Τρίτη"+ ]+ , examples (datetimeInterval ((2013, 2, 14, 9, 30, 0), (2013, 2, 14, 11, 1, 0)) Minute)+ [ "Πέμπτη από 9:30 μέχρι 11:00"+ , "Πέμπτη μεταξύ 9:30 και 11:00"+ , "Πέμπτη από τις 9:30 - 11:00"+ , "Πέμπτη από 9:30 μέχρι 11:00"+ , "Πέμπτη 9:30 - 11:00"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 1, 0, 0), (2013, 2, 13, 2, 31, 0)) Minute)+ [ "αύριο μεταξύ 1-2:30"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 15, 0, 0), (2013, 2, 12, 17, 0, 0)) Hour)+ [ "3-4 μμ"+ , "από 3 μέχρι 4 το απόγευμα"+ , "περίπου 3-4 μμ"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 15, 30, 0), (2013, 2, 12, 19, 0, 0)) Minute)+ [ "3:30 μέχρι 6 μμ"+ , "3:30-6 μ.μ."+ ]+ , examples (datetimeInterval ((2013, 2, 12, 8, 0, 0), (2013, 2, 12, 14, 0, 0)) Hour)+ [ "8πμ - 1μμ"+ ]+ , examples (datetimeInterval ((2013, 2, 14, 9, 0, 0), (2013, 2, 14, 12, 0, 0)) Hour)+ [ "Πέμπτη από 9π μέχρι 11π"+ , "αυτή την Πέμπτη 9-11πμ"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 11, 30, 0), (2013, 2, 12, 13, 31, 0)) Minute)+ [ "11:30-1:30"+ ]+ , examples (datetime (2013, 9, 21, 13, 30, 0) Minute)+ [ "1:30 μμ το Σάββατο, 21 Σεπτ"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 26, 0, 0, 0)) Second)+ [ "μέσα σε 2 βδομάδες"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 12, 14, 0, 0)) Second)+ [ "μέχρι τις 2:00μμ"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 13, 0, 0, 0)) Second)+ [ "μέχρι το τέλος της ημέρας"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 3, 1, 0, 0, 0)) Second)+ [ "μέχρι το τέλος του μήνα"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 4, 1, 0, 0, 0)) Second)+ [ "μέχρι το τέλος του επόμενου μήνα"+ ]+ , examples (datetime (2013, 2, 12, 13, 0, 0) Minute)+ [ "4μμ CET"+ ]+ , examples (datetime (2013, 2, 14, 6, 0, 0) Minute)+ [ "Πέμπτη 8:00 GMT"+ , "Πέμπτη 8:00 gmt"+ , "Πεμ στις 8 GMT"+ , "Πεμ στις 8 gmt"+ ]+ , examples (datetime (2013, 2, 12, 14, 0, 0) Hour)+ [ "σήμερα στις 2μμ"+ , "στις 2μμ"+ ]+ , examples (datetime (2013, 2, 13, 15, 0, 0) Hour)+ [ "3μμ αύριο"+ ]+ , examples (datetimeOpenInterval After (2013, 2, 12, 14, 0, 0) Hour)+ [ "μετά τις 2μμ"+ ]+ , examples (datetime (2013, 2, 17, 4, 0, 0) Hour)+ [ "σε 5 μέρες"+ ]+ , examples (datetimeOpenInterval Before (2013, 2, 12, 11, 0, 0) Hour)+ [ "πριν τις 11 το πρωί"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 8, 0, 0), (2013, 2, 12, 19, 0, 0)) Hour)+ [ "8πμ μέχρι τις 6"+ ]+ , examples (datetime (2013, 2, 12, 13, 30, 0) Minute)+ [ "στις 1:30μμ"+ , "1:30μμ"+ ]+ , examples (datetime (2013, 2, 12, 4, 45, 0) Second)+ [ "σε 15 λεπτά"+ , "σε 15'"+ ]+ , examples (datetime (2013, 2, 12, 10, 30, 0) Minute)+ [ "10:30"+ , "περίπου 1030"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 0, 0), (2013, 2, 12, 12, 0, 0)) Hour)+ [ "σήμερα το πρωί"+ ]+ , examples (datetime (2013, 2, 25, 0, 0, 0) Day)+ [ "επόμενη δευτέρα"+ ]+ , examples (datetime (2013, 2, 12, 12, 0, 0) Hour)+ [ "στις 12μμ"+ , "το μεσημέρι"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Hour)+ [ "στις 12 πμ"+ , "τα μεσάνυχτα"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Month)+ [ "Μάρτιος"+ , "στο Μάρτιο"+ , "το Μάρτιο"+ ]+ , examples (datetime (2013, 2, 13, 17, 0, 0) Hour)+ [ "αύριο το απόγευμα στις 5"+ , "στις 5 αύριο το απόγευμα"+ , "στις 5 αύριο απόγευμα"+ , "στις 5 μμ αύριο"+ , "αύριο στις 5 μμ"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 12, 0, 0), (2013, 2, 13, 18, 0, 0)) Hour)+ [ "αύριο το απόγευμα"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 13, 0, 0), (2013, 2, 13, 15, 0, 0)) Hour)+ [ "1μμ-2μμ αύριο"+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "την 1η"+ , "την πρώτη"+ ]+ , examples (datetime (2013, 2, 12, 19, 30, 0) Minute)+ [ "στις 7:30 το βράδυ"+ ]+ , examples (datetime (2013, 2, 12, 23, 0, 0) Hour)+ [ "απόψε στις 11"+ ]+ , examples (datetime (2013, 2, 12, 4, 23, 0) Minute)+ -- yes, the result is in the past, we may need to revisit+ [ "στις 4:23"+ , "4:23πμ"+ ]+ , examples (datetimeInterval ((2013, 3, 1, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Day)+ [ "αρχές Μάρτη"+ ]+ , examples (datetimeInterval ((2013, 3, 11, 0, 0, 0), (2013, 3, 21, 0, 0, 0)) Day)+ [ "μέσα Μάρτη"+ ]+ , examples (datetimeInterval ((2013, 3, 21, 0, 0, 0), (2013, 4, 1, 0, 0, 0)) Day)+ [ "τέλη Μάρτη"+ ]+ , examples (datetimeInterval ((2013, 10, 25, 18, 0, 0), (2013, 10, 28, 0, 0, 0)) Hour)+ [ "τελευταίο σαββατοκύριακο του Οκτωβρίου"+ ]+ , examples (datetimeInterval ((2013, 7, 26, 18, 0, 0), (2013, 7, 29, 0, 0, 0)) Hour)+ [ "τελευταίο ΣΚ του Ιουλίου"+ ]+ , examples (datetimeInterval ((2017, 10, 27, 18, 0, 0), (2017, 10, 30, 0, 0, 0)) Hour)+ [ "τελευταίο σκ του Οκτ 2017"+ ]+ , examples (datetimeInterval ((2013, 8, 27, 0, 0, 0), (2013, 8, 30, 0, 0, 0)) Day)+ [ "27η - 29η Αυγούστου"+ ]+ , examples (datetimeInterval ((2013, 10, 23, 0, 0, 0), (2013, 10, 27, 0, 0, 0)) Day)+ [ "23η με 26η Οκτ"+ ]+ , examples (datetimeInterval ((2013, 9, 1, 0, 0, 0), (2013, 9, 9, 0, 0, 0)) Day)+ [ "1-8 Σεπτεμβρίου"+ ]+ , examples (datetimeInterval ((2013, 9, 12, 0, 0, 0), (2013, 9, 17, 0, 0, 0)) Day)+ [ "12 με 16 Σεπτ"+ ]+ , examples (datetimeInterval ((2013, 8, 19, 0, 0, 0), (2013, 8, 22, 0, 0, 0)) Day)+ [ "19η με 21η αυγ"+ ]+ ]
+ Duckling/Time/EL/Rules.hs view
@@ -0,0 +1,1783 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EL.Rules+ ( rules ) where++import Data.HashMap.Strict (HashMap)+import Data.Text (Text)+import Prelude+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers (duration)+import Duckling.Duration.Types (DurationData (DurationData))+import Duckling.Numeral.Helpers (parseInt, numeralMapEL)+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Ordinal.Types (OrdinalData (..), isBetween)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.Ordinal.Types as TOrdinal+import qualified Duckling.Time.Types as TTime+import qualified Duckling.TimeGrain.Types as TG++ruleInstants :: [Rule]+ruleInstants = mkRuleInstants+ [ ( "now" , TG.Second, 0, "(αμέσως\\s+)?τώρα(\\s+αμέσως)?|αυτή τη στιγμή" )+ , ( "today" , TG.Day , 0, "σήμερα" )+ , ( "tomorrow" , TG.Day , 1, "(επ)?αύριο" )+ , ( "yesterday" , TG.Day , -1, "ε?χ[θτ][εέ]ς" )+ , ( "after tomorrow" , TG.Day , 2, "μεθαύριο" )+ , ( "before yesterday", TG.Day , -2, "προχ[θτ]ές" )+ , ( "EOD|End of day" , TG.Day , 1, "τέλου?ς\\s+της\\s+η?μέρας")+ , ( "EOM|End of month", TG.Month , 1, "τέλου?ς\\s+του\\s+μήνα" )+ , ( "EOY|End of year" , TG.Year , 1, "τέλου?ς\\s+του\\s+χρόνου" )+ ]++daysOfWeek :: [(Text, String)]+daysOfWeek =+ [ ( "monday" , "δευτ(έρας?|\\.?)" )+ , ( "tuesday" , "τρ[ιί](της?|\\.?)" )+ , ( "wednesday" , "τετ(άρτης?|\\.?)" )+ , ( "thursday" , "π[εέ]μ(πτης?|\\.?)" )+ , ( "friday" , "παρ(ασκευής?|\\.?)" )+ , ( "saturday" , "σ[αά]β(β[αά]το[νυ]?|\\.?)" )+ , ( "sunday" , "κυρ(ιακής?|\\.?)" )+ ]++ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = zipWith go daysOfWeek [1..7]+ where+ go (name, regexPattern) i = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = const . tt . mkOkForThisNext $ dayOfWeek i+ }++months :: [(Text, String)]+months =+ [ ( "January" , "ιαν(ου[αά]ρ[ιί]ο[υς]?)?|γενάρης?" )+ , ( "February" , "φεβ(ρου[αά]ρ[ιί]ο[υς]?)?|φλεβάρης?" )+ , ( "March" , "μ[αά]ρ(τ([ιί]ο([νυ]?)|η)ς?)?" )+ , ( "April" , "απρ([ιί]λ([ιί]ο([νυ]?)|η)ς?)?" )+ , ( "May" , "μ[αά]([ιίϊΐ]ο[νυ]?|η)ς?" )+ , ( "June" , "ιο[υύ]ν([ιί]ο[υν]?|η)?ς?" )+ , ( "July" , "ιο[υύ]λ([ιί]ο[υν]?|η)?ς?" )+ , ( "August" , "α[υύ]γ(ο[υύ]στο(ν|υ|ς)?)?" )+ , ( "September", "σεπτ([εέ]μβρ([ιί]ο([νυ]?)|η)ς?)?" )+ , ( "October" , "οκτ([ωώ]βρ([ιί]ο([νυ]?)|η)ς?)?" )+ , ( "November" , "νο[εέ](μ(βρ([ιί]ο([νυ]?)|η)ς?)?)?" )+ , ( "December" , "δεκ([εέ]μβρ([ιί]ο([νυ]?)|η)ς?)?" )+ ]++ruleMonths :: [Rule]+ruleMonths = zipWith go months [1..12]+ where+ go (name, regexPattern) i = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = const . tt . mkOkForThisNext $ month i+ }++ruleSeasons :: [Rule]+ruleSeasons = mkRuleSeasons+ [ ( "summer" , "καλοκα[ιί]ρι(ού)?", monthDay 6 21, monthDay 9 23 )+ , ( "fall" , "φθιν[οό]π[ωώ]ρου?", monthDay 9 23, monthDay 12 21 )+ , ( "winter" , "χειμώνας?" , monthDay 12 21, monthDay 3 20 )+ , ( "spring" , "άνοιξης?" , monthDay 3 20, monthDay 6 21 )+ ]++ruleHolidays :: [Rule]+ruleHolidays = map go holidays+ where+ go (name, td, regexPattern) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = const . tt $ mkOkForThisNext td+ }++holidays :: [(Text, TimeData, String)]+holidays =+ [ ("new year's day" , monthDay 1 1, "πρωτοχρονιάς?")+ , ("valentine's day" , monthDay 2 14, "αγίου\\s+βαλεντίνου")+ , ("halloween day" , monthDay 10 31, "halloween")+ , ("Epiphany" , monthDay 1 6, "θεοφ(αά)νε[ιί](α|ων)|φ[ωώ]τ(α|ων)")+ , ("annunciation day" , monthDay 3 25, "ευαγγελισμ(ός|ού)\\s+της\\s+θεοτόκου")+ , ("revolution day" , monthDay 3 25+ , "η?μέρα\\s+(της\\s+)?(ελληνικής\\s+)?επανάστασης")+ , ("assumption day" , monthDay 8 15+ , "κο[ιί]μ[ηή]σ(η|ις|εως)\\s+της\\s+θεοτόκου")+ , ("christmas eve" , monthDay 12 24, "παραμν(ή|έ)ς?\\s+χριστουγέννων")+ , ("christmas" , monthDay 12 25, "χριστο[υύ]γ[εέ]νν(α|ων)")+ , ("new year's eve" , monthDay 12 31, "παραμον(ή|έ)ς?\\s+πρωτοχρονιάς")+ , ("Mother's Day" , nthDOWOfMonth 2 7 5, "η?μέρας?\\s+της\\s+μητέρας")+ , ("Father's Day" , nthDOWOfMonth 3 7 6+ , "(γιορτής?|η?μέρας?)\\s+του\\s+πατέρα")+ ]++ruleRelativeIntegerToOrAfterIntegerPartOfDay :: Rule+ruleRelativeIntegerToOrAfterIntegerPartOfDay = Rule+ { name = "relative integer (minutes) to|till|before|after <integer> (time-of-day)"+ , pattern =+ [ Predicate $ isIntegerBetween 1 30+ , regex "(πριν|μετά)"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "πριν" -> tt $ durationBefore (duration TG.Minute $ floor v) td+ _ -> tt $ durationAfter (duration TG.Minute $ floor v) td+ _ -> Nothing+ }++ruleQuarterBeforeOrAfterIntegerHourofday :: Rule+ruleQuarterBeforeOrAfterIntegerHourofday = Rule+ { name = "quarter to|past <integer> (hour-of-day)"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "(παρά|και)\\s+τέταρτο"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "παρά" -> Token Time <$> minutesBefore 15 td+ _ -> Token Time <$> minutesAfter 15 td+ _ -> Nothing+ }++ruleHalfAfterIntegerHourofday :: Rule+ruleHalfAfterIntegerHourofday = Rule+ { name = "half after|past <integer> (hour-of-day)"+ , pattern =+ [ Predicate isAnHourOfDay+ , regex "και μισή"+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:+ _) -> tt $ hourMinute is12H hours 30+ _ -> Nothing+ }++ruleHalfAfterIntegerHourofday2 :: Rule+ruleHalfAfterIntegerHourofday2 = Rule+ { name = "<integer>-and-half (hour-of-day)"+ , pattern =+ [ regex $ "(μιά|ενά|δυό|τρεισή|τεσσερι?σή|πεντέ|εξί|ε[πφ]τά|ο[κχ]τώ|εννιά|"+ ++ "δεκά|εντεκά|δωδεκά)μισ[ιη]ς?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (num:_)):_) ->+ case HashMap.lookup (Text.toLower num) numeralMapEL of+ Just hours -> tt $ hourMinute True hours 30+ _ -> Nothing+ _ -> Nothing+ }++ruleOrdinalCycleOfTime :: Rule+ruleOrdinalCycleOfTime = Rule+ { name = "<ordinal> <cycle> of <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:Token TimeGrain grain:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleLastTime :: Rule+ruleLastTime = Rule+ { name = "last <time>"+ , pattern =+ [ regex "(τελευταί|περασμέν|προηγο[υύ]μ[εέ]ν)(α|ά|ο[υύ]?|η|ή|ε|έ|ω|ώ)ν?ς?"+ , Predicate isOkWithThisNext+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth (-1) False td+ _ -> Nothing+ }++ruleDatetimeDatetimeInterval :: Rule+ruleDatetimeDatetimeInterval = Rule+ { name = "<datetime> - <datetime> (interval)"+ , pattern =+ [ Predicate isNotLatent+ , regex "\\-|μ[εέ](χρι)?(\\s+τις)?"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time . notLatent <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleEvening :: Rule+ruleEvening = Rule+ { name = "evening"+ , pattern =+ [ regex "βράδυ"+ ]+ , prod = \_ ->+ let from = hour False 18+ to = hour False 0+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleTheDayofmonthNonOrdinal :: Rule+ruleTheDayofmonthNonOrdinal = Rule+ { name = "the <day-of-month> (non ordinal)"+ , pattern =+ [ regex "τ?η[νς]?"+ , Predicate $ isIntegerBetween 1 31+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> Token Time . dayOfMonth <$> getIntValue token+ _ -> Nothing+ }++rulePartOfMonth :: Rule+rulePartOfMonth = Rule+ { name = "part of <named-month>"+ , pattern =+ [ regex "(αρχ(?:ές|η)|μέσ[οα]υ?|τέλ(?:ου?ς|η))(?:\\s+του)?"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):Token Time td:_) -> do+ (sd, ed) <- case Text.take 3 $ Text.toLower match of+ "αρχ" -> Just (1, 10)+ "μέσ" -> Just (11, 20)+ "τέλ" -> Just (21, -1)+ _ -> Nothing+ start <- intersect td $ dayOfMonth sd+ end <- if ed /= -1+ then intersect td $ dayOfMonth ed+ else Just $ cycleLastOf TG.Day td+ Token Time <$> interval TTime.Open start end+ _ -> Nothing+ }++ruleInDuration :: Rule+ruleInDuration = Rule+ { name = "in <duration>"+ , pattern =+ [ regex "σε"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleLastCycleOfTime :: Rule+ruleLastCycleOfTime = Rule+ { name = "last <cycle> of <time>"+ , pattern =+ [ regex "τελευταί(ο[ιυ]?ς?|α|ες|ων)"+ , dimension TimeGrain+ , regex "σ?τ(ο[υν]?|η[νς]?|ων)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleLastOf grain td+ _ -> Nothing+ }++ruleLastCycleOfTimeS :: Rule+ruleLastCycleOfTimeS = Rule+ { name = "last <cycle> <time>'s'"+ , pattern =+ [ regex "τελευταί(ο[ιυ]?ς?|α|ες|ων)"+ , dimension TimeGrain+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:Token Time td:_) ->+ tt $ cycleLastOf grain td+ _ -> Nothing+ }++ruleFromDatetimeDatetimeInterval :: Rule+ruleFromDatetimeDatetimeInterval = Rule+ { name = "from <datetime> - <datetime> (interval)"+ , pattern =+ [ regex "από(\\s+τ(ις|η))?"+ , Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\-|μέχρι(\\s+τ(ις|η))?"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++-- Specific for time-of-day, to help resolve ambiguities+ruleIntervalTODDash :: Rule+ruleIntervalTODDash = Rule+ { name = "<time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\-|μέχρι"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleMonthDdddInterval :: Rule+ruleMonthDdddInterval = Rule+ { name = "dd-dd <month> (interval)"+ , pattern =+ [ regex "(από\\s+)?(τ[ιη][νς]?\\s+)?([012]?\\d|30|31)η?ς?"+ , regex "\\-|μ[εέ](χρι)?(?:\\s+τ[ιη][νς]?)?"+ , regex "([012]?\\d|30|31)η?ς?"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (_:_:m1:_)):+ _:+ Token RegexMatch (GroupMatch (m2:_)):+ Token Time td:+ _) -> do+ v1 <- parseInt m1+ v2 <- parseInt m2+ from <- intersect (dayOfMonth v1) td+ to <- intersect (dayOfMonth v2) td+ Token Time <$> interval TTime.Closed from to+ _ -> Nothing+ }++ruleTheCycleAfterTime :: Rule+ruleTheCycleAfterTime = Rule+ { name = "the <cycle> after <time>"+ , pattern =+ [ dimension TimeGrain+ , regex "μετά τ(ου?|η|ι|α|ου)ν?ς?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter False grain 1 td+ _ -> Nothing+ }++ruleTheCycleOfTime :: Rule+ruleTheCycleOfTime = Rule+ { name = "the <cycle> of <time>"+ , pattern =+ [ dimension TimeGrain+ , regex "τ(ου|ης)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain 0 td+ _ -> Nothing+ }++ruleTheCycleBeforeTime :: Rule+ruleTheCycleBeforeTime = Rule+ { name = "the <cycle> before <time>"+ , pattern =+ [ dimension TimeGrain+ , regex "πριν τ(ον?|ην?|α|ους)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter False grain (-1) td+ _ -> Nothing+ }++ruleYearLatent2 :: Rule+ruleYearLatent2 = Rule+ { name = "year (latent)"+ , pattern =+ [ Predicate $ isIntegerBetween 2101 10000+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ v <- getIntValue token+ tt . mkLatent $ year v+ _ -> Nothing+ }++ruleTimeAfterNext :: Rule+ruleTimeAfterNext = Rule+ { name = "<time> after next"+ , pattern =+ [ regex "μεθεπ[οό]μ[εέ]ν(ο[ιυ]?ς?|ης?|ων)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) ->+ tt $ predNth 2 True td+ _ -> Nothing+ }++ruleThisDayofWeek :: Rule+ruleThisDayofWeek = Rule+ { name = "this <day-of-week>"+ , pattern =+ [ regex "αυτή[νς]? τη[νς]?"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleTheDayOf :: Rule+ruleTheDayOf = Rule+ { name = "on the day of <day>"+ , pattern =+ [ regex "ανήμερα"+ , Predicate $ isGrainOfTime TG.Day+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleThisDayofWeek2 :: Rule+ruleThisDayofWeek2 = Rule+ { name = "(this) coming <day-of-week>"+ , pattern =+ [ regex "ερχ[οό]μ[εέ]νη[ςν]?"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleBetweenTimeofdayAndTimeofdayInterval :: Rule+ruleBetweenTimeofdayAndTimeofdayInterval = Rule+ { name = "between <time-of-day> and <time-of-day> (interval)"+ , pattern =+ [ regex "μεταξύ|ανάμεσα"+ , Predicate isATimeOfDay+ , regex "(και(\\s+τ(ου|ης))?|\\-)"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleNextCycle :: Rule+ruleNextCycle = Rule+ { name = "next <cycle>"+ , pattern =+ [ regex "ε(π|ρχ)[οό]μ[εέ]ν(ο[ιυ]?ς?|ης?|ες|ων)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt $ cycleNth grain 1+ _ -> Nothing+ }++ruleTimeofdayApproximately :: Rule+ruleTimeofdayApproximately = Rule+ { name = "<time-of-day> approximately"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "περίπου|και κάτι"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleInDurationFromTime :: Rule+ruleInDurationFromTime = Rule+ { name = "in <duration> from <time>"+ , pattern =+ [ regex "σε"+ , dimension Duration+ , regex "(ξεκινώντας\\s+)?από"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_:Token Time td1:_) ->+ Just . Token Time $ durationAfter dd td1+ _ -> Nothing+}++ruleDurationFromNow :: Rule+ruleDurationFromNow = Rule+ { name = "<duration> from now"+ , pattern =+ [ dimension Duration+ , regex "από τώρα"+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleLunch :: Rule+ruleLunch = Rule+ { name = "lunch"+ , pattern =+ [ regex "μεσημεριαν(ό|ού)( γεύμα(τος)?)?"+ ]+ , prod = \_ ->+ let from = hour False 12+ to = hour False 14+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleLastCycle :: Rule+ruleLastCycle = Rule+ { name = "last <cycle>"+ , pattern =+ [ regex "τελευταί(ου?|ας?)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt . cycleNth grain $ - 1+ _ -> Nothing+ }++ruleAfternoon :: Rule+ruleAfternoon = Rule+ { name = "afternoon"+ , pattern =+ [ regex "απ[οό]γε[υύ]μα(τος)?"+ ]+ , prod = \_ ->+ let from = hour False 12+ to = hour False 18+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleDayofmonthOrdinalNamedmonth :: Rule+ruleDayofmonthOrdinalNamedmonth = Rule+ { name = "<day-of-month> (ordinal or number) <named-month>"+ , pattern =+ [ Predicate isDOMValue+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (day:Token Time month:_) -> Token Time <$> intersectDOM month day+ _ -> Nothing+ }++ruleNamedmonthDayofmonth :: Rule+ruleNamedmonthDayofmonth = Rule+ { name = "<named-month> <day-of-month> (ordinal or number)"+ , pattern =+ [ Predicate isAMonth+ , Predicate isDOMValue+ ]+ , prod = \tokens -> case tokens of+ (Token Time month:day:_) -> Token Time <$> intersectDOM month day+ _ -> Nothing+ }+++ruleInduringThePartofday :: Rule+ruleInduringThePartofday = Rule+ { name = "in|during the <part-of-day>"+ , pattern =+ [ regex "κατά τη διάρκεια του|(μέσα )?σ?το"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleHourofdayIntegerAsRelativeMinutes :: Rule+ruleHourofdayIntegerAsRelativeMinutes = Rule+ { name = "<hour-of-day> <integer> (as relative minutes)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isAnHourOfDay]+ , regex "και"+ , Predicate $ isIntegerBetween 1 59+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData+ {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_:+ token:+ _) -> do+ n <- getIntValue token+ tt $ hourMinute is12H hours n+ _ -> Nothing+ }++ruleNthTimeAfterTime :: Rule+ruleNthTimeAfterTime = Rule+ { name = "nth <time> after <time>"+ , pattern =+ [ dimension Ordinal+ , Predicate $ or . sequence+ [ isADayOfWeek+ , isAMonth+ ]+ , regex "μετά"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> tt $ predNthAfter (v - 1) td1 td2+ _ -> Nothing+ }++ruleMmdd :: Rule+ruleMmdd = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/.-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do+ d <- parseInt m1+ m <- parseInt m2+ tt $ monthDay m d+ _ -> Nothing+ }++ruleAfterDuration :: Rule+ruleAfterDuration = Rule+ { name = "after <duration>"+ , pattern =+ [ regex "μετά\\s+από"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) ->+ tt . withDirection TTime.After $ inDuration dd+ _ -> Nothing+ }++ruleTimeofdayLatent :: Rule+ruleTimeofdayLatent = Rule+ { name = "time-of-day (latent)"+ , pattern =+ [ Predicate $ isIntegerBetween 0 23+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ hour (n < 12) n+ _ -> Nothing+ }++ruleExactlyTimeofday :: Rule+ruleExactlyTimeofday = Rule+ { name = "exactly <time-of-day>"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "ακριβώς"+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleBetweenDatetimeAndDatetimeInterval :: Rule+ruleBetweenDatetimeAndDatetimeInterval = Rule+ { name = "between <datetime> and <datetime> (interval)"+ , pattern =+ [ regex "μεταξύ|ανάμεσα"+ , Predicate isNotLatent+ , regex "(και|\\-)"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleDurationHenceAgo :: Rule+ruleDurationHenceAgo = Rule+ { name = "<duration> hence|ago"+ , pattern =+ [ dimension Duration+ , regex "(πριν|μετά)"+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "πριν" -> tt $ durationAgo dd+ _ -> tt $ inDuration dd+ _ -> Nothing+ }++ruleHenceAgoDuration :: Rule+ruleHenceAgoDuration = Rule+ { name = "before <duration>"+ , pattern =+ [ regex "(πριν(\\s+από)?|εδώ και)"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ Token Duration dd:+ _) -> case Text.toLower match of+ "εδώ και" -> tt $ inDuration dd+ _ -> tt $ durationAgo dd+ _ -> Nothing+ }++ruleIntervalUntilTOD :: Rule+ruleIntervalUntilTOD = Rule+ { name = "until <time-of-day>"+ , pattern =+ [ regex "πριν"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.Before td+ _ -> Nothing+ }++ruleByTheEndOfTime :: Rule+ruleByTheEndOfTime = Rule+ { name = "by the end of <time>"+ , pattern =+ [ regex "μέχρι το (τέλος|πέρας)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$>+ interval TTime.Closed td (cycleNth TG.Second 0)+ _ -> Nothing+ }++ruleAfterWork :: Rule+ruleAfterWork = Rule+ { name = "after work"+ , pattern =+ [ regex "μετά τη δουλειά"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day 0+ td2 <- interval TTime.Open (hour False 17) (hour False 21)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleLastNCycle :: Rule+ruleLastNCycle = Rule+ { name = "last n <cycle>"+ , pattern =+ [ regex "(τελευταί|περασμέν)(ο[ιυ]?ς?|[εα]ς?|ων)"+ , Predicate $ isIntegerBetween 1 9999+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:token:Token TimeGrain grain:_) -> do+ n <- getIntValue token+ tt $ cycleN True grain (- n)+ _ -> Nothing+ }++ruleWithinDuration :: Rule+ruleWithinDuration = Rule+ { name = "within <duration>"+ , pattern =+ [ regex "μέσα(\\s+σε)?"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> Token Time <$>+ interval TTime.Open (cycleNth TG.Second 0) (inDuration dd)+ _ -> Nothing+ }++ruleMidnight :: Rule+ruleMidnight = Rule+ { name = "midnight"+ , pattern =+ [ regex "μεσάνυχτα"+ ]+ , prod = const $ tt $ hour False 0+ }++ruleNoon :: Rule+ruleNoon = Rule+ { name = "noon"+ , pattern =+ [ regex "μεσημ[εέ]ρι(ού)?"+ ]+ , prod = const $ tt $ hour False 12+ }++ruleDayofmonthNonOrdinalNamedmonth :: Rule+ruleDayofmonthNonOrdinalNamedmonth = Rule+ { name = "<day-of-month> (non-ordinal) <named-month>"+ , pattern =+ [ Predicate isDOMInteger+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++rulePrecisionTimeofday :: Rule+rulePrecisionTimeofday = Rule+ { name = "about <time-of-day>"+ , pattern =+ [ regex "περίπου|ακριβώς"+ , Predicate $ isGrainFinerThan TG.Year+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleIntervalBy :: Rule+ruleIntervalBy = Rule+ { name = "until <time>"+ , pattern =+ [ regex "μέχρι"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) ->+ Token Time <$> interval TTime.Open (cycleNth TG.Second 0) td+ _ -> Nothing+ }++ruleIntervalByTheEndOf :: Rule+ruleIntervalByTheEndOf = Rule+ { name = "by the end of <time>"+ , pattern =+ [ regex "μέχρι το τέλος"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) ->+ Token Time <$> interval TTime.Closed (cycleNth TG.Second 0) td+ _ -> Nothing+ }++ruleUntilTimeofdayPostfix :: Rule+ruleUntilTimeofdayPostfix = Rule+ { name = "<time-of-day> until"+ , pattern =+ [ dimension Time+ , regex "το αργότερο"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ withDirection TTime.Before td+ _ -> Nothing+ }++ruleAtTimeofday :: Rule+ruleAtTimeofday = Rule+ { name = "at <time-of-day>"+ , pattern =+ [ regex "στις|@"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleNthTimeOfTime :: Rule+ruleNthTimeOfTime = Rule+ { name = "nth <time> of <time>"+ , pattern =+ [ dimension Ordinal+ , Predicate isNotLatent+ , regex "τ(ου|ης|ων)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> Token Time . predNth (v - 1) False <$> intersect td2 td1+ _ -> Nothing+ }++ruleTimePartofday :: Rule+ruleTimePartofday = Rule+ { name = "<time> <part-of-day>"+ , pattern =+ [ dimension Time+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleWeekend :: Rule+ruleWeekend = Rule+ { name = "week-end"+ , pattern =+ [ regex "σαββατοκύριακ(ου?|α|ων)|σκ"+ ]+ , prod = const . tt . mkOkForThisNext $ weekend+ }++ruleLastWeekendOfMonth :: Rule+ruleLastWeekendOfMonth = Rule+ { name = "last weekend of <named-month>"+ , pattern =+ [ regex "τελευταίου?\\s+(σαββατοκύριακου?|σκ)\\s+"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td2:_) -> tt $ predLastOf weekend td2+ _ -> Nothing+ }++ruleNextDayofweek :: Rule+ruleNextDayofweek = Rule+ { name = "next <day-of-week>"+ , pattern =+ [ regex "επ[οό]μ[εέ]ν(ο[ιυ]?ς?|ης?|ες|ων)"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 1 False td+ _ -> Nothing+ }++ruleNextTime :: Rule+ruleNextTime = Rule+ { name = "next <time>"+ , pattern =+ [ regex "επ[οό]μ[εέ]ν(ο[ιυ]?ς?|ης?|ες|ων)"+ , Predicate isOkWithThisNext+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 1 False td+ _ -> Nothing+ }+++ruleOrdinalQuarterYear :: Rule+ruleOrdinalQuarterYear = Rule+ { name = "<ordinal> quarter <year>"+ , pattern =+ [ dimension Ordinal+ , Predicate $ isGrain TG.Quarter+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:_:Token Time td:_) ->+ tt $ cycleNthAfter False TG.Quarter (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleYyyymmdd :: Rule+ruleYyyymmdd = Rule+ { name = "yyyy-mm-dd"+ , pattern =+ [ regex "(\\d{2,4})[.-](1[0-2]|0?[1-9])[.-](3[01]|[12]\\d|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:m3:_)):_) -> do+ y <- parseInt m1+ m <- parseInt m2+ d <- parseInt m3+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleOrdinalCycleAfterTime :: Rule+ruleOrdinalCycleAfterTime = Rule+ { name = "<ordinal> <cycle> after <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , regex "μετά"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleIntersect :: Rule+ruleIntersect = Rule+ { name = "intersect"+ , pattern =+ [ Predicate isNotLatent+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleIntersectBy :: Rule+ruleIntersectBy = Rule+ { name = "intersect by ','"+ , pattern =+ [ Predicate isNotLatent+ , regex ","+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleIntersectByOfFromS :: Rule+ruleIntersectByOfFromS = Rule+ { name = "intersect by 'of', 'from', 's"+ , pattern =+ [ Predicate isNotLatent+ , regex "τ(ου|ης)"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleNextNCycle :: Rule+ruleNextNCycle = Rule+ { name = "next n <cycle>"+ , pattern =+ [ regex "επ[οό]μ[εέ]ν(ο[ιυ]?ς?|ης?|ες|ων|α)"+ , Predicate $ isIntegerBetween 1 9999+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:token:Token TimeGrain grain:_) -> do+ v <- getIntValue token+ tt $ cycleN True grain v+ _ -> Nothing+ }++ruleADuration :: Rule+ruleADuration = Rule+ { name = "a <duration>"+ , pattern =+ [ regex "[εέ]ν(ας?|ός|ν)|μίας?"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleMorning :: Rule+ruleMorning = Rule+ { name = "morning"+ , pattern =+ [ regex "(το\\s+)?πρωί"+ ]+ , prod = \_ ->+ let from = hour False 4+ to = hour False 12+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleEarlyMorning :: Rule+ruleEarlyMorning = Rule+ { name = "early morning"+ , pattern =+ [ regex "νωρίς\\s+(το\\s+)πρωί"+ ]+ , prod = \_ -> Token Time . partOfDay . mkLatent <$>+ interval TTime.Open (hour False 4) (hour False 9)+ }+++ruleThisPartofday :: Rule+ruleThisPartofday = Rule+ { name = "this <part-of-day>"+ , pattern =+ [ regex "αυτ([οό]ύ?|ή[νς]?) τ(ον?|η[νς]?)"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time . partOfDay <$>+ intersect (cycleNth TG.Day 0) td+ _ -> Nothing+ }++ruleThisCycle :: Rule+ruleThisCycle = Rule+ { name = "this <cycle>"+ , pattern =+ [ regex "αυτ([οό][νύ]?|ή[νς]?)\\s+τ(ον?|η[νς]?)"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt $ cycleNth grain 0+ _ -> Nothing+ }++ruleDayofmonthNonOrdinalOfNamedmonth :: Rule+ruleDayofmonthNonOrdinalOfNamedmonth = Rule+ { name = "<day-of-month> (ordinal or number) of <named-month>"+ , pattern =+ [ Predicate isDOMValue+ , regex "του"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (day:_:Token Time td:_) -> Token Time <$> intersectDOM td day+ _ -> Nothing+ }++ruleYearLatent :: Rule+ruleYearLatent = Rule+ { name = "year (latent)"+ , pattern =+ [ Predicate $+ or . sequence [isIntegerBetween (- 10000) 0, isIntegerBetween 25 999]+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ y <- getIntValue token+ tt . mkLatent $ year y+ _ -> Nothing+ }++ruleAfterTimeofday :: Rule+ruleAfterTimeofday = Rule+ { name = "after <time-of-day>"+ , pattern =+ [ regex "μετά"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.After td+ _ -> Nothing+ }++ruleCycleThis :: Rule+ruleCycleThis = Rule+ { name = "this <cycle>"+ , pattern =+ [ regex $ "αυτ([οό][υύ]?|[ηή]|[εέ]|ώ|ά)ν?ς?|"+ ++ "τρ[εέ]χ(ουσ)?(α|ε|ο|ω|ώ)ν?ς?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 False td+ _ -> Nothing+ }++cyclesMap :: HashMap Text Int+cyclesMap = HashMap.fromList+ [ ("τρεχ" , 0)+ , ("τρέχ" , 0)+ , ("ερχόμεν" , 0)+ , ("ερχομέν" , 0)+ , ("επόμεν" , 1)+ , ("επομέν" , 1)+ , ("περασμέν" , -1)+ , ("προηγούμεν", -1)+ , ("προηγουμέν", -1)+ ]++ruleCycleCurrentLastNext :: Rule+ruleCycleCurrentLastNext = Rule+ { name = "this|last|next <cycle>"+ , pattern =+ [ regex $ "(τρ[εέ]χ|επ[οό]μ[εέ]ν|ερχ[οό]μ[εέ]ν|περασμέν|προηγο[υύ]μ[εέ]ν)"+ ++ "(ουσ)?(α|ά|ο[υύ]?|η|ή|ε|έ|ω|ώ)ν?ς?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):Token TimeGrain grain:_) ->+ HashMap.lookup (Text.toLower match) cyclesMap >>= tt . cycleNth grain+ _ -> Nothing+ }++ruleNight :: Rule+ruleNight = Rule+ { name = "night"+ , pattern =+ [ regex "νύχτα"+ ]+ , prod = const $+ let from = hour False 20+ to = hour False 8+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleDayofmonthOrdinal :: Rule+ruleDayofmonthOrdinal = Rule+ { name = "<day-of-month> (ordinal)"+ , pattern =+ [ Predicate isDOMOrdinal+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) ->+ tt . mkLatent $ dayOfMonth v+ _ -> Nothing+ }++ruleTimeofdayAmpm :: Rule+ruleTimeofdayAmpm = Rule+ { name = "<time-of-day> am|pm"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "([πμ])\\.?(μ\\.?)?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->+ tt $ timeOfDayAMPM (Text.toLower ap == "π") td+ _ -> Nothing+ }++ruleTimeofdayAmpmVerbose :: Rule+ruleTimeofdayAmpmVerbose = Rule+ { name = "<time-of-day> am|pm (verbose)"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "το\\s+(πρωί|απόγευμα)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->+ tt $ timeOfDayAMPM (Text.toLower ap == "πρωί") td+ _ -> Nothing+ }++ruleAfterNextTime :: Rule+ruleAfterNextTime = Rule+ { name = "after next <time>"+ , pattern =+ [ regex "μετά τ(ο|η)ν? επόμεν(ο|η)ν?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 1 True td+ _ -> Nothing+ }++ruleHhmm :: Rule+ruleHhmm = Rule+ { name = "hh:mm"+ , pattern =+ [ regex "((?:[01]?\\d)|(?:2[0-3]))[:ω]([0-5]\\d)ω?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do+ h <- parseInt m1+ m <- parseInt m2+ tt $ hourMinute True h m+ _ -> Nothing+ }++ruleHHMMSS :: Rule+ruleHHMMSS = Rule+ { name = "hh:mm:ss"+ , pattern =+ [ regex "((?:[01]?\\d)|(?:2[0-3]))[:.]([0-5]\\d)[:.]([0-5]\\d)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:mm:ss:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ s <- parseInt ss+ tt $ hourMinuteSecond True h m s+ _ -> Nothing+ }++-- We can't take generic TOD (e.g. "6:30am - 9pm").+-- Those are handled by other rules.+ruleIntervalTODAMPM :: Rule+ruleIntervalTODAMPM = Rule+ { name = "hh(:mm) - <time-of-day> am|pm"+ , pattern =+ [ regex "(?:από )?((?:[01]?\\d)|(?:2[0-3]))([:.]([0-5]\\d))?"+ , regex "\\-|:|μέχρι"+ , Predicate isATimeOfDay+ , regex "([πμ])(\\s|\\.)?(μ\\.?)?"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:_:mm:_)):+ _:+ Token Time td2:+ Token RegexMatch (GroupMatch (ap:_)):+ _) -> do+ h <- parseInt hh+ let ampm = Text.toLower ap == "π"+ td1 = maybe (hour True h) (hourMinute True h) (parseInt mm)+ Token Time <$>+ interval TTime.Closed (timeOfDayAMPM ampm td1) (timeOfDayAMPM ampm td2)+ _ -> Nothing+ }++-- We can't take generic TOD (e.g. "6:30am - 9pm").+-- Those are handled by other rules.+ruleIntervalTODAMPMverbose :: Rule+ruleIntervalTODAMPMverbose = Rule+ { name = "hh(:mm) - <time-of-day> am|pm (verbose)"+ , pattern =+ [ regex "(?:από\\s+)?((?:[01]?\\d)|(?:2[0-3]))([:.]([0-5]\\d))?"+ , regex "\\-|:|μέχρι"+ , Predicate isATimeOfDay+ , regex "(?:το\\s+)?(πρωί|απόγευμα)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:_:mm:_)):+ _:+ Token Time td2:+ Token RegexMatch (GroupMatch (ap:_)):+ _) -> do+ h <- parseInt hh+ let ampm = Text.toLower ap == "πρωί"+ td1 = maybe (hour True h) (hourMinute True h) (parseInt mm)+ Token Time <$>+ interval TTime.Closed (timeOfDayAMPM ampm td1) (timeOfDayAMPM ampm td2)+ _ -> Nothing+ }++ruleTonight :: Rule+ruleTonight = Rule+ { name = "tonight"+ , pattern =+ [ regex "απόψε"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day 0+ td2 <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleTomorrowNight :: Rule+ruleTomorrowNight = Rule+ { name = "tomorrownight"+ , pattern =+ [ regex "αύριο\\s+(το\\s+)?βράδυ"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day 1+ td2 <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleLastNight :: Rule+ruleLastNight = Rule+ { name = "lastnight"+ , pattern =+ [ regex "ε?χ[θτ][εέ]ς\\s+(το\\s+)?βράδυ"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day $ - 1+ td2 <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleYear :: Rule+ruleYear = Rule+ { name = "year"+ , pattern =+ [ Predicate $ isIntegerBetween 1000 2100+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ y <- getIntValue token+ tt $ year y+ _ -> Nothing+ }++ruleThisYear :: Rule+ruleThisYear = Rule+ { name = "this year"+ , pattern =+ [ regex "ε?φ[εέ]τος?"+ ]+ , prod = const . tt $ cycleNth TG.Year 0+ }++ruleLastYear :: Rule+ruleLastYear = Rule+ { name = "Last year"+ , pattern =+ [ regex "π[εέ]ρ(υ?σιν|ασμέν)[οόηή]ς?\\s+(έτου?ς|χρ[οό]ν(ου|ιάς?))"+ ]+ , prod = const . tt . cycleNth TG.Year $ - 1+ }++ruleLastYearOneWord :: Rule+ruleLastYearOneWord = Rule+ { name = "Last year"+ , pattern =+ [ regex "π[εέ]ρυ?σι"+ ]+ , prod = const . tt . cycleNth TG.Year $ - 1+ }++ruleNextYear :: Rule+ruleNextYear = Rule+ { name = "Last year"+ , pattern =+ [ regex "του\\s*χρόνου"+ ]+ , prod = const . tt $ cycleNth TG.Year 1+ }++ruleHhmmMilitary :: Rule+ruleHhmmMilitary = Rule+ { name = "hhmm (military)"+ , pattern =+ [ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (h:m:_)):_) -> do+ hh <- parseInt h+ mm <- parseInt m+ tt . mkLatent $ hourMinute False hh mm+ _ -> Nothing+ }++ruleAbsorptionOfAfterNamedDay :: Rule+ruleAbsorptionOfAfterNamedDay = Rule+ { name = "absorption of , after named day"+ , pattern =+ [ Predicate isADayOfWeek+ , regex ","+ ]+ , prod = \tokens -> case tokens of+ (x:_) -> Just x+ _ -> Nothing+ }++ruleAbsorptionOfArticleBeforeTime :: Rule+ruleAbsorptionOfArticleBeforeTime = Rule+ { name = "absorption of article before time"+ , pattern =+ [ regex "σ?τ?(α|η|ι|ο[ιυ]?|ω)ν?ς?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleLastDayofweekOfTime :: Rule+ruleLastDayofweekOfTime = Rule+ { name = "last <day-of-week> of <time>"+ , pattern =+ [ regex "τελευταί(ου?|ας?)"+ , Predicate isADayOfWeek+ , regex "τ(ου|ης)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) -> tt $ predLastOf td1 td2+ _ -> Nothing+ }++ruleHhmmMilitaryAmpm :: Rule+ruleHhmmMilitaryAmpm = Rule+ { name = "hhmm (military) am|pm"+ , pattern =+ [ regex "((?:1[012]|0?\\d))([0-5]\\d)"+ , regex "([πμ])\\.?(μ\\.?)?"+ ]+ , prod = \tokens -> case tokens of+ ( Token RegexMatch (GroupMatch (hh:mm:_)):+ Token RegexMatch (GroupMatch (ap:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ tt $ timeOfDayAMPM (Text.toLower ap == "π") (hourMinute True h m)+ _ -> Nothing+ }++ruleTimeofdayTimeofdayInterval :: Rule+ruleTimeofdayTimeofdayInterval = Rule+ { name = "<time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\-|μέχρι"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleDurationAfterTime :: Rule+ruleDurationAfterTime = Rule+ { name = "<duration> after <time>"+ , pattern =+ [ dimension Duration+ , regex "μετά(\\s+από)?|από"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_:Token Time td:_) -> tt $ durationAfter dd td+ _ -> Nothing+ }++ruleOrdinalQuarter :: Rule+ruleOrdinalQuarter = Rule+ { name = "<ordinal> quarter"+ , pattern =+ [ dimension Ordinal+ , Predicate $ isGrain TG.Quarter+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt .+ cycleNthAfter False TG.Quarter (v - 1) $ cycleNth TG.Year 0+ _ -> Nothing+ }++ruleDurationBeforeTime :: Rule+ruleDurationBeforeTime = Rule+ { name = "<duration> before <time>"+ , pattern =+ [ dimension Duration+ , regex "πριν"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_:Token Time td:_) -> tt $ durationBefore dd td+ _ -> Nothing+ }++rulePartofdayOfTime :: Rule+rulePartofdayOfTime = Rule+ { name = "<part-of-day> of <time>"+ , pattern =+ [ Predicate isAPartOfDay+ , regex "τ(ου|ης)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) -> Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleMmddyyyy :: Rule+ruleMmddyyyy = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/.-](1[0-2]|0?[1-9])[/.-](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:m3:_)):_) -> do+ y <- parseInt m3+ m <- parseInt m2+ d <- parseInt m1+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleTimeofdayOclock :: Rule+ruleTimeofdayOclock = Rule+ { name = "<time-of-day> o'clock"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "η ώρα"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleDayofmonthordinalNamedmonthYear :: Rule+ruleDayofmonthordinalNamedmonthYear = Rule+ { name = "<day-of-month> ( ordinal) <named-month> year"+ , pattern =+ [ Predicate isDOMOrdinal+ , Predicate isAMonth+ , regex "(\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (dd:Token Time mm:Token RegexMatch (GroupMatch (yy:_)):_) -> do+ y <- parseInt yy+ dom <- intersectDOM mm dd+ Token Time <$> intersect dom (year y)+ _ -> Nothing+ }++ruleIntervalForDurationFrom :: Rule+ruleIntervalForDurationFrom = Rule+ { name = "for <duration> from <time>"+ , pattern =+ [ regex "για"+ , dimension Duration+ , regex "(ξεκινώντας\\s+)?(μετά(\\s+από)?|από)"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_:Token Time td1:_) ->+ Token Time <$> interval TTime.Open td1 (durationAfter dd td1)+ _ -> Nothing+}++ruleTimezone :: Rule+ruleTimezone = Rule+ { name = "<time> timezone"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT|SCT|SBT|SAST|SAMT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PHT|PHOT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|NCT|MYT|MVT|MUT|MST|MSK|MSD|MMT|MHT|MDT|MAWT|MART|MAGT|MAGST|LINT|LHST|LHDT|KUYT|KST|KRAT|KRAST|KGT|JST|IST|IRST|IRKT|IRKST|IRDT|IOT|IDT|ICT|HOVT|HKT|GYT|GST|GMT|GILT|GFT|GET|GAMT|GALT|FNT|FKT|FKST|FJT|FJST|EST|EGT|EGST|EET|EEST|EDT|ECT|EAT|EAST|EASST|DAVT|ChST|CXT|CVT|CST|COT|CLT|CLST|CKT|CHAST|CHADT|CET|CEST|CDT|CCT|CAT|CAST|BTT|BST|BRT|BRST|BOT|BNT|AZT|AZST|AZOT|AZOST|AWST|AWDT|AST|ART|AQTT|ANAT|ANAST|AMT|AMST|ALMT|AKST|AKDT|AFT|AEST|AEDT|ADT|ACST|ACDT)\\b"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:+ Token RegexMatch (GroupMatch (tz:_)):+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleADuration+ , ruleAbsorptionOfAfterNamedDay+ , ruleAbsorptionOfArticleBeforeTime+ , ruleAfterDuration+ , ruleAfterNextTime+ , ruleAfterTimeofday+ , ruleAfterWork+ , ruleAfternoon+ , ruleAtTimeofday+ , ruleBetweenDatetimeAndDatetimeInterval+ , ruleBetweenTimeofdayAndTimeofdayInterval+ , ruleByTheEndOfTime+ , ruleCycleCurrentLastNext+ , ruleCycleThis+ , ruleDatetimeDatetimeInterval+ , ruleDayofmonthNonOrdinalNamedmonth+ , ruleDayofmonthNonOrdinalOfNamedmonth+ , ruleDayofmonthOrdinal+ , ruleDayofmonthOrdinalNamedmonth+ , ruleDayofmonthordinalNamedmonthYear+ , ruleDurationAfterTime+ , ruleDurationBeforeTime+ , ruleDurationFromNow+ , ruleDurationHenceAgo+ , ruleEarlyMorning+ , ruleEvening+ , ruleExactlyTimeofday+ , ruleFromDatetimeDatetimeInterval+ , ruleHHMMSS+ , ruleHalfAfterIntegerHourofday+ , ruleHalfAfterIntegerHourofday2+ , ruleHenceAgoDuration+ , ruleHhmm+ , ruleHhmmMilitary+ , ruleHhmmMilitaryAmpm+ , ruleHourofdayIntegerAsRelativeMinutes+ , ruleInDuration+ , ruleInDurationFromTime+ , ruleInduringThePartofday+ , ruleIntersect+ , ruleIntersectBy+ , ruleIntersectByOfFromS+ , ruleIntervalBy+ , ruleIntervalByTheEndOf+ , ruleIntervalForDurationFrom+ , ruleIntervalTODAMPM+ , ruleIntervalTODAMPMverbose+ , ruleIntervalTODDash+ , ruleIntervalUntilTOD+ , ruleLastCycle+ , ruleLastCycleOfTime+ , ruleLastCycleOfTimeS+ , ruleLastDayofweekOfTime+ , ruleLastNCycle+ , ruleLastNight+ , ruleLastTime+ , ruleLastWeekendOfMonth+ , ruleLastYear+ , ruleLastYearOneWord+ , ruleLunch+ , ruleMidnight+ , ruleMmdd+ , ruleMmddyyyy+ , ruleMonthDdddInterval+ , ruleMorning+ , ruleNamedmonthDayofmonth+ , ruleNextCycle+ , ruleNextDayofweek+ , ruleNextNCycle+ , ruleNextTime+ , ruleNextYear+ , ruleNight+ , ruleNoon+ , ruleNthTimeAfterTime+ , ruleNthTimeOfTime+ , ruleOrdinalCycleAfterTime+ , ruleOrdinalCycleOfTime+ , ruleOrdinalQuarter+ , ruleOrdinalQuarterYear+ , rulePartOfMonth+ , rulePartofdayOfTime+ , rulePrecisionTimeofday+ , ruleQuarterBeforeOrAfterIntegerHourofday+ , ruleRelativeIntegerToOrAfterIntegerPartOfDay+ , ruleTheCycleAfterTime+ , ruleTheCycleBeforeTime+ , ruleTheCycleOfTime+ , ruleTheDayOf+ , ruleTheDayofmonthNonOrdinal+ , ruleThisCycle+ , ruleThisDayofWeek+ , ruleThisDayofWeek2+ , ruleThisPartofday+ , ruleThisYear+ , ruleTimeAfterNext+ , ruleTimePartofday+ , ruleTimeofdayAmpm+ , ruleTimeofdayAmpmVerbose+ , ruleTimeofdayApproximately+ , ruleTimeofdayLatent+ , ruleTimeofdayOclock+ , ruleTimeofdayTimeofdayInterval+ , ruleTimezone+ , ruleTomorrowNight+ , ruleTonight+ , ruleUntilTimeofdayPostfix+ , ruleWeekend+ , ruleWithinDuration+ , ruleYear+ , ruleYearLatent+ , ruleYearLatent2+ , ruleYyyymmdd+ ]+ ++ ruleDaysOfWeek+ ++ ruleHolidays+ ++ ruleInstants+ ++ ruleMonths+ ++ ruleSeasons
+ Duckling/Time/EN/AU/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.AU.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/AU/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.AU.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
+ Duckling/Time/EN/BZ/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.BZ.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/BZ/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.BZ.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
Duckling/Time/EN/CA/Corpus.hs view
@@ -32,6 +32,7 @@ [ "10/31/1974" , "10/31/74" , "10-31-74"+ , "10.31.1974" ] , examples (datetime (2013, 4, 25, 16, 0, 0) Minute) [ "4/25 at 4:00pm"
Duckling/Time/EN/CA/Rules.hs view
@@ -29,7 +29,9 @@ ruleMMDD :: Rule ruleMMDD = Rule { name = "mm/dd"- , pattern = [regex "(0?[1-9]|1[0-2])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"]+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (mm:dd:_)):_) -> do m <- parseInt mm@@ -42,7 +44,8 @@ ruleMMDDYYYY = Rule { name = "mm/dd/yyyy" , pattern =- [regex "(0?[1-9]|1[0-2])[/-](3[01]|[12]\\d|0?[1-9])[-/](\\d{2,4})"]+ [ regex "(1[0-2]|0?[1-9])[/-](3[01]|[12]\\d|0?[1-9])[-/](\\d{2,4})"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do y <- parseInt yy@@ -52,18 +55,36 @@ _ -> Nothing } +-- Clashes with HHMMSS, hence only 4-digit years+ruleMMDDYYYYDot :: Rule+ruleMMDDYYYYDot = Rule+ { name = "mm.dd.yyyy"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\.(3[01]|[12]\\d|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ d <- parseInt dd+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Second Monday of October ruleThanksgiving :: Rule ruleThanksgiving = Rule { name = "Thanksgiving Day" , pattern = [ regex "thanks?giving( day)?" ]- , prod = \_ -> tt $ nthDOWOfMonth 2 1 10 -- Second Monday of October+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 2 1 10 } rules :: [Rule] rules = [ ruleMMDD , ruleMMDDYYYY+ , ruleMMDDYYYYDot , ruleThanksgiving ]
Duckling/Time/EN/Corpus.hs view
@@ -40,6 +40,7 @@ [ "10/31/1974" , "10/31/74" , "10-31-74"+ , "10.31.1974" ] , examples (datetime (2013, 4, 25, 16, 0, 0) Minute) [ "4/25 at 4:00pm"@@ -90,6 +91,9 @@ , "rat 6" , "3 30" , "three twenty"+ , "at 650.650.6500"+ , "at 650-650-6500"+ , "two sixty a m" ] allExamples :: [Example]@@ -400,6 +404,9 @@ , "3:30" , "half three" ]+ , examples (datetime (2013, 2, 12, 9, 59, 0) Minute)+ [ "nine fifty nine a m"+ ] , examples (datetime (2013, 2, 12, 15, 23, 24) Second) [ "15:23:24" ]@@ -823,8 +830,16 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "Thursday 8:00 GMT"+ , "Thursday 8:00 gmt" , "Thu at 8 GMT"+ , "Thu at 8 gmt" ]+ , examples (datetime (2013, 2, 14, 14, 0, 0) Minute)+ [ "Thursday 8:00 PST"+ , "Thursday 8:00 pst"+ , "Thu at 8 am PST"+ , "Thu at 8 am pst"+ ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "today at 2pm" , "at 2pm"@@ -838,6 +853,8 @@ ] , examples (datetimeOpenInterval After (2013, 2, 12, 14, 0, 0) Hour) [ "after 2 pm"+ , "from 2 pm"+ , "since 2pm" ] , examples (datetimeOpenInterval After (2013, 2, 17, 4, 0, 0) Hour) [ "after 5 days"@@ -908,9 +925,11 @@ , examples (datetime (2013, 2, 12, 10, 30, 0) Minute) [ "at 1030" , "around 1030"+ , "ten thirty am" ] , examples (datetime (2013, 2, 12, 19, 30, 0) Minute) [ "at 730 in the evening"+ , "seven thirty p.m." ] , examples (datetime (2013, 2, 13, 1, 50, 0) Minute) [ "tomorrow at 150ish"@@ -922,6 +941,7 @@ -- yes, the result is in the past, we may need to revisit [ "at 4:23" , "4:23am"+ , "four twenty-three a m" ] , examples (datetimeInterval ((2013, 3, 1, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Day) [ "early March"
Duckling/Time/EN/GB/Corpus.hs view
@@ -32,6 +32,7 @@ [ "31/10/1974" , "31/10/74" , "31-10-74"+ , "31.10.1974" ] , examples (datetime (2013, 4, 25, 16, 0, 0) Minute) [ "25/4 at 4:00pm"@@ -56,5 +57,9 @@ ] , examples (datetime (2017, 11, 23, 0, 0, 0) Day) [ "thanksgiving 2017"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013" ] ]
Duckling/Time/EN/GB/Rules.hs view
@@ -28,7 +28,7 @@ ruleDDMM = Rule { name = "dd/mm" , pattern =- [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(0?[1-9]|1[0-2])"+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do@@ -42,7 +42,7 @@ ruleDDMMYYYY = Rule { name = "dd/mm/yyyy" , pattern =- [ regex "(3[01]|[12]\\d|0?[1-9])[/-](0?[1-9]|1[0-2])[-/](\\d{2,4})"+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do@@ -53,18 +53,36 @@ _ -> Nothing } +-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November ruleThanksgiving :: Rule ruleThanksgiving = Rule { name = "Thanksgiving Day" , pattern = [ regex "thanks?giving( day)?" ]- , prod = \_ -> tt $ nthDOWOfMonth 4 4 11 -- Fourth Thursday of November+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11 } rules :: [Rule] rules = [ ruleDDMM , ruleDDMMYYYY+ , ruleDDMMYYYYDot , ruleThanksgiving ]
+ Duckling/Time/EN/IE/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.IE.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/IE/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.IE.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
+ Duckling/Time/EN/IN/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.IN.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/IN/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.IN.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
+ Duckling/Time/EN/JM/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.JM.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/JM/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.JM.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
+ Duckling/Time/EN/NZ/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.NZ.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/NZ/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.NZ.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
+ Duckling/Time/EN/PH/Corpus.hs view
@@ -0,0 +1,61 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.PH.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "2/15"+ , "on 2/15"+ , "2 / 15"+ , "2-15"+ , "2 - 15"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "10/31/1974"+ , "10/31/74"+ , "10-31-74"+ , "10.31.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "4/25 at 4:00pm"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/PH/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.PH.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleMMDD :: Rule+ruleMMDD = Rule+ { name = "mm/dd"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:_)):_) -> do+ m <- parseInt mm+ d <- parseInt dd+ tt $ monthDay m d+ _ -> Nothing+ }++ruleMMDDYYYY :: Rule+ruleMMDDYYYY = Rule+ { name = "mm/dd/yyyy"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])[/-](3[01]|[12]\\d|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ d <- parseInt dd+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleMMDDYYYYDot :: Rule+ruleMMDDYYYYDot = Rule+ { name = "mm.dd.yyyy"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\.(3[01]|[12]\\d|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ d <- parseInt dd+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleMMDD+ , ruleMMDDYYYY+ , ruleMMDDYYYYDot+ , ruleThanksgiving+ ]
Duckling/Time/EN/Rules.hs view
@@ -7,11 +7,13 @@ {-# LANGUAGE GADTs #-}+{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Time.EN.Rules- ( rules ) where+ ( rules+ ) where import Data.Maybe import Data.Text (Text)@@ -20,6 +22,7 @@ import Duckling.Dimensions.Types import Duckling.Duration.Helpers (duration)+import Duckling.Duration.Types (DurationData (..)) import Duckling.Numeral.Helpers (parseInt) import Duckling.Numeral.Types (NumeralData (..)) import Duckling.Ordinal.Types (OrdinalData (..))@@ -27,6 +30,7 @@ import Duckling.Time.Helpers import Duckling.Time.Types (TimeData (..)) import Duckling.Types+import qualified Duckling.Duration.Types as TDuration import qualified Duckling.Numeral.Types as TNumeral import qualified Duckling.Ordinal.Types as TOrdinal import qualified Duckling.Time.Types as TTime@@ -105,24 +109,15 @@ _ -> Nothing } -instants :: [(Text, String, TG.Grain, Int)]-instants =- [ ("right now", "((just|right)\\s*)now|immediately", TG.Second, 0)- , ("today", "todays?|(at this time)", TG.Day, 0)- , ("tomorrow", "(tmrw?|tomm?or?rows?)", TG.Day, 1)- , ("yesterday", "yesterdays?", TG.Day, - 1)- , ("end of month", "(the )?(EOM|end of (the )?month)", TG.Month, 1)- , ("end of year", "(the )?(EOY|end of (the )?year)", TG.Year, 1)- ]- ruleInstants :: [Rule]-ruleInstants = map go instants- where- go (name, regexPattern, grain, n) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ cycleNth grain n- }+ruleInstants = mkRuleInstants+ [ ("right now" , TG.Second, 0 , "((just|right)\\s*)now|immediately")+ , ("today" , TG.Day , 0 , "todays?|(at this time)" )+ , ("tomorrow" , TG.Day , 1 , "(tmrw?|tomm?or?rows?)" )+ , ("yesterday" , TG.Day , - 1, "yesterdays?" )+ , ("end of month" , TG.Month , 1 , "(the )?(EOM|end of (the )?month)" )+ , ("end of year" , TG.Year , 1 , "(the )?(EOY|end of (the )?year)" )+ ] ruleNow :: Rule ruleNow = Rule@@ -150,7 +145,7 @@ { name = "this <time>" , pattern = [ regex "this|current|coming"- , Predicate isNotLatent+ , Predicate isOkWithThisNext ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ predNth 0 False td@@ -162,7 +157,7 @@ { name = "next <time>" , pattern = [ regex "next"- , Predicate isNotLatent+ , Predicate isOkWithThisNext ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ predNth 0 True td@@ -174,7 +169,7 @@ { name = "last <time>" , pattern = [ regex "(this past|last|previous)"- , Predicate isNotLatent+ , Predicate isOkWithThisNext ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ predNth (- 1) False td@@ -202,7 +197,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (match:_)):_) ->- tt $ predNth 1 (match == "after next") td+ tt $ predNth 1 (Text.toLower match == "after next") td _ -> Nothing } @@ -368,7 +363,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: _) -> tt $ dayOfMonth v _ -> Nothing }@@ -456,7 +451,7 @@ ruleTODLatent = Rule { name = "time-of-day (latent)" , pattern =- [ Predicate $ and . sequence [isNumeralSafeToUse, isIntegerBetween 0 23]+ [ Predicate $ isIntegerBetween 0 23 ] , prod = \tokens -> case tokens of (token:_) -> do@@ -505,7 +500,7 @@ ruleHHMMLatent = Rule { name = "hhmm (latent)" , pattern =- [ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)"+ [ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)(?!.\\d)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do@@ -536,14 +531,49 @@ , regex "([ap])\\.?m?\\.?" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (hh:mm:_)):Token RegexMatch (GroupMatch (ap:_)):_) -> do+ (Token RegexMatch (GroupMatch (hh:mm:_)):+ Token RegexMatch (GroupMatch (ap:_)):+ _) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } +ruleMilitarySpelledOutAMPM :: Rule+ruleMilitarySpelledOutAMPM = Rule+ { name = "military spelled out numbers am|pm"+ , pattern =+ [ Predicate $ isIntegerBetween 10 12+ , Predicate $ isIntegerBetween 1 59+ , regex "(in the )?([ap])(\\s|\\.)?m?\\.?"+ ]+ , prod = \tokens -> case tokens of+ (h:m:Token RegexMatch (GroupMatch (_:ap:_)):_) -> do+ hh <- getIntValue h+ mm <- getIntValue m+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True hh mm+ _ -> Nothing+ }++ruleMilitarySpelledOutAMPM2 :: Rule+ruleMilitarySpelledOutAMPM2 = Rule+ { name = "six thirty six a.m."+ , pattern =+ [ Predicate $ isIntegerBetween 110 999+ , regex "(in the )?([ap])(\\s|\\.)?m?\\.?"+ ]+ , prod = \tokens -> case tokens of+ (token:Token RegexMatch (GroupMatch (_:ap:_)):_) -> do+ n <- getIntValue token+ m <- case mod n 100 of+ v | v < 60 -> Just v+ _ -> Nothing+ let h = quot n 100+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m+ _ -> Nothing+ }+ ruleTODAMPM :: Rule ruleTODAMPM = Rule { name = "<time-of-day> am|pm"@@ -553,7 +583,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (_:ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -708,7 +738,9 @@ ruleYYYYMMDD :: Rule ruleYYYYMMDD = Rule { name = "yyyy-mm-dd"- , pattern = [regex "(\\d{2,4})-(0?[1-9]|1[0-2])-(3[01]|[12]\\d|0?[1-9])"]+ , pattern =+ [ regex "(\\d{2,4})-(0?[1-9]|1[0-2])-(3[01]|[12]\\d|0?[1-9])"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (yy:mm:dd:_)):_) -> do y <- parseInt yy@@ -721,10 +753,12 @@ ruleNoonMidnightEOD :: Rule ruleNoonMidnightEOD = Rule { name = "noon|midnight|EOD|end of day"- , pattern = [regex "(noon|midni(ght|te)|(the )?(EOD|end of (the )?day))"]+ , pattern =+ [ regex "(noon|midni(ght|te)|(the )?(EOD|end of (the )?day))"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> tt . hour False $- if match == "noon" then 12 else 0+ if Text.toLower match == "noon" then 12 else 0 _ -> Nothing } @@ -844,33 +878,16 @@ , pattern = [ regex "(week(\\s|-)?end|wkend)s?" ]- , prod = \_ -> tt weekend+ , prod = \_ -> tt $ mkOkForThisNext weekend } -ruleSeasons :: Rule-ruleSeasons = Rule- { name = "seasons"- , pattern = [regex "(summer|fall|autumn|winter|spring)"]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):_) -> do- start <- case Text.toLower match of- "summer" -> Just $ monthDay 6 21- "fall" -> Just $ monthDay 9 23- "autumn" -> Just $ monthDay 9 23- "winter" -> Just $ monthDay 12 21- "spring" -> Just $ monthDay 3 20- _ -> Nothing- end <- case Text.toLower match of- "summer" -> Just $ monthDay 9 23- "fall" -> Just $ monthDay 12 21- "autumn" -> Just $ monthDay 12 21- "winter" -> Just $ monthDay 3 20- "spring" -> Just $ monthDay 6 21- _ -> Nothing- Token Time <$> interval TTime.Open start end- _ -> Nothing-- }+ruleSeasons :: [Rule]+ruleSeasons = mkRuleSeasons+ [ ( "summer", "summer" , monthDay 6 21, monthDay 9 23 )+ , ( "fall" , "fall|autumn", monthDay 9 23, monthDay 12 21 )+ , ( "winter", "winter" , monthDay 12 21, monthDay 3 20 )+ , ( "spring", "spring" , monthDay 3 20, monthDay 6 21 )+ ] ruleTODPrecision :: Rule ruleTODPrecision = Rule@@ -1082,7 +1099,7 @@ Just m -> hourMinute True h m Nothing -> hour True h Token Time <$>- interval TTime.Closed (timeOfDayAMPM td1 ampm) (timeOfDayAMPM td2 ampm)+ interval TTime.Closed (timeOfDayAMPM ampm td1) (timeOfDayAMPM ampm td2) _ -> Nothing } @@ -1139,23 +1156,11 @@ _ -> Nothing } -ruleIntervalAfterTOD :: Rule-ruleIntervalAfterTOD = Rule- { name = "after <time-of-day>"- , pattern =- [ regex "(anytime |sometimes? )?after"- , dimension Time- ]- , prod = \tokens -> case tokens of- (_:Token Time td:_) -> tt $ withDirection TTime.After td- _ -> Nothing- }--ruleIntervalSinceTOD :: Rule-ruleIntervalSinceTOD = Rule- { name = "since <time-of-day>"+ruleIntervalAfterFromSinceTOD :: Rule+ruleIntervalAfterFromSinceTOD = Rule+ { name = "from|since|after <time-of-day>" , pattern =- [ regex "since"+ [ regex "from|since|(anytime |sometimes? )?after" , dimension Time ] , prod = \tokens -> case tokens of@@ -1163,8 +1168,8 @@ _ -> Nothing } -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "monday|mon\\.?" ) , ( "Tuesday" , "tuesday|tues?\\.?" ) , ( "Wednesday", "wed?nesday|wed\\.?" )@@ -1174,17 +1179,8 @@ , ( "Sunday" , "sunday|sun\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "January" , "january|jan\\.?" ) , ( "February" , "february|feb\\.?" ) , ( "March" , "march|mar\\.?" )@@ -1199,15 +1195,6 @@ , ( "December" , "december|dec\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- rulePartOfMonth :: Rule rulePartOfMonth = Rule { name = "part of <named-month>"@@ -1230,90 +1217,43 @@ _ -> Nothing } -usHolidays :: [(Text, String, Int, Int)]-usHolidays =- [ ( "Christmas" , "(xmas|christmas)( day)?" , 12, 25 )- , ( "Christmas Eve" , "(xmas|christmas)( day)?('s)? eve", 12, 24 )- , ( "New Year's Eve" , "new year'?s? eve" , 12, 31 )- , ( "New Year's Day" , "new year'?s?( day)?" , 1 , 1 )- , ( "Valentine's Day" , "valentine'?s?( day)?" , 2 , 14 )- , ( "Independence Day", "independence day" , 7 , 4 )- , ( "Halloween" , "hall?owe?en( day)?" , 10, 31 )- ]- ruleUSHolidays :: [Rule]-ruleUSHolidays = map go usHolidays- where- go (name, regexPattern, m, d) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ monthDay m d- }+ruleUSHolidays = mkRuleHolidays+ -- Fixed dates, year over year+ [ ( "Christmas" , "(xmas|christmas)( day)?" , monthDay 12 25 )+ , ( "Christmas Eve" , "(xmas|christmas)( day)?('s)? eve", monthDay 12 24 )+ , ( "New Year's Eve" , "new year'?s? eve" , monthDay 12 31 )+ , ( "New Year's Day" , "new year'?s?( day)?" , monthDay 1 1 )+ , ( "Valentine's Day" , "valentine'?s?( day)?" , monthDay 2 14 )+ , ( "Independence Day", "independence day" , monthDay 7 4 )+ , ( "Halloween" , "hall?owe?en( day)?" , monthDay 10 31 ) -moreUSHolidays :: [(Text, String, Int, Int, Int)]-moreUSHolidays =- [ ( "Martin Luther King's Day" -- Third Monday of January+ -- Fixed day/week/month, year over year+ , ( "Martin Luther King's Day" , "(MLK|Martin Luther King,?)( Jr.?| Junior)? day"- , 3, 1, 1+ , nthDOWOfMonth 3 1 1 )- , ( "Father's Day" -- Third Sunday of June- , "father'?s?'? day"- , 3, 7, 6+ , ( "Father's Day" , "father'?s?'? day", nthDOWOfMonth 3 7 6 )+ , ( "Mother's Day" , "mother'?s?'? day", nthDOWOfMonth 2 7 5 )+ , ( "Labor Day" , "labor day" , nthDOWOfMonth 1 1 9 )++ -- The day after Thanksgiving (not always the fourth Friday of November)+ , ( "Black Friday", "black frid?day"+ , cycleNthAfter False TG.Day 1 $ nthDOWOfMonth 4 4 11 )- , ( "Mother's Day" -- Second Sunday of May- , "mother'?s?'? day"- , 2, 7, 5+ -- Last Monday of May+ , ( "Memorial Day", "memorial day", predLastOf (dayOfWeek 1) (month 5) )+ -- Long weekend before the last Monday of May+ , ( "Memorial Day weekend", "memorial day week(\\s|-)?ends?"+ , longWEBefore $ predLastOf (dayOfWeek 1) (month 5) )- , ( "Labor Day" -- First Monday of September- , "labor day"- , 1, 1, 9- )+ -- Long weekend before the first Monday of September+ , ( "Labor Day weekend", "labor day week(\\s|-)?ends?"+ , longWEBefore $ nthDOWOfMonth 1 1 9+ ) ] -ruleMoreUSHolidays :: [Rule]-ruleMoreUSHolidays = map go moreUSHolidays- where- go (name, regexPattern, n, dow, m) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ nthDOWOfMonth n dow m- } --- The day after Thanksgiving (not always the fourth Friday of November)-ruleBlackFriday :: Rule-ruleBlackFriday = Rule- { name = "black friday"- , pattern =- [ regex "black frid?day"- ]- , prod = \_ -> tt . cycleNthAfter False TG.Day 1 $ nthDOWOfMonth 4 4 11- }---- Last Monday of May-ruleMemorialDay :: Rule-ruleMemorialDay = Rule- { name = "Memorial Day"- , pattern = [regex "memorial day"]- , prod = \_ -> tt $ predLastOf (dayOfWeek 1) (month 5)- }---- Long weekend before the last Monday of May-ruleMemorialDayWeekend :: Rule-ruleMemorialDayWeekend = Rule- { name = "Memorial Day Weekend"- , pattern = [regex "memorial day week(\\s|-)?ends?"]- , prod = \_ ->- tt . longWEBefore $ predLastOf (dayOfWeek 1) (month 5)- }---- Long weekend before the first Monday of September-ruleLaborDayWeekend :: Rule-ruleLaborDayWeekend = Rule- { name = "Labor Day weekend"- , pattern = [regex "labor day week(\\s|-)?ends?"]- , prod = \_ -> tt . longWEBefore $ nthDOWOfMonth 1 1 9- }- ruleCycleThisLastNext :: Rule ruleCycleThisLastNext = Rule { name = "this|last|next <cycle>"@@ -1351,7 +1291,7 @@ : Token RegexMatch (GroupMatch (match:_)) : Token Time td : _) ->- let n = if match == "after" then 1 else - 1 in+ let n = if Text.toLower match == "after" then 1 else - 1 in tt $ cycleNthAfter False grain n td _ -> Nothing }@@ -1365,27 +1305,15 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token TimeGrain grain:Token RegexMatch (GroupMatch (match:_)):Token Time td:_) ->- let n = if match == "after" then 1 else - 1 in+ (Token TimeGrain grain:+ Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) ->+ let n = if Text.toLower match == "after" then 1 else - 1 in tt $ cycleNthAfter False grain n td _ -> Nothing } -ruleCycleLastNextN :: Rule-ruleCycleLastNextN = Rule- { name = "last|next n <cycle>"- , pattern =- [ regex "((last|past)|(next))"- , Predicate $ isIntegerBetween 1 9999- , dimension TimeGrain- ]- , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (match:_)):token:Token TimeGrain grain:_) -> do- n <- getIntValue token- tt . cycleN True grain $ if match == "next" then n else - n- _ -> Nothing- }- ruleCycleOrdinalOfTime :: Rule ruleCycleOrdinalOfTime = Rule { name = "<ordinal> <cycle> of <time>"@@ -1526,12 +1454,30 @@ _) -> case Text.toLower match of "within" -> Token Time <$> interval TTime.Open (cycleNth TG.Second 0) (inDuration dd)- "after" -> tt . withDirection TTime.After $ inDuration dd- "in" -> tt $ inDuration dd- _ -> Nothing+ "after" -> tt . withDirection TTime.After $ inDuration dd+ "in" -> tt $ inDuration dd+ _ -> Nothing _ -> Nothing } +ruleDurationLastNext :: Rule+ruleDurationLastNext = Rule+ { name = "last|past|next <duration>"+ , pattern =+ [ regex "([lp]ast|next)"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):+ Token Duration DurationData{TDuration.grain, TDuration.value}:+ _) -> case Text.toLower match of+ "next" -> tt $ cycleN True grain value+ "last" -> tt $ cycleN True grain (- value)+ "past" -> tt $ cycleN True grain (- value)+ _ -> Nothing+ _ -> Nothing+ }+ ruleDurationHenceAgo :: Rule ruleDurationHenceAgo = Rule { name = "<duration> hence|ago"@@ -1544,7 +1490,7 @@ Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "ago" -> tt $ durationAgo dd- _ -> tt $ inDuration dd+ _ -> tt $ inDuration dd _ -> Nothing } @@ -1556,7 +1502,7 @@ , Predicate $ isIntegerBetween 0 60 ] , prod = \tokens -> case tokens of- (_:Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (_:Token Numeral NumeralData{TNumeral.value = v}:_) -> tt . inDuration . duration TG.Minute $ floor v _ -> Nothing }@@ -1604,7 +1550,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } @@ -1617,8 +1563,8 @@ , ruleAbsorbInMonth , ruleAbsorbCommaTOD , ruleNextDOW- , ruleThisTime , ruleNextTime+ , ruleThisTime , ruleLastTime , ruleTimeBeforeLastAfterNext , ruleLastDOWOfTime@@ -1647,6 +1593,8 @@ , ruleHHMMLatent , ruleHHMMSS , ruleMilitaryAMPM+ , ruleMilitarySpelledOutAMPM+ , ruleMilitarySpelledOutAMPM2 , ruleTODAMPM , ruleHONumeral , ruleHODHalf@@ -1670,7 +1618,6 @@ , ruleTimePOD , rulePODofTime , ruleWeekend- , ruleSeasons , ruleTODPrecision , rulePrecisionTOD , ruleIntervalFromMonthDDDD@@ -1687,15 +1634,10 @@ , ruleIntervalBy , ruleIntervalByTheEndOf , ruleIntervalUntilTOD- , ruleIntervalAfterTOD- , ruleIntervalSinceTOD- , ruleMemorialDay- , ruleMemorialDayWeekend- , ruleLaborDayWeekend- , ruleCycleThisLastNext+ , ruleIntervalAfterFromSinceTOD , ruleCycleTheAfterBeforeTime+ , ruleCycleThisLastNext , ruleCycleAfterBeforeTime- , ruleCycleLastNextN , ruleCycleOrdinalOfTime , ruleCycleTheOrdinalOfTime , ruleCycleTheOfTime@@ -1705,6 +1647,7 @@ , ruleCycleTheOrdinalQuarter , ruleCycleOrdinalQuarterYear , ruleDurationInWithinAfter+ , ruleDurationLastNext , ruleDurationHenceAgo , ruleDurationAfterBeforeTime , ruleIntervalForDurationFrom@@ -1712,10 +1655,9 @@ , ruleTimezone , rulePartOfMonth , ruleNow- , ruleBlackFriday ] ++ ruleInstants ++ ruleDaysOfWeek ++ ruleMonths+ ++ ruleSeasons ++ ruleUSHolidays- ++ ruleMoreUSHolidays
+ Duckling/Time/EN/TT/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.TT.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15/2"+ , "on 15/2"+ , "15 / 2"+ , "15-2"+ , "15 - 2"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "25/4 at 4:00pm"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "10/10"+ , "10/10/2013"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/TT/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.TT.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleDDMM :: Rule+ruleDDMM = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:_)):_) -> do+ d <- parseInt dd+ m <- parseInt mm+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleDDMM+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
Duckling/Time/EN/US/Corpus.hs view
@@ -32,6 +32,7 @@ [ "10/31/1974" , "10/31/74" , "10-31-74"+ , "10.31.1974" ] , examples (datetime (2013, 4, 25, 16, 0, 0) Minute) [ "4/25 at 4:00pm"
Duckling/Time/EN/US/Rules.hs view
@@ -14,6 +14,7 @@ ( rules , ruleMMDD , ruleMMDDYYYY+ , ruleMMDDYYYYDot , ruleThanksgiving ) where @@ -30,7 +31,9 @@ ruleMMDD :: Rule ruleMMDD = Rule { name = "mm/dd"- , pattern = [regex "(0?[1-9]|1[0-2])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"]+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (mm:dd:_)):_) -> do m <- parseInt mm@@ -43,7 +46,8 @@ ruleMMDDYYYY = Rule { name = "mm/dd/yyyy" , pattern =- [regex "(0?[1-9]|1[0-2])[/-](3[01]|[12]\\d|0?[1-9])[-/](\\d{2,4})"]+ [ regex "(1[0-2]|0?[1-9])[/-](3[01]|[12]\\d|0?[1-9])[/-](\\d{2,4})"+ ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do y <- parseInt yy@@ -53,18 +57,36 @@ _ -> Nothing } +-- Clashes with HHMMSS, hence only 4-digit years+ruleMMDDYYYYDot :: Rule+ruleMMDDYYYYDot = Rule+ { name = "mm.dd.yyyy"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\.(3[01]|[12]\\d|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:yy:_)):_) -> do+ y <- parseInt yy+ m <- parseInt mm+ d <- parseInt dd+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November ruleThanksgiving :: Rule ruleThanksgiving = Rule { name = "Thanksgiving Day" , pattern = [ regex "thanks?giving( day)?" ]- , prod = \_ -> tt $ nthDOWOfMonth 4 4 11 -- Fourth Thursday of November+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11 } rules :: [Rule] rules = [ ruleMMDD , ruleMMDDYYYY+ , ruleMMDDYYYYDot , ruleThanksgiving ]
+ Duckling/Time/EN/ZA/Corpus.hs view
@@ -0,0 +1,61 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.ZA.Corpus+ ( allExamples+ ) where++import Data.String+import Prelude++import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "2/15"+ , "on 2/15"+ , "2 / 15"+ , "2-15"+ , "2 - 15"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31/10/1974"+ , "31/10/74"+ , "31-10-74"+ , "31.10.1974"+ ]+ , examples (datetime (2013, 4, 25, 16, 0, 0) Minute)+ [ "4/25 at 4:00pm"+ ]+ , examples (datetime (2013, 11, 28, 0, 0, 0) Day)+ [ "thanksgiving day"+ , "thanksgiving"+ , "thanksgiving 2013"+ , "this thanksgiving"+ , "next thanksgiving day"+ ]+ , examples (datetime (2014, 11, 27, 0, 0, 0) Day)+ [ "thanksgiving of next year"+ , "thanksgiving 2014"+ ]+ , examples (datetime (2012, 11, 22, 0, 0, 0) Day)+ [ "last thanksgiving"+ , "thanksgiving day 2012"+ ]+ , examples (datetime (2016, 11, 24, 0, 0, 0) Day)+ [ "thanksgiving 2016"+ ]+ , examples (datetime (2017, 11, 23, 0, 0, 0) Day)+ [ "thanksgiving 2017"+ ]+ ]
+ Duckling/Time/EN/ZA/Rules.hs view
@@ -0,0 +1,88 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.EN.ZA.Rules+ ( rules+ ) where++import Data.Maybe+import Prelude++import Duckling.Dimensions.Types+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types++ruleMMDD :: Rule+ruleMMDD = Rule+ { name = "mm/dd"+ , pattern =+ [ regex "(1[0-2]|0?[1-9])\\s?[/-]\\s?(3[01]|[12]\\d|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (mm:dd:_)):_) -> do+ m <- parseInt mm+ d <- parseInt dd+ tt $ monthDay m d+ _ -> Nothing+ }++ruleDDMMYYYY :: Rule+ruleDDMMYYYY = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/-](1[0-2]|0?[1-9])[-/](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Clashes with HHMMSS, hence only 4-digit years+ruleDDMMYYYYDot :: Rule+ruleDDMMYYYYDot = Rule+ { name = "dd.mm.yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\.(1[0-2]|0?[1-9])\\.(\\d{4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (dd:mm:yy:_)):_) -> do+ y <- parseInt yy+ d <- parseInt dd+ m <- parseInt mm+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++-- Fourth Thursday of November+ruleThanksgiving :: Rule+ruleThanksgiving = Rule+ { name = "Thanksgiving Day"+ , pattern =+ [ regex "thanks?giving( day)?"+ ]+ , prod = \_ -> tt . mkOkForThisNext $ nthDOWOfMonth 4 4 11+ }++rules :: [Rule]+rules =+ [ ruleMMDD+ , ruleDDMMYYYY+ , ruleDDMMYYYYDot+ , ruleThanksgiving+ ]
Duckling/Time/ES/Rules.hs view
@@ -62,8 +62,8 @@ _ -> Nothing } -daysOfWeek :: [(Text.Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Lunes" , "lunes|lun?\\.?" ) , ( "Martes" , "martes|mar?\\.?" ) , ( "Miercoles" , "mi(e|é)\\.?(rcoles)?|mx|mier?\\." )@@ -73,17 +73,8 @@ , ( "Domingo" , "domingo|dom\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text.Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "Enero" , "enero|ene\\.?") , ( "Febrero" , "febrero|feb\\.?") , ( "Marzo" , "marzo|mar\\.?")@@ -98,15 +89,6 @@ , ( "Diciembre" , "diciembre|dic\\.?") ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleThisDayofweek :: Rule ruleThisDayofweek = Rule { name = "this <day-of-week>"@@ -863,7 +845,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -904,7 +886,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_:Token Time td:_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_:Token Time td:_) -> tt $ cycleNthAfter False TG.Quarter (v - 1) td _ -> Nothing }@@ -1083,7 +1065,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -1242,7 +1224,7 @@ , Predicate $ isGrain TG.Quarter ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . cycleNthAfter False TG.Quarter (v - 1) $ cycleNth TG.Year 0 _ -> Nothing@@ -1323,7 +1305,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1341,7 +1323,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/FR/Rules.hs view
@@ -11,7 +11,8 @@ {-# LANGUAGE OverloadedStrings #-} module Duckling.Time.FR.Rules- ( rules ) where+ ( rules+ ) where import Data.Text (Text) import Prelude@@ -1890,12 +1891,12 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } -months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "Janvier" , "janvier|janv\\.?" ) , ( "Fevrier" , "f(é|e)vrier|f(é|e)v\\.?" ) , ( "Mars" , "mars|mar\\.?" )@@ -1910,17 +1911,8 @@ , ( "Decembre" , "d(é|e)cembre|d(é|e)c\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }--daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Lundi" , "lun\\.?(di)?" ) , ( "Mardi" , "mar\\.?(di)?" ) , ( "Mercredi" , "mer\\.?(credi)?" )@@ -1929,15 +1921,6 @@ , ( "Samedi" , "sam\\.?(edi)?" ) , ( "Dimanche" , "dim\\.?(anche)?" ) ]--ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- } rules :: [Rule] rules =
Duckling/Time/GA/Rules.hs view
@@ -600,50 +600,32 @@ _ -> Nothing } -daysOfWeek :: [(Text, String)]-daysOfWeek =- [ ( "Monday" , "luai?n|lu\\.?" )+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek+ [ ( "Monday" , "luai?n|lu\\.?" ) , ( "Tuesday" , "mh?(á|a)irt|m(á|a)?\\.?" ) , ( "Wednesday", "ch?(é|e)adaoin|c(é|e)\\.?" ) , ( "Thursday" , "d(é|e)ardaoin|d(é|e)?\\.?" )- , ( "Friday" , "h?aoine|ao\\.?" )- , ( "Saturday" , "sathai?rn|sa\\.?" )- , ( "Sunday" , "domhnai?[cg]h|do\\.?" )+ , ( "Friday" , "h?aoine|ao\\.?" )+ , ( "Saturday" , "sathai?rn|sa\\.?" )+ , ( "Sunday" , "domhnai?[cg]h|do\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =- [ ( "January" , "(mh?(í|i) )?(an )?t?ean(á|a)ir|ean\\.?" )- , ( "February" , "(mh?(í|i) )?(na )?feabhra|fea\\.?" )+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths+ [ ( "January" , "(mh?(í|i) )?(an )?t?ean(á|a)ir|ean\\.?" )+ , ( "February" , "(mh?(í|i) )?(na )?feabhra|fea\\.?" ) , ( "March" , "(mh?(í|i) )?(an )?mh?(á|a)rta|m(á|a)r\\.?" )- , ( "April" , "(mh?(í|i) )?(an )?t?aibre(á|a)i?n|abr\\.?" )- , ( "May" , "(mh?(í|i) )?(na )?bh?ealtaine|bea\\.?" )- , ( "June" , "(mh?(í|i) )?(an )?mh?eith(ea|i)mh|mei\\.?" )+ , ( "April" , "(mh?(í|i) )?(an )?t?aibre(á|a)i?n|abr\\.?" )+ , ( "May" , "(mh?(í|i) )?(na )?bh?ealtaine|bea\\.?" )+ , ( "June" , "(mh?(í|i) )?(an )?mh?eith(ea|i)mh|mei\\.?" ) , ( "July" , "(mh?(í|i) )?i(ú|u)il|i(ú|u)i\\.?" ) , ( "August" , "(mh?(í|i) )?(na )?l(ú|u)nasa|l(ú|u)n\\.?" ) , ( "September", "(mh?(í|i) )?mh?e(á|a)n f(ó|o)mhair|mef?\\.?")- , ( "October" , "(mh?(í|i) )?(na )?nollai?g|nol\\.?" )- , ( "November" , "(mh?(í|i) )?(na )?samh(ain|na)|sam\\.?" )- , ( "December" , "(mh?(í|i) )?(na )?nollai?g|nol\\.?" )+ , ( "October" , "(mh?(í|i) )?(na )?nollai?g|nol\\.?" )+ , ( "November" , "(mh?(í|i) )?(na )?samh(ain|na)|sam\\.?" )+ , ( "December" , "(mh?(í|i) )?(na )?nollai?g|nol\\.?" ) ]--ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- } ruleCycleINdiaidhTime :: Rule ruleCycleINdiaidhTime = Rule
Duckling/Time/HE/Rules.hs view
@@ -1024,7 +1024,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (_:ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -1150,8 +1150,7 @@ (Token RegexMatch (GroupMatch (hh:mm:_)):Token RegexMatch (GroupMatch (ap:_)):_) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } @@ -1226,7 +1225,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: _) -> tt $ dayOfMonth v _ -> Nothing }@@ -1326,8 +1325,8 @@ _ -> Nothing } -months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "ינואר", "ינואר" ) , ( "פברואר", "פברואר" ) , ( "מרץ", "מרץ" )@@ -1341,15 +1340,6 @@ , ( "נובמבר", "נובמבר" ) , ( "דצמבר", "דצמבר" ) ]--ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- } rules :: [Rule] rules =
Duckling/Time/HR/Corpus.hs view
@@ -617,6 +617,7 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "cetvrtak 8:00 GMT"+ , "cetvrtak 8:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "danas u 14"
Duckling/Time/HR/Rules.hs view
@@ -7,11 +7,12 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoRebindableSyntax #-} module Duckling.Time.HR.Rules- ( rules ) where+ ( rules+ ) where -import Control.Monad (join) import Data.Maybe import Data.String import Data.Text (Text)@@ -31,8 +32,8 @@ import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "ponedjelja?ka?|pon\\.?" ) , ( "Tuesday" , "utora?ka?|uto?\\.?" ) , ( "Wednesday", "srijed(a|e|u)|sri\\.?" )@@ -42,40 +43,22 @@ , ( "Sunday" , "nedjelj(a|e|u)|ned\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =- [ ( "January" , "sije(c|č)a?nj(a|u)?|januar(a|u)?|jan\\.?|sij?\\.?|prv(i|a|o(ga?)?)" )- , ( "February" , "(ve)?lja(c|č)(a|e|i)|februar(a|u)?|feb\\.?|ve(lj)?\\.?|drug(i|a|o(ga?)?)" )+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths+ [ ( "January" , "sije(c|č)a?nj(a|u)?|januar(a|u)?|jan\\.?|sij?\\.?|prv(i|a|o(ga?)?)" )+ , ( "February" , "(ve)?lja(c|č)(a|e|i)|februar(a|u)?|feb\\.?|ve(lj)?\\.?|drug(i|a|o(ga?)?)") , ( "March" , "o(z|ž)uja?k(a|u)?|mart(a|u)?|mar\\.?|o(z|ž)u?\\.?|tre(c|ć)(i|a|e(ga?)?)" )- , ( "April" , "trava?nj(a|u)?|april(a|u)?|apr\\.?|tra\\.?|(č|c)etvrt(i|a|o(ga?)?)" )- , ( "May" , "sviba?nj(a|u)?|maj|svi\\.?|pet(i|a|o(ga?)?)" )- , ( "June" , "lipa?nj(a|u)?|jun(i|u|a)?|jun\\.?|lip?\\.?|(š|s)est(i|a|o(ga?)?)" )- , ( "July" , "srpa?nj(a|u)?|jul(i|u|a)?|jul\\.?|srp\\.?|sedm(i|a|o(ga?)?)" )- , ( "August" , "kolovoz(a|u)?|august(a|u)?|aug\\.?|kol\\.?|osm(i|a|o(ga?)?)" )- , ( "September", "ruja?n(a|u)?|septemba?r(a|u)?|sept?\\.?|ruj\\.?|devet(i|a|o(ga?)?)" )- , ( "October" , "listopad(a|u)?|oktobar(a|u)?|okt\\.?|lis\\.?|deset(i|a|o(ga?)?)" )- , ( "November" , "studen(i|oga?|om)|novemba?r(a|u)?|nov\\.?|stu\\.?|jedanaest(i|a|o(ga?)?)" )- , ( "December" , "prosina?c(a|u)?|decemba?r(a|u)?|dec\\.?|pros?\\.?|dvanaest(i|a|o(ga?)?)" )+ , ( "April" , "trava?nj(a|u)?|april(a|u)?|apr\\.?|tra\\.?|(č|c)etvrt(i|a|o(ga?)?)" )+ , ( "May" , "sviba?nj(a|u)?|maj|svi\\.?|pet(i|a|o(ga?)?)" )+ , ( "June" , "lipa?nj(a|u)?|jun(i|u|a)?|jun\\.?|lip?\\.?|(š|s)est(i|a|o(ga?)?)" )+ , ( "July" , "srpa?nj(a|u)?|jul(i|u|a)?|jul\\.?|srp\\.?|sedm(i|a|o(ga?)?)" )+ , ( "August" , "kolovoz(a|u)?|august(a|u)?|aug\\.?|kol\\.?|osm(i|a|o(ga?)?)" )+ , ( "September", "ruja?n(a|u)?|septemba?r(a|u)?|sept?\\.?|ruj\\.?|devet(i|a|o(ga?)?)" )+ , ( "October" , "listopad(a|u)?|oktobar(a|u)?|okt\\.?|lis\\.?|deset(i|a|o(ga?)?)" )+ , ( "November" , "studen(i|oga?|om)|novemba?r(a|u)?|nov\\.?|stu\\.?|jedanaest(i|a|o(ga?)?)")+ , ( "December" , "prosina?c(a|u)?|decemba?r(a|u)?|dec\\.?|pros?\\.?|dvanaest(i|a|o(ga?)?)" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleHalfIntegerHrStyleHourofday :: Rule ruleHalfIntegerHrStyleHourofday = Rule { name = "half <integer> (HR style hour-of-day)"@@ -1173,7 +1156,7 @@ (Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do h <- parseInt hh m <- parseInt mm- tt $ timeOfDayAMPM (hourMinute False h m) False+ tt . timeOfDayAMPM False $ hourMinute False h m _ -> Nothing } @@ -1365,7 +1348,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/HU/Rules.hs view
@@ -40,29 +40,20 @@ _ -> Nothing } -instants :: [(Text, String, TG.Grain, Int)]-instants =- [ ("right now", "((\x00E9pp )?most)|azonnal", TG.Second, 0 )- , ("today", "ma", TG.Day, 0 )- , ("tomorrow", "holnap", TG.Day, 1 )- , ("day after tomorrow", "holnaput\x00E1n", TG.Day, 2 )- , ("yesterday", "tegnap", TG.Day, -1 )- , ("day before yesterday", "tegnapel\x0151tt", TG.Day, -2 )- , ("end of month", "(a )?h\x00F3nap v\x00E9ge", TG.Month, 1 )- , ("end of year", "(az )?\x00E9v v\x00E9ge", TG.Year, 1 )- ]- ruleInstants :: [Rule]-ruleInstants = map go instants- where- go (name, regexPattern, grain, n) = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ cycleNth grain n- }+ruleInstants = mkRuleInstants+ [ ("right now", TG.Second, 0 , "((\x00E9pp )?most)|azonnal" )+ , ("today", TG.Day, 0 , "ma" )+ , ("tomorrow", TG.Day, 1 , "holnap" )+ , ("day after tomorrow", TG.Day, 2 , "holnaput\x00E1n" )+ , ("yesterday", TG.Day, -1, "tegnap" )+ , ("day before yesterday", TG.Day, -2, "tegnapel\x0151tt" )+ , ("end of month", TG.Month, 1 , "(a )?h\x00F3nap v\x00E9ge" )+ , ("end of year", TG.Year, 1 , "(az )?\x00E9v v\x00E9ge" )+ ] -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "h\x00E9tf\x0151|h\x00E9t\\.?" ) , ( "Tuesday" , "kedd" ) , ( "Wednesday", "szerda|szer\\.?" )@@ -72,17 +63,8 @@ , ( "Sunday" , "vas\x00E1rnap|vas\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "January" , "janu\x00E1r|jan\\.?" ) , ( "February" , "febru\x00E1r|febr?\\.?" ) , ( "March" , "m\x00E1rcius|m\x00E1rc?\\.?" )@@ -97,15 +79,6 @@ , ( "December" , "december|dec\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleMonthDOMNumeral :: Rule ruleMonthDOMNumeral = Rule { name = "<named-month> <day-of-month> (non ordinal)"@@ -182,7 +155,7 @@ ruleTODLatent = Rule { name = "time-of-day (latent)" , pattern =- [ Predicate $ and . sequence [isNumeralSafeToUse, isIntegerBetween 0 23]+ [ Predicate $ isIntegerBetween 0 23 ] , prod = \tokens -> case tokens of (token:_) -> do@@ -199,8 +172,7 @@ , Predicate isATimeOfDay ] , prod = \tokens -> case tokens of- (_:Token Time td:_) ->- tt . timeOfDayAMPM td $ True+ (_:Token Time td:_) -> tt $ timeOfDayAMPM True td _ -> Nothing } @@ -212,7 +184,7 @@ , Predicate isATimeOfDay ] , prod = \tokens -> case tokens of- (_:Token Time td:_) -> tt . timeOfDayAMPM td $ False+ (_:Token Time td:_) -> tt $ timeOfDayAMPM False td _ -> Nothing }
Duckling/Time/Helpers.hs view
@@ -8,24 +8,27 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE NoRebindableSyntax #-}-{-# LANGUAGE OverloadedStrings #-} + module Duckling.Time.Helpers ( -- Patterns hasNoDirection, isADayOfWeek, isAMonth, isAnHourOfDay, isAPartOfDay , isATimeOfDay, isDOMInteger, isDOMOrdinal, isDOMValue, isGrain , isGrainFinerThan, isGrainOfTime, isIntegerBetween, isNotLatent- , isOrdinalBetween, isMidnightOrNoon, isNumeralSafeToUse+ , isOrdinalBetween, isMidnightOrNoon, isOkWithThisNext -- Production , cycleLastOf, cycleN, cycleNth, cycleNthAfter, dayOfMonth, dayOfWeek- , durationAfter, durationAgo, durationBefore, form, hour, hourMinute- , hourMinuteSecond, inDuration, intersect, intersectDOM, interval+ , durationAfter, durationAgo, durationBefore, mkOkForThisNext, form, hour+ , hourMinute, hourMinuteSecond, inDuration, intersect, intersectDOM, interval , inTimezone, longWEBefore, minute, minutesAfter, minutesBefore, mkLatent , month, monthDay, notLatent, now, nthDOWOfMonth, partOfDay, predLastOf , predNth, predNthAfter, second, timeOfDayAMPM, weekend, withDirection, year , yearMonthDay, tt -- Other , getIntValue+ -- Rule constructors+ , mkRuleInstants, mkRuleDaysOfWeek, mkRuleMonths, mkRuleSeasons+ , mkRuleHolidays ) where import Data.Maybe@@ -227,11 +230,11 @@ isGrain _ _ = False isGrainFinerThan :: TG.Grain -> Predicate-isGrainFinerThan value (Token Time (TimeData {TTime.timeGrain = g})) = g < value+isGrainFinerThan value (Token Time TimeData{TTime.timeGrain = g}) = g < value isGrainFinerThan _ _ = False isGrainOfTime :: TG.Grain -> Predicate-isGrainOfTime value (Token Time (TimeData {TTime.timeGrain = g})) = g == value+isGrainOfTime value (Token Time TimeData{TTime.timeGrain = g}) = g == value isGrainOfTime _ _ = False isADayOfWeek :: Predicate@@ -279,14 +282,10 @@ hasNoDirection _ = False isIntegerBetween :: Int -> Int -> Predicate-isIntegerBetween low high (Token Numeral nd) =- TNumeral.isIntegerBetween (TNumeral.value nd) low high+isIntegerBetween low high (Token Numeral nd) = TNumeral.okForAnyTime nd+ && TNumeral.isIntegerBetween (TNumeral.value nd) low high isIntegerBetween _ _ _ = False -isNumeralSafeToUse :: Predicate-isNumeralSafeToUse (Token Numeral nd) = TNumeral.okForAnyTime nd-isNumeralSafeToUse _ = False- isOrdinalBetween :: Int -> Int -> Predicate isOrdinalBetween low high (Token Ordinal od) = TOrdinal.isBetween (TOrdinal.value od) low high@@ -301,6 +300,10 @@ isDOMValue :: Predicate isDOMValue = or . sequence [isDOMOrdinal, isDOMInteger] +isOkWithThisNext :: Predicate+isOkWithThisNext (Token Time TimeData {TTime.okForThisNext = True}) = True+isOkWithThisNext _ = False+ -- ----------------------------------------------------------------- -- Production @@ -313,7 +316,7 @@ res -> Just res intersect' :: (TimeData, TimeData) -> TimeData-intersect' (TimeData pred1 _ g1 _ _ d1, TimeData pred2 _ g2 _ _ d2)+intersect' (TimeData pred1 _ g1 _ _ d1 _, TimeData pred2 _ g2 _ _ d2 _) | g1 < g2 = TTime.timedata' { TTime.timePred = timeCompose pred1 pred2 , TTime.timeGrain = g1@@ -424,7 +427,7 @@ } interval' :: TTime.TimeIntervalType -> (TimeData, TimeData) -> TimeData-interval' intervalType (TimeData p1 _ g1 _ _ _, TimeData p2 _ g2 _ _ _) =+interval' intervalType (TimeData p1 _ g1 _ _ _ _, TimeData p2 _ g2 _ _ _ _) = TTime.timedata' { TTime.timePred = mkTimeIntervalsPredicate intervalType' p1 p2 , TTime.timeGrain = min g1 g2@@ -441,6 +444,9 @@ | TTime.isEmptyPredicate pred -> Nothing res -> Just res +mkOkForThisNext :: TimeData -> TimeData+mkOkForThisNext td = td {TTime.okForThisNext = True}+ durationAgo :: DurationData -> TimeData durationAgo dd = inDuration $ timeNegPeriod dd @@ -484,8 +490,8 @@ timeOfDay :: Maybe Int -> Bool -> TimeData -> TimeData timeOfDay h is12H = form TTime.TimeOfDay {TTime.hours = h, TTime.is12H = is12H} -timeOfDayAMPM :: TimeData -> Bool -> TimeData-timeOfDayAMPM tod isAM = timeOfDay Nothing False $ intersect' (tod, ampm)+timeOfDayAMPM :: Bool -> TimeData -> TimeData+timeOfDayAMPM isAM tod = timeOfDay Nothing False $ intersect' (tod, ampm) where ampm = TTime.timedata' { TTime.timePred = ampmPred@@ -540,3 +546,40 @@ -- | Convenience helper to return a time token from a rule tt :: TimeData -> Maybe Token tt = Just . Token Time++-- | Rule constructors+mkSingleRegexRule :: Text -> String -> Maybe Token -> Rule+mkSingleRegexRule name pattern token = Rule+ { name = name+ , pattern = [regex pattern]+ , prod = const token+ }++mkRuleInstants :: [(Text, TG.Grain, Int, String)] -> [Rule]+mkRuleInstants = map go+ where+ go (name, grain, n, ptn) = mkSingleRegexRule name ptn . tt $+ cycleNth grain n++mkRuleDaysOfWeek :: [(Text, String)] -> [Rule]+mkRuleDaysOfWeek daysOfWeek = zipWith go daysOfWeek [1..7]+ where+ go (name, ptn) i =+ mkSingleRegexRule name ptn . tt . mkOkForThisNext $ dayOfWeek i++mkRuleMonths :: [(Text, String)] -> [Rule]+mkRuleMonths months = zipWith go months [1..12]+ where+ go (name, ptn) i =+ mkSingleRegexRule name ptn . tt . mkOkForThisNext $ month i++mkRuleSeasons :: [(Text, String, TimeData, TimeData)] -> [Rule]+mkRuleSeasons = map go+ where+ go (name, ptn, start, end) = mkSingleRegexRule name ptn $+ Token Time <$> mkOkForThisNext <$> interval TTime.Open start end++mkRuleHolidays :: [(Text, String, TimeData)] -> [Rule]+mkRuleHolidays = map go+ where+ go (name, ptn, td) = mkSingleRegexRule name ptn . tt $ mkOkForThisNext td
Duckling/Time/IT/Corpus.hs view
@@ -736,6 +736,7 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "giovedì alle 8:00 GMT"+ , "giovedì alle 8:00 gmt" ] , examples (datetime (2013, 2, 13, 14, 0, 0) Hour) [ "domani alle 14"
Duckling/Time/IT/Rules.hs view
@@ -1110,28 +1110,19 @@ _ -> Nothing } -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Lunedi" , "luned(i|ì)|lun?\\.?" ) , ( "Martedi" , "marted(i|ì)|mar\\.?" ) , ( "Mercoledi", "mercoled(i|ì)|mer\\.?" ) , ( "Giovedi" , "gioved(i|ì)|gio\\.?" ) , ( "Venerdi" , "venerd(i|ì)|ven\\.?" )- , ( "Sabato" , "sabato|sab\\.?" )- , ( "Domenica" , "domenica|dom\\.?" )+ , ( "Sabato" , "sabato|sab\\.?" )+ , ( "Domenica" , "domenica|dom\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "Gennaio" , "gennaio|genn?\\.?" ) , ( "Febbraio" , "febbraio|febb?\\.?" ) , ( "Marzo" , "marzo|mar\\.?" )@@ -1146,15 +1137,6 @@ , ( "Dicembre" , "dicembre|dic\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleTheCycleOfTime :: Rule ruleTheCycleOfTime = Rule { name = "the <cycle> of <time>"@@ -1283,7 +1265,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1998,7 +1980,7 @@ , regex "d(i|el(la)?) (pomeriggio|(sta)?(sera|notte))" ] , prod = \tokens -> case tokens of- (Token Numeral (NumeralData {TNumeral.value = v}):_) ->+ (Token Numeral NumeralData{TNumeral.value = v}:_) -> tt $ hour False (12 + floor v) _ -> Nothing }@@ -2248,7 +2230,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/KO/Corpus.hs view
@@ -498,6 +498,7 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "목요일 8:00 GMT"+ , "목요일 8:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "오늘 오후두시에"
Duckling/Time/KO/Rules.hs view
@@ -663,7 +663,7 @@ ] , prod = \tokens -> case tokens of (Token Time td1:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td2: _) -> Token Time . predNth (v - 1) False <$> intersect td1 td2 _ -> Nothing@@ -962,7 +962,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (_:ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -1104,11 +1104,12 @@ , regex "([ap])\\.?m?\\.?" ] , prod = \tokens -> case tokens of- (Token RegexMatch (GroupMatch (hh:mm:_)):Token RegexMatch (GroupMatch (ap:_)):_) -> do+ (Token RegexMatch (GroupMatch (hh:mm:_)):+ Token RegexMatch (GroupMatch (ap:_)):+ _) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } @@ -1206,8 +1207,7 @@ , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)): Token Time td:- _) -> tt . timeOfDayAMPM td $- elem match ["오전", "아침"]+ _) -> tt $ timeOfDayAMPM (elem match ["오전", "아침"]) td _ -> Nothing } @@ -1250,7 +1250,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/NB/Corpus.hs view
@@ -567,8 +567,11 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "torsdag kl. 8:00 GMT"+ , "torsdag kl. 8:00 gmt" , "torsdag klokken 8:00 GMT"+ , "torsdag klokken 8:00 gmt" , "torsdag 08:00 GMT"+ , "torsdag 08:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "idag kl. 14"
Duckling/Time/NB/Rules.hs view
@@ -23,6 +23,7 @@ import Duckling.Time.Helpers import Duckling.Time.Types (TimeData (..)) import Duckling.Types+import qualified Data.Text as Text import qualified Duckling.Ordinal.Types as TOrdinal import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG@@ -503,8 +504,8 @@ _ -> Nothing } -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Mandag" , "mandag|man\\.?" ) , ( "Tirsdag" , "tirsdag|tirs?\\.?" ) , ( "Onsdag" , "onsdag|ons\\.?" )@@ -514,17 +515,8 @@ , ( "Søndag" , "søndag|søn\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "Januar" , "januar|jan\\.?" ) , ( "Februar" , "februar|feb\\.?" ) , ( "Mars" , "mars|mar\\.?" )@@ -539,15 +531,6 @@ , ( "Desember" , "desember|des\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleTheCycleOfTime :: Rule ruleTheCycleOfTime = Rule { name = "the <cycle> of <time>"@@ -1356,7 +1339,7 @@ [ Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . mkLatent $ dayOfMonth v _ -> Nothing }@@ -1567,7 +1550,7 @@ , Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (_:Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt $ dayOfMonth v _ -> Nothing }@@ -1684,7 +1667,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
+ Duckling/Time/NL/Corpus.hs view
@@ -0,0 +1,673 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.NL.Corpus+ ( corpus+ , negativeCorpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types hiding (examples)+import Duckling.Time.Corpus+import Duckling.Time.Types hiding (Month)+import Duckling.TimeGrain.Types hiding (add)++context :: Context+context = testContext {locale = makeLocale NL Nothing}++corpus :: Corpus+corpus = (context, allExamples)++negativeCorpus :: NegativeCorpus+negativeCorpus = (context, examples)+ where+ examples =+ [ "een hotel"+ , "twee aanbiedingen"+ , "komende 5 agendapunten"+ , "d"+ , "do"+ , "di"+ , "woe"+ , "vr"+ , "zat"+ , "zo"+ , "zon"+ ]++allExamples :: [Example]+allExamples = concat+ [ examples (datetime (2013, 2, 12, 4, 30, 0) Second)+ [ "nu"+ , "direct"+ , "zojuist"+ ]+ , examples (datetime (2013, 2, 12, 0, 0, 0) Day)+ [ "vandaag"+ , "op deze dag"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Day)+ [ "gisteren"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "morgen"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "maandag"+ , "ma."+ , "volgende week maandag"+ , "komende maandag"+ , "aanstaande maandag"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "Maandag, 18 Feb"+ , "maandag, 18 februari"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "dinsdag"+ , "di."+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "donderdag"+ , "do."+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "vrijdag"+ , "vr."+ ]+ , examples (datetime (2013, 2, 16, 0, 0, 0) Day)+ [ "zaterdag"+ , "za."+ , "zat."+ ]+ , examples (datetime (2013, 2, 17, 0, 0, 0) Day)+ [ "zondag"+ , "zo."+ , "zon."+ ]+ , examples (datetime (2013, 3, 1, 0, 0, 0) Day)+ [ "1 maart"+ , "op de eerste"+ ]+ , examples (datetime (2013, 3, 3, 0, 0, 0) Day)+ [ "3 maart"+ ]+ , examples (datetime (2015, 3, 3, 0, 0, 0) Day)+ [ "3 maart 2015"+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "op de 15de"+ ]+ , examples (datetime (2013, 2, 15, 0, 0, 0) Day)+ [ "15 februari"+ , "februari 15"+ , "op de 15de februari"+ , "15-2"+ , "op 15-2"+ ]+ , examples (datetime (2013, 8, 8, 0, 0, 0) Day)+ [ "Aug 8"+ , "8 augustus"+ ]+ , examples (datetime (2014, 10, 0, 0, 0, 0) Month)+ [ "Oktober 2014"+ ]+ , examples (datetime (1974, 10, 31, 0, 0, 0) Day)+ [ "31.10.1974"+ , "31.10.74"+ , "31-10-1974"+ , "31-10-74"+ ]+ , examples (datetime (2015, 4, 14, 0, 0, 0) Day)+ [ "14 april 2015"+ , "April 14, 2015"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "volgende week dinsdag"+ ]+ , examples (datetime (2013, 2, 22, 0, 0, 0) Day)+ [ "volgende week vrijdag"+ ]+ , examples (datetime (2013, 3, 0, 0, 0, 0) Month)+ [ "maart"+ ]+ , examples (datetime (2014, 3, 0, 0, 0, 0) Month)+ [ "volgend jaar maart"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "zondag, feb 10"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "woensdag, 13 februari"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "Maandag feb 18"+ , "Maandag 18 februari"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Week)+ [ "Deze week"+ ]+ , examples (datetime (2013, 2, 4, 0, 0, 0) Week)+ [ "vorige week"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Week)+ [ "volgende week"+ ]+ , examples (datetime (2013, 1, 0, 0, 0, 0) Month)+ [ "vorige maand"+ ]+ , examples (datetime (2013, 3, 0, 0, 0, 0) Month)+ [ "volgende maand"+ ]+ , examples (datetime (2013, 1, 1, 0, 0, 0) Quarter)+ [ "dit kwartaal"+ ]+ , examples (datetime (2013, 4, 1, 0, 0, 0) Quarter)+ [ "volgende kwartaal"+ ]+ , examples (datetime (2013, 7, 1, 0, 0, 0) Quarter)+ [ "derde kwartaal"+ ]+ , examples (datetime (2018, 10, 1, 0, 0, 0) Quarter)+ [ "4de kwartaal 2018"+ ]+ , examples (datetime (2012, 0, 0, 0, 0, 0) Year)+ [ "vorig jaar"+ ]+ , examples (datetime (2013, 0, 0, 0, 0, 0) Year)+ [ "dit jaar"+ ]+ , examples (datetime (2014, 0, 0, 0, 0, 0) Year)+ [ "volgend jaar"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "afgelopen zondag"+ , "vorige week zondag"+ ]+ , examples (datetime (2013, 2, 5, 0, 0, 0) Day)+ [ "vorige dinsdag"+ , "afgelopen dinsdag"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "dinsdag over een week"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "komende woensdag"+ , "woensdag"+ , "woe."+ ]+ , examples (datetime (2013, 2, 20, 0, 0, 0) Day)+ [ "volgende week woensdag"+ ]+ , examples (datetime (2013, 2, 11, 0, 0, 0) Day)+ [ "deze week maandag"+ ]+ , examples (datetime (2013, 2, 12, 0, 0, 0) Day)+ [ "dinsdag deze week"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "deze week woensdag"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "overmorgen"+ ]+ , examples (datetime (2013, 2, 10, 0, 0, 0) Day)+ [ "eergisteren"+ ]+ , examples (datetime (2013, 3, 25, 0, 0, 0) Day)+ [ "laatste maandag in maart"+ ]+ , examples (datetime (2014, 3, 30, 0, 0, 0) Day)+ [ "laatste zondag van maart 2014"+ ]+ , examples (datetime (2013, 10, 3, 0, 0, 0) Day)+ [ "derde dag in oktober"+ ]+ , examples (datetime (2014, 10, 6, 0, 0, 0) Week)+ [ "eerste week in oktober 2014"+ ]+ , examples (datetime (2015, 10, 31, 0, 0, 0) Day)+ [ "laatste dag van oktober 2015"+ ]+ , examples (datetime (2014, 9, 22, 0, 0, 0) Week)+ [ "laatste week van september 2014"+ ]+ , examples (datetime (2013, 10, 1, 0, 0, 0) Day)+ [ "eerste dinsdag in oktober"+ ]+ , examples (datetime (2014, 9, 16, 0, 0, 0) Day)+ [ "derde dinsdag in september 2014"+ ]+ , examples (datetime (2014, 10, 1, 0, 0, 0) Day)+ [ "eerste woensdag in oktober 2014"+ ]+ , examples (datetime (2014, 10, 8, 0, 0, 0) Day)+ [ "tweede woensdag in oktober 2014"+ ]+ , examples (datetime (2015, 1, 13, 0, 0, 0) Day)+ [ "derde dinsdag na kerst 2014"+ ]+ , examples (datetime (2013, 2, 12, 4, 0, 0) Hour)+ [ "4 uur in de morgen"+ , "4 uur in de nacht"+ , "4 uur in de ochtend"+ , "4 uur 's ochtends"+ ]+ , examples (datetime (2013, 2, 12, 15, 0, 0) Hour)+ [ "3 uur"+ , "om drie uur"+ ]+ , examples (datetime (2013, 2, 12, 3, 18, 0) Minute)+ [ "3:18 in de ochtend"+ , "3:18 's morgens"+ ]+ , examples (datetime (2013, 2, 13, 3, 18, 0) Minute)+ [ "3:18"+ ]+ , examples (datetime (2013, 2, 12, 15, 0, 0) Hour)+ [ "drie uur 's middags"+ , "15 uur"+ , "om drie uur"+ , "rond drie uur"+ , "rond 3 uur 's middags"+ , "om ongeveer drie uur"+ , "ca. 15h"+ , "om circa 15u"+ ]+ , examples (datetime (2013, 4, 1, 18, 0, 0) Hour)+ [ "op 01-04 tegen 18 uur"+ , "op 1 april tegen zes uur 's avonds"+ ]+ , examples (datetime (2013, 2, 13, 17, 0, 0) Hour)+ [ "stipt om 17 uur morgen"+ ]+ , examples (datetime (2013, 2, 12, 14, 15, 0) Minute)+ [ "rond kwart over 2"+ , "kwart over twee uur"+ , "14 uur 15"+ , "15 over 14"+ , "2 uur 15 's middags"+ , "14:15"+ ]+ , examples (datetime (2013, 2, 12, 15, 20, 0) Minute)+ [ "15:20"+ , "10 voor half 4"+ , "10 minuten voor half 4"+ , "3 uur 20 's middags"+ , "twintig over 3"+ ]+ , examples (datetime (2013, 2, 12, 15, 30, 0) Minute)+ [ "om half vier"+ , "15:30"+ , "half vier 's middags"+ , "half 4"+ ]+ , examples (datetime (2013, 2, 13, 3, 30, 0) Minute)+ [ "3:30"+ ]+ , examples (datetime (2013, 2, 12, 11, 45, 0) Minute)+ [ "kwart voor 12"+ , "11:45"+ , "15 minuten voor 12"+ ]+ , examples (datetime (2013, 2, 12, 20, 0, 0) Hour)+ [ "8 uur 's avonds"+ , "vanavond om 8 uur"+ ]+ , examples (datetime (2013, 2, 12, 20, 0, 0) Minute)+ [ "vandaag om 20:00"+ ]+ , examples (datetime (2013, 9, 20, 19, 30, 0) Minute)+ [ "om 19:30 op vr. 20 sept."+ ]+ , examples (datetime (2013, 2, 16, 9, 0, 0) Hour)+ [ "op zaterdag om 9 uur 's morgens"+ ]+ , examples (datetime (2014, 7, 18, 19, 0, 0) Hour)+ [ "Vrij. 18 juli 2014 7 uur 's avonds"+ ]+ , examples (datetime (2014, 7, 18, 0, 0, 0) Day)+ [ "Vr., 18 Juli 2014"+ , "Vrijdag, 18-07-14"+ , "Vrijdag, 18/07/2014"+ , "18de juli 2014"+ ]+ , examples (datetime (2013, 2, 12, 4, 30, 1) Second)+ [ "over een seconde"+ ]+ , examples (datetime (2013, 2, 12, 4, 31, 0) Second)+ [ "in een minuut"+ , "over een minuut"+ ]+ , examples (datetime (2013, 2, 12, 4, 32, 0) Second)+ [ "in 2 minuten"+ ]+ , examples (datetime (2013, 2, 12, 5, 30, 0) Second)+ [ "in 60 minuten"+ ]+ , examples (datetime (2013, 2, 12, 5, 0, 0) Second)+ [ "in 30 minuten"+ ]+ , examples (datetime (2013, 2, 12, 7, 0, 0) Second)+ [ "in 2,5 uur"+ , "in twee en een half uur"+ ]+ , examples (datetime (2013, 2, 12, 5, 30, 0) Minute)+ [ "over een uur"+ , "in een uur"+ ]+ , examples (datetime (2013, 2, 12, 6, 30, 0) Minute)+ [ "over twee uur"+ , "in een paar uur"+ ]+ , examples (datetime (2013, 2, 13, 4, 30, 0) Minute)+ [ "over 24 uur"+ ]+ , examples (datetime (2013, 2, 13, 0, 0, 0) Day)+ [ "morgen"+ ]+ , examples (datetime (2016, 2, 0, 0, 0, 0) Month)+ [ "in 3 jaar"+ ]+ , examples (datetime (2013, 2, 19, 4, 0, 0) Hour)+ [ "in 7 dagen"+ ]+ , examples (datetime (2013, 2, 19, 0, 0, 0) Day)+ [ "in 1 week"+ , "over een week"+ ]+ , examples (datetime (2013, 2, 5, 4, 0, 0) Hour)+ [ "7 dagen geleden"+ ]+ , examples (datetime (2013, 1, 29, 4, 0, 0) Hour)+ [ "14 dagen geleden"+ ]+ , examples (datetime (2013, 1, 29, 0, 0, 0) Day)+ [ "twee weken geleden"+ ]+ , examples (datetime (2013, 2, 5, 0, 0, 0) Day)+ [ "een week geleden"+ ]+ , examples (datetime (2013, 1, 22, 0, 0, 0) Day)+ [ "drie weken geleden"+ ]+ , examples (datetime (2012, 11, 12, 0, 0, 0) Day)+ [ "drie maanden geleden"+ ]+ , examples (datetime (2011, 2, 0, 0, 0, 0) Month)+ [ "twee jaar geleden"+ ]+ , examples (datetime (2013, 2, 19, 4, 0, 0) Hour)+ [ "over 7 dagen"+ ]+ , examples (datetime (2013, 12, 25, 0, 0, 0) Day)+ [ "een jaar na kerst"+ ]+ , examples (datetimeInterval ((2013, 6, 21, 0, 0, 0), (2013, 9, 24, 0, 0, 0)) Day)+ [ "deze zomer"+ ]+ , examples (datetimeInterval ((2012, 12, 21, 0, 0, 0), (2013, 3, 21, 0, 0, 0)) Day)+ [ "deze winter"+ ]+ , examples (datetime (2013, 12, 25, 0, 0, 0) Day)+ [ "kerst"+ , "kerstmis"+ ]+ , examples (datetime (2013, 12, 31, 0, 0, 0) Day)+ [ "oudjaar"+ , "oudejaarsavond"+ ]+ , examples (datetime (2014, 1, 1, 0, 0, 0) Day)+ [ "nieuwjaarsdag"+ , "nieuwjaar"+ ]+ , examples (datetime (2013, 2, 14, 0, 0, 0) Day)+ [ "Valentijnsdag"+ ]+ , examples (datetime (2013, 5, 12, 0, 0, 0) Day)+ [ "moederdag"+ , "tweede zondag in mei"+ ]+ , examples (datetime (2013, 6, 16, 0, 0, 0) Day)+ [ "vaderdag"+ , "derde zondag in juni"+ ]+ , examples (datetime (2017, 04, 27, 0, 0, 0) Day)+ [ "Koningsdag 2017"+ ]+ , examples (datetime (2013, 10, 31, 0, 0, 0) Day)+ [ "Halloween"+ ]+ , examples (datetime (2013, 11, 1, 0, 0, 0) Day)+ [ "Allerheiligen"+ ]+ , examples (datetime (2013, 12, 5, 0, 0, 0) Day)+ [ "Sinterklaas"+ , "Pakjesavond"+ , "Sinterklaasavond"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 18, 0, 0), (2013, 2, 13, 0, 0, 0)) Hour)+ [ "vanavond"+ , "deze avond"+ , "vandaag avond"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 18, 0, 0), (2013, 2, 14, 0, 0, 0)) Hour)+ [ "morgenavond"+ ]+ , examples (datetimeInterval ((2013, 2, 11, 18, 0, 0), (2013, 2, 12, 0, 0, 0)) Hour)+ [ "gisteravond"+ , "gisterenavond"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 0, 0, 0), (2013, 2, 12, 12, 0, 0)) Hour)+ [ "vanmorgen"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 13, 12, 0, 0)) Hour)+ [ "morgenochtend"+ ]+ , examples (datetimeInterval ((2013, 2, 11, 0, 0, 0), (2013, 2, 11, 12, 0, 0)) Hour)+ [ "gisterenochtend"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 18, 0, 0), (2013, 2, 14, 0, 0, 0)) Hour)+ [ "morgennacht"+ ]+ , examples (datetimeInterval ((2013, 2, 11, 18, 0, 0), (2013, 2, 12, 0, 0, 0)) Hour)+ [ "gisterennacht"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 12, 0, 0), (2013, 2, 12, 18, 0, 0)) Hour)+ [ "vanmiddag"+ , "deze namiddag"+ , "vandaag namiddag"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 12, 0, 0), (2013, 2, 13, 18, 0, 0)) Hour)+ [ "morgenmiddag"+ , "morgen 's middags"+ , "morgen namiddag"+ ]+ , examples (datetimeInterval ((2013, 2, 11, 12, 0, 0), (2013, 2, 11, 18, 0, 0)) Hour)+ [ "gisterenmiddag"+ , "gistermiddag"+ , "gisterennamiddag"+ ]+ , examples (datetimeInterval ((2013, 2, 15, 18, 0, 0), (2013, 2, 18, 0, 0, 0)) Hour)+ [ "dit weekend"+ , "komend weekend"+ ]+ , examples (datetimeInterval ((2013, 2, 15, 0, 0, 0), (2013, 2, 15, 12, 0, 0)) Hour)+ [ "15 februari 's morgens"+ , "15 februari in de morgen"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 29, 58), (2013, 2, 12, 4, 30, 0)) Second)+ [ "afgelopen 2 seconden"+ , "vorige 2 secondes"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 1), (2013, 2, 12, 4, 30, 4)) Second)+ [ "komende drie secondes"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 28, 0), (2013, 2, 12, 4, 30, 0)) Minute)+ [ "afgelopen 2 minuten"+ , "afgelopen twee minuten"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 31, 0), (2013, 2, 12, 4, 34, 0)) Minute)+ [ "komende 3 minuten"+ , "volgende drie minuten"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 5, 0, 0), (2013, 2, 12, 8, 0, 0)) Hour)+ [ "komende 3 uur"+ , "volgende 3 uur"+ ]+ , examples (datetimeInterval ((2013, 2, 10, 0, 0, 0), (2013, 2, 12, 0, 0, 0)) Day)+ [ "afgelopen 2 dagen"+ , "vorige 2 dagen"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 16, 0, 0, 0)) Day)+ [ "komende 3 dagen"+ , "komende drie dagen"+ ]+ , examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 15, 0, 0, 0)) Day)+ [ "komende paar dagen"+ ]+ , examples (datetimeInterval ((2013, 1, 28, 0, 0, 0), (2013, 2, 11, 0, 0, 0)) Week)+ [ "vorige 2 weken"+ , "afgelopen twee weken"+ ]+ , examples (datetimeInterval ((2013, 2, 18, 0, 0, 0), (2013, 3, 11, 0, 0, 0)) Week)+ [ "komende 3 weken"+ ]+ , examples (datetimeInterval ((2012, 12, 0, 0, 0, 0), (2013, 2, 0, 0, 0, 0)) Month)+ [ "vorige 2 maanden"+ , "afgelopen twee maanden"+ ]+ , examples (datetimeInterval ((2013, 3, 0, 0, 0, 0), (2013, 6, 0, 0, 0, 0)) Month)+ [ "komende 3 maanden"+ , "volgende drie maanden"+ ]+ , examples (datetimeInterval ((2011, 0, 0, 0, 0, 0), (2013, 0, 0, 0, 0, 0)) Year)+ [ "vorige 2 jaren"+ , "afgelopen twee jaar"+ ]+ , examples (datetimeInterval ((2014, 0, 0, 0, 0, 0), (2017, 0, 0, 0, 0, 0)) Year)+ [ "komende 3 jaren"+ , "volgende drie jaar"+ ]+ , examples (datetimeInterval ((2013, 7, 13, 0, 0, 0), (2013, 7, 16, 0, 0, 0)) Day)+ [ "13 - 15 juli"+ , "13 t/m 15 juli"+ , "13 - 15 juli"+ , "juli 13 - juli 15"+ , "13 tot en met 15 juli"+ ]+ , examples (datetimeInterval ((2013, 8, 8, 0, 0, 0), (2013, 8, 13, 0, 0, 0)) Day)+ [ "aug 8 - aug 12"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 9, 30, 0), (2013, 2, 12, 11, 1, 0)) Minute)+ [ "9:30 - 11:00"+ ]+ , examples (datetimeInterval ((2013, 2, 14, 9, 30, 0), (2013, 2, 14, 11, 1, 0)) Minute)+ [ "op donderdag om 9:30 - 11:00"+ , "op donderdag tussen 9:30 en 11:00"+ , "donderdag 9:30 - 11:00"+ , "op donderdag na 9:30 maar voor 11:00"+ , "donderdag van 9:30 tot 11:00"+ ]+ , examples (datetimeInterval ((2013, 2, 14, 9, 0, 0), (2013, 2, 14, 12, 0, 0)) Hour)+ [ "donderdag ochtend van 9 tot 11"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 11, 30, 0), (2013, 2, 12, 13, 31, 0)) Minute)+ [ "11:30-13:30"+ ]+ , examples (datetime (2013, 9, 21, 1, 30, 0) Minute)+ [ "1:30 am Za. 21 sept"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 4, 30, 0), (2013, 2, 26, 0, 0, 0)) Second)+ [ "binnen 2 weken"+ ]+ , examples (datetimeOpenInterval Before (2013, 2, 12, 14, 0, 0) Hour)+ [ "tot 2 uur 's middags"+ ]+ , examples (datetimeOpenInterval Before (2013, 3, 1, 0, 0, 0) Month)+ [ "tot het einde van de maand"+ ]+ , examples (datetime (2013, 2, 12, 13, 0, 0) Minute)+ [ "16 uur CET"+ ]+ , examples (datetime (2013, 2, 14, 6, 0, 0) Minute)+ [ "donderdag 8:00 GMT"+ , "donderdag 8:00 gmt"+ ]+ , examples (datetime (2013, 2, 12, 14, 0, 0) Hour)+ [ "vandaag om 14 uur"+ , "om 2 uur"+ ]+ , examples (datetime (2013, 2, 13, 15, 0, 0) Hour)+ [ "morgen om 15 uur"+ ]+ , examples (datetimeOpenInterval After (2013, 2, 12, 14, 0, 0) Hour)+ [ "vanaf 14u"+ , "op zijn vroegst om 14 uur"+ , "twee uur op zijn vroegst"+ ]+ , examples (datetimeOpenInterval Before (2013, 2, 12, 11, 0, 0) Hour)+ [ "tot 11 uur"+ , "tot 11h 's morgens"+ , "tot 11 am in de ochtend"+ , "op zijn laatst om 11 uur"+ , "11 uur op zijn laatst"+ ]+ , examples (datetime (2013, 2, 12, 13, 30, 0) Minute)+ [ "om 13:30 in de middag"+ , "vanmiddag om 1 uur 30"+ , "13:30"+ ]+ , examples (datetime (2013, 2, 12, 4, 45, 0) Second)+ [ "in 15 minuten"+ , "over een kwartier"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 13, 0, 0), (2013, 2, 12, 17, 0, 0)) Hour)+ [ "na de lunch"+ ]+ , examples (datetime (2013, 2, 12, 10, 30, 0) Minute)+ [ "10:30"+ ]+ , examples (datetime (2013, 2, 18, 0, 0, 0) Day)+ [ "komende maandag"+ , "aanstaande maandag"+ ]+ , examples (datetime (2013, 12, 10, 0, 0, 0) Day)+ [ "10-12"+ ]+ , examples (datetimeInterval ((2013, 2, 12, 18, 30, 0), (2013, 2, 12, 19, 1, 0)) Minute)+ [ "18:30u - 19:00u"+ , "18:30h tot 19:00h"+ ]+ , examples (datetimeInterval ((2013, 10, 14, 0, 0, 0), (2013, 10, 16, 0, 0, 0)) Day)+ [ "14/10 - 15/10"+ , "van 14/10/2013 tot 15/10/2013"+ ]+ , examples (datetimeInterval ((2018, 10, 14, 0, 0, 0), (2018, 10, 16, 0, 0, 0)) Day)+ [ "14 t/m 15 oktober 2018"+ ]+ , examples (datetime (2013, 10, 10, 0, 0, 0) Day)+ [ "op 10-10"+ , "op 10.10"+ , "10/10"+ ]+ , examples (datetime (2013, 2, 12, 10, 10, 0) Minute)+ [ "om 10:10"+ , "op 10:10"+ ]+ , examples (datetime (2013, 2, 12, 17, 10, 0) Minute)+ [ "17h10"+ , "17u10"+ ]+ ]
+ Duckling/Time/NL/Rules.hs view
@@ -0,0 +1,1611 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Time.NL.Rules+ ( rules+ ) where++import Data.Text (Text)+import Prelude+import qualified Data.Text as Text++import Duckling.Dimensions.Types+import Duckling.Duration.Helpers (duration)+import Duckling.Numeral.Helpers (parseInt)+import Duckling.Numeral.Types (NumeralData (..))+import Duckling.Ordinal.Types (OrdinalData (..))+import Duckling.Regex.Types+import Duckling.Time.Helpers+import Duckling.Time.Types (TimeData (..))+import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral+import qualified Duckling.Ordinal.Types as TOrdinal+import qualified Duckling.Time.Types as TTime+import qualified Duckling.TimeGrain.Types as TG++ruleInstants :: [Rule]+ruleInstants = mkRuleInstants+ [ ( "now" , TG.Second, 0, "meteen|nu|direct|zojuist" )+ , ( "today" , TG.Day , 0, "vandaag|op deze dag" )+ , ( "tomorrow" , TG.Day , 1, "morgen" )+ , ( "yesterday" , TG.Day , -1, "gisteren" )+ , ( "after tomorrow" , TG.Day , 2, "overmorgen" )+ , ( "before yesterday", TG.Day , -2, "eergisteren" )+ , ( "EOM|End of month", TG.Month , 1, "(het )?einde? van de maand" )+ , ( "EOY|End of year" , TG.Year , 1, "(het )? einde? van het jaar" )+ ]++ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek+ [ ( "monday" , "maandags?|ma\\." )+ , ( "tuesday" , "dinsdags?|di\\." )+ , ( "wednesday" , "woensdags?|woe\\." )+ , ( "thursday" , "donderdags?|do\\." )+ , ( "friday" , "vrijdags?|vr(ij)?\\." )+ , ( "saturday" , "zaterdags?|zat?\\." )+ , ( "sunday" , "zondags?|zon?\\." )+ ]++ruleMonths :: [Rule]+ruleMonths = mkRuleMonths+ [ ( "January" , "januari|jan\\.?" )+ , ( "February" , "februari|feb\\.?" )+ , ( "March" , "maart|mar\\.?" )+ , ( "April" , "april|apr\\.?" )+ , ( "May" , "mei\\.?" )+ , ( "June" , "juni?\\.?" )+ , ( "July" , "juli?\\.?" )+ , ( "August" , "augustus|aug\\.?" )+ , ( "September", "september|sept?\\.?" )+ , ( "October" , "oktober|okt\\.?" )+ , ( "November" , "november|nov\\.?" )+ , ( "December" , "december|dec\\.?" )+ ]++ruleSeasons :: [Rule]+ruleSeasons = mkRuleSeasons+ [ ( "summer" , "zomer" , monthDay 6 21, monthDay 9 23 )+ , ( "fall" , "herfst|najaar" , monthDay 9 23, monthDay 12 21 )+ , ( "winter" , "winter" , monthDay 12 21, monthDay 3 20 )+ , ( "spring" , "lente|voorjaar" , monthDay 3 20, monthDay 6 21 )+ ]++ruleHolidays :: [Rule]+ruleHolidays = mkRuleHolidays+ [ ( "new year's day" , "nieuwjaars?(dag)?"+ , monthDay 1 1 )+ , ( "valentine's day" , "valentijns?(dag)?"+ , monthDay 2 14 )+ , ( "halloween day" , "hall?oween?"+ , monthDay 10 31 )+ , ( "Dutch King day" , "konings?dag"+ , monthDay 4 27 )+ , ( "Allerheiligen" , "allerheiligen?|aller heiligen?"+ , monthDay 11 1 )+ , ( "Sinterklaas" , "sinterklaas(avond)?|pakjesavond"+ , monthDay 12 5 )+ , ( "christmas eve" , "kerstavond"+ , monthDay 12 24 )+ , ( "boxing day christmas", "tweede kerstdag"+ , monthDay 12 26 )+ , ( "christmas" , "kerstmis|(eerste )?kerstdag|kerst"+ , monthDay 12 25 )+ , ( "new year's eve" , "oudjaar|oudejaars?avond"+ , monthDay 12 31 )+ , ( "Mother's Day" , "moederdag"+ , nthDOWOfMonth 2 7 5 )+ , ( "Father's Day" , "vaderdag"+ , nthDOWOfMonth 3 7 6 )+ ]++ruleRelativeMinutesToOrAfterIntegerPartOfDay :: Rule+ruleRelativeMinutesToOrAfterIntegerPartOfDay = Rule+ { name = "relative minutes to|till|before|after <integer> (time-of-day)"+ , pattern =+ [ Predicate $ isIntegerBetween 1 59+ , regex "(voor|over|na)"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Numeral NumeralData{TNumeral.value = v}:+ Token RegexMatch (GroupMatch (match:_)):+ Token Time td:+ _) -> case Text.toLower match of+ "voor" -> tt $ durationBefore (duration TG.Minute $ floor v) td+ _ -> tt $ durationAfter (duration TG.Minute $ floor v) td+ _ -> Nothing+ }++ruleQuarterTotillbeforeIntegerHourofday :: Rule+ruleQuarterTotillbeforeIntegerHourofday = Rule+ { name = "quarter to|till|before <integer> (hour-of-day)"+ , pattern =+ [ regex "kwart(ier)? voor"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$> minutesBefore 15 td+ _ -> Nothing+ }++ruleHalfTotillbeforeIntegerHourofday :: Rule+ruleHalfTotillbeforeIntegerHourofday = Rule+ { name = "half to|till|before <integer> (hour-of-day)"+ , pattern =+ [ regex "half"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$> minutesBefore 30 td+ _ -> Nothing+ }++ruleTheOrdinalCycleOfTime :: Rule+ruleTheOrdinalCycleOfTime = Rule+ { name = "the <ordinal> <cycle> of <time>"+ , pattern =+ [ regex "de|het"+ , dimension Ordinal+ , dimension TimeGrain+ , regex "van|in"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleNthTimeOfTime2 :: Rule+ruleNthTimeOfTime2 = Rule+ { name = "nth <time> of <time>"+ , pattern =+ [ regex "de|het"+ , dimension Ordinal+ , dimension Time+ , regex "in"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> Token Time . predNth (v - 1) False <$> intersect td2 td1+ _ -> Nothing+ }++ruleLastTime :: Rule+ruleLastTime = Rule+ { name = "last <time>"+ , pattern =+ [ regex "afgelopen|vorige?"+ , Predicate isOkWithThisNext+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth (-1) False td+ _ -> Nothing+ }++ruleDatetimeDatetimeInterval :: Rule+ruleDatetimeDatetimeInterval = Rule+ { name = "<datetime> - <datetime> (interval)"+ , pattern =+ [ Predicate isNotLatent+ , regex "\\-|t\\/m|tot en met"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleEvening :: Rule+ruleEvening = Rule+ { name = "evening"+ , pattern =+ [ regex "\\'s avonds|avond"+ ]+ , prod = \_ ->+ let from = hour False 18+ to = hour False 0+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++-- TODO: Single-word composition (#110)+ruleEvenings :: Rule+ruleEvenings = Rule+ { name = "today/tomorrow/yesterday evening"+ , pattern =+ [ regex "(van|morgen|gister(en)?)avond"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ td1 <- case Text.toLower match of+ "van" -> Just $ cycleNth TG.Day 0+ "morgen" -> Just $ cycleNth TG.Day 1+ _ -> Just $ cycleNth TG.Day $ - 1+ td2 <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay <$> intersect td1 td2+ _ -> Nothing+ }++ruleTheDayofmonthNonOrdinal :: Rule+ruleTheDayofmonthNonOrdinal = Rule+ { name = "the <day-of-month> (non ordinal)"+ , pattern =+ [ regex "de"+ , Predicate $ isIntegerBetween 1 31+ ]+ , prod = \tokens -> case tokens of+ (_:token:_) -> do+ v <- getIntValue token+ tt $ dayOfMonth v+ _ -> Nothing+ }++ruleInDuration :: Rule+ruleInDuration = Rule+ { name = "in <duration>"+ , pattern =+ [ regex "in|over"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleLastCycleOfTime :: Rule+ruleLastCycleOfTime = Rule+ { name = "last <cycle> of <time>"+ , pattern =+ [ regex "laatste|vorige|afgelopen"+ , dimension TimeGrain+ , regex "van|in"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleLastOf grain td+ _ -> Nothing+ }++ruleFromDatetimeDatetimeInterval :: Rule+ruleFromDatetimeDatetimeInterval = Rule+ { name = "from <datetime> - <datetime> (interval)"+ , pattern =+ [ regex "van"+ , dimension Time+ , regex "\\-|tot"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleQuarterAfterpastIntegerHourofday :: Rule+ruleQuarterAfterpastIntegerHourofday = Rule+ { name = "quarter after|past <integer> (hour-of-day)"+ , pattern =+ [ regex "kwart(ier)? over"+ , Predicate isAnHourOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Time TimeData+ {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:+ _) -> tt $ hourMinute is12H hours 15+ _ -> Nothing+ }++ruleMonthDdddInterval :: Rule+ruleMonthDdddInterval = Rule+ { name = "<month> dd-dd (interval)"+ , pattern =+ [ regex "([012]?\\d|30|31)(ste|de)?"+ , regex "\\-|tot en met|t\\/m"+ , regex "([012]?\\d|30|31)(ste|de)?"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:_)):+ _:+ Token RegexMatch (GroupMatch (m2:_)):+ Token Time td:+ _) -> do+ v1 <- parseInt m1+ v2 <- parseInt m2+ from <- intersect (dayOfMonth v1) td+ to <- intersect (dayOfMonth v2) td+ Token Time <$> interval TTime.Closed from to+ _ -> Nothing+ }++ruleTheCycleAfterTime :: Rule+ruleTheCycleAfterTime = Rule+ { name = "the <cycle> after <time>"+ , pattern =+ [ regex "de|het"+ , dimension TimeGrain+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter False grain 1 td+ _ -> Nothing+ }++ruleTheCycleBeforeTime :: Rule+ruleTheCycleBeforeTime = Rule+ { name = "the <cycle> before <time>"+ , pattern =+ [ regex "de"+ , dimension TimeGrain+ , regex "voor"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter False grain (-1) td+ _ -> Nothing+ }++ruleYearLatent2 :: Rule+ruleYearLatent2 = Rule+ { name = "year (latent)"+ , pattern =+ [ Predicate $ isIntegerBetween 2101 10000+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ v <- getIntValue token+ tt . mkLatent $ year v+ _ -> Nothing+ }++ruleTimeAfterNext :: Rule+ruleTimeAfterNext = Rule+ { name = "<time> after next"+ , pattern =+ [ dimension Time+ , regex "navolgend"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) ->+ tt $ predNth 1 True td+ _ -> Nothing+ }++ruleThisnextDayofweek :: Rule+ruleThisnextDayofweek = Rule+ { name = "this|next <day-of-week>"+ , pattern =+ [ regex "aanstaande|komende|volgende"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleBetweenTimeofdayAndTimeofdayInterval :: Rule+ruleBetweenTimeofdayAndTimeofdayInterval = Rule+ { name = "between <time-of-day> and <time-of-day> (interval)"+ , pattern =+ [ regex "tussen"+ , Predicate isATimeOfDay+ , regex "en"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleNextCycle :: Rule+ruleNextCycle = Rule+ { name = "next <cycle>"+ , pattern =+ [ regex "aanstaande|komende?|volgende?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt $ cycleNth grain 1+ _ -> Nothing+ }++ruleTimeofdayApproximately :: Rule+ruleTimeofdayApproximately = Rule+ { name = "<time-of-day> approximately"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "ongeveer"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleOnDate :: Rule+ruleOnDate = Rule+ { name = "on <date>"+ , pattern =+ [ regex "op( de)?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:x:_) -> Just x+ _ -> Nothing+ }++ruleDurationFromNow :: Rule+ruleDurationFromNow = Rule+ { name = "<duration> from now"+ , pattern =+ [ dimension Duration+ , regex "vanaf (vandaag|nu)"+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleLunch :: Rule+ruleLunch = Rule+ { name = "lunch"+ , pattern =+ [ regex "(am |zu )?mittags?"+ ]+ , prod = \_ ->+ let from = hour False 12+ to = hour False 14+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++ruleLastCycle :: Rule+ruleLastCycle = Rule+ { name = "last <cycle>"+ , pattern =+ [ regex "vorige?|afgelopen"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt . cycleNth grain $ - 1+ _ -> Nothing+ }++ruleAfternoon :: Rule+ruleAfternoon = Rule+ { name = "afternoon"+ , pattern =+ [ regex "('s )?middags?|(in de )?middag|namiddag"+ ]+ , prod = \_ ->+ let from = hour False 12+ to = hour False 18+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++-- TODO: Single-word composition (#110)+ruleAfternoons :: Rule+ruleAfternoons = Rule+ { name = "today/tomorrow/yesterday afternoon"+ , pattern =+ [ regex "(vanmiddag|morgenmiddags?|gistermiddag|gisteren(na)?middag)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ td1 <- case Text.toLower match of+ "vanmiddag" -> Just $ cycleNth TG.Day 0+ "morgenmiddag" -> Just $ cycleNth TG.Day 1+ "morgenmiddags" -> Just $ cycleNth TG.Day 1+ _ -> Just . cycleNth TG.Day $ - 1+ td2 <- interval TTime.Open (hour False 12) (hour False 18)+ Token Time . partOfDay <$> intersect td1 td2+ _ -> Nothing+ }++ruleNamedmonthDayofmonthOrdinal :: Rule+ruleNamedmonthDayofmonthOrdinal = Rule+ { name = "<day-of-month> (ordinal) <named-month>"+ , pattern =+ [ Predicate isDOMOrdinal+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleInduringThePartofday :: Rule+ruleInduringThePartofday = Rule+ { name = "in|during the <part-of-day>"+ , pattern =+ [ regex "(tijdens|gedurende?)( de)?"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleHourofdayIntegerAsRelativeMinutes :: Rule+ruleHourofdayIntegerAsRelativeMinutes = Rule+ { name = "<hour-of-day> <integer> (as relative minutes)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isAnHourOfDay]+ , Predicate $ isIntegerBetween 1 59+ ]+ , prod = \tokens -> case tokens of+ (Token Time TimeData+ {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:+ token:+ _) -> do+ n <- getIntValue token+ tt $ hourMinute is12H hours n+ _ -> Nothing+ }++ruleDayofmonthordinalNamedmonth :: Rule+ruleDayofmonthordinalNamedmonth = Rule+ { name = "<day-of-month>(ordinal) <named-month>"+ , pattern =+ [ Predicate isDOMOrdinal+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token:Token Time td:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleIntersectBy :: Rule+ruleIntersectBy = Rule+ { name = "intersect by ','"+ , pattern =+ [ Predicate isNotLatent+ , regex ",( den|r)?"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleNthTimeAfterTime :: Rule+ruleNthTimeAfterTime = Rule+ { name = "nth <time> after <time>"+ , pattern =+ [ dimension Ordinal+ , dimension Time+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> tt $ predNthAfter (v - 1) td1 td2+ _ -> Nothing+ }++ruleMmdd :: Rule+ruleMmdd = Rule+ { name = "dd/mm"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])\\s?[/.-]\\s?(1[0-2]|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do+ d <- parseInt m1+ m <- parseInt m2+ tt $ monthDay m d+ _ -> Nothing+ }++ruleAfterDuration :: Rule+ruleAfterDuration = Rule+ { name = "after <duration>"+ , pattern =+ [ regex "over|na"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) ->+ tt $ inDuration dd+ _ -> Nothing+ }++ruleTimeofdayLatent :: Rule+ruleTimeofdayLatent = Rule+ { name = "time-of-day (latent)"+ , pattern =+ [ Predicate $ isIntegerBetween 0 23+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ n <- getIntValue token+ tt . mkLatent $ hour (n < 12) n+ _ -> Nothing+ }++ruleFromTimeofdayTimeofdayInterval :: Rule+ruleFromTimeofdayTimeofdayInterval = Rule+ { name = "from <time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ regex "(van|vanaf|na|vroegst om|om)"+ , Predicate isATimeOfDay+ , regex "((maar)? voor)|\\-|tot"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleExactlyTimeofday :: Rule+ruleExactlyTimeofday = Rule+ { name = "exactly <time-of-day>"+ , pattern =+ [ regex "(stipt|exact|precies)( om)?"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleBetweenDatetimeAndDatetimeInterval :: Rule+ruleBetweenDatetimeAndDatetimeInterval = Rule+ { name = "between <datetime> and <datetime> (interval)"+ , pattern =+ [ regex "tussen"+ , dimension Time+ , regex "en"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleDurationHenceAgo :: Rule+ruleDurationHenceAgo = Rule+ { name = "<duration> hence|ago"+ , pattern =+ [ dimension Duration+ , regex "(later|geleden)"+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> case Text.toLower match of+ "geleden" -> tt $ durationAgo dd+ _ -> tt $ inDuration dd+ _ -> Nothing+ }++ruleByTheEndOfTime :: Rule+ruleByTheEndOfTime = Rule+ { name = "by the end of <time>"+ , pattern =+ [ regex "tot (het)? einde (van)?|voor"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time <$>+ interval TTime.Closed td (cycleNth TG.Second 0)+ _ -> Nothing+ }++ruleAfterWork :: Rule+ruleAfterWork = Rule+ { name = "after work"+ , pattern =+ [ regex "na het werk"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day 0+ td2 <- interval TTime.Open (hour False 17) (hour False 21)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleLastNCycle :: Rule+ruleLastNCycle = Rule+ { name = "last n <cycle>"+ , pattern =+ [ regex "laatste|afgelopen|vorige?"+ , Predicate $ isIntegerBetween 1 9999+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:token:Token TimeGrain grain:_) -> do+ n <- getIntValue token+ tt $ cycleN True grain (- n)+ _ -> Nothing+ }++ruleTimeofdaySharp :: Rule+ruleTimeofdaySharp = Rule+ { name = "<time-of-day> sharp"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "genau|exakt|p(ü)nktlich|punkt( um)?"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleWithinDuration :: Rule+ruleWithinDuration = Rule+ { name = "within <duration>"+ , pattern =+ [ regex "binnen|innerhalb( von)?"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> Token Time <$>+ interval TTime.Open (cycleNth TG.Second 0) (inDuration dd)+ _ -> Nothing+ }++ruleMidnighteodendOfDay :: Rule+ruleMidnighteodendOfDay = Rule+ { name = "midnight|EOD|end of day"+ , pattern =+ [ regex "middernacht|EOD|einde? van de dag"+ ]+ , prod = \_ -> tt $ hour False 0+ }++ruleDayofmonthNonOrdinalNamedmonth :: Rule+ruleDayofmonthNonOrdinalNamedmonth = Rule+ { name = "<day-of-month> (non ordinal) <named-month>"+ , pattern =+ [ Predicate isDOMInteger+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token:Token Time td:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleIntersect :: Rule+ruleIntersect = Rule+ { name = "intersect"+ , pattern =+ [ Predicate isNotLatent+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleAboutTimeofday :: Rule+ruleAboutTimeofday = Rule+ { name = "about <time-of-day>"+ , pattern =+ [ regex "ongeveer|circa|ca\\.|tegen|rond"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleUntilTimeofday :: Rule+ruleUntilTimeofday = Rule+ { name = "until <time-of-day>"+ , pattern =+ [ regex "voor|tot|op zijn laatst om"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.Before td+ _ -> Nothing+ }++ruleUntilTimeofdayPostfix :: Rule+ruleUntilTimeofdayPostfix = Rule+ { name = "<time-of-day> until"+ , pattern =+ [ dimension Time+ , regex "op zijn laatst"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_:_) -> tt $ withDirection TTime.Before td+ _ -> Nothing+ }++ruleAtTimeofday :: Rule+ruleAtTimeofday = Rule+ { name = "at <time-of-day>"+ , pattern =+ [ regex "om|@"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleNthTimeOfTime :: Rule+ruleNthTimeOfTime = Rule+ { name = "nth <time> of <time>"+ , pattern =+ [ dimension Ordinal+ , dimension Time+ , regex "in|van"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> Token Time . predNth (v - 1) False <$> intersect td2 td1+ _ -> Nothing+ }++ruleTimePartofday :: Rule+ruleTimePartofday = Rule+ { name = "<time> <part-of-day>"+ , pattern =+ [ dimension Time+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleWeekend :: Rule+ruleWeekend = Rule+ { name = "week-end"+ , pattern =+ [ regex "week(\\s|-)?ei?nde?"+ ]+ , prod = \_ -> tt $ mkOkForThisNext weekend+ }++ruleNthTimeAfterTime2 :: Rule+ruleNthTimeAfterTime2 = Rule+ { name = "nth <time> after <time>"+ , pattern =+ [ regex "de|het"+ , dimension Ordinal+ , dimension Time+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:+ Token Ordinal OrdinalData{TOrdinal.value = v}:+ Token Time td1:+ _:+ Token Time td2:+ _) -> tt $ predNthAfter (v - 1) td1 td2+ _ -> Nothing+ }++ruleNextTime :: Rule+ruleNextTime = Rule+ { name = "next <time>"+ , pattern =+ [ regex "(volgende?|komende?)"+ , Predicate $ and . sequence [isOkWithThisNext, not . isATimeOfDay]+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 True td+ _ -> Nothing+ }++ruleOrdinalQuarterYear :: Rule+ruleOrdinalQuarterYear = Rule+ { name = "<ordinal> quarter <year>"+ , pattern =+ [ dimension Ordinal+ , Predicate $ isGrain TG.Quarter+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:_:Token Time td:_) ->+ tt $ cycleNthAfter False TG.Quarter (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleYyyymmdd :: Rule+ruleYyyymmdd = Rule+ { name = "yyyy-mm-dd"+ , pattern =+ [ regex "(\\d{2,4})[.-](1[0-2]|0?[1-9])[.-](3[01]|[12]\\d|0?[1-9])"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:m3:_)):_) -> do+ y <- parseInt m1+ m <- parseInt m2+ d <- parseInt m3+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleTheOrdinalCycleAfterTime :: Rule+ruleTheOrdinalCycleAfterTime = Rule+ { name = "the <ordinal> <cycle> after <time>"+ , pattern =+ [ regex "de|het"+ , dimension Ordinal+ , dimension TimeGrain+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleIntersectByOfFromS :: Rule+ruleIntersectByOfFromS = Rule+ { name = "intersect by 'of', 'from', 's"+ , pattern =+ [ Predicate isNotLatent+ , regex "von|der|im"+ , Predicate isNotLatent+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleNextNCycle :: Rule+ruleNextNCycle = Rule+ { name = "next n <cycle>"+ , pattern =+ [ regex "(volgende?|komende?)"+ , Predicate $ isIntegerBetween 1 9999+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:token:Token TimeGrain grain:_) -> do+ v <- getIntValue token+ tt $ cycleN True grain v+ _ -> Nothing+ }++ruleADuration :: Rule+ruleADuration = Rule+ { name = "a <duration>"+ , pattern =+ [ regex "(in )?eine?(r|n)?"+ , dimension Duration+ ]+ , prod = \tokens -> case tokens of+ (_:Token Duration dd:_) -> tt $ inDuration dd+ _ -> Nothing+ }++ruleMorning :: Rule+ruleMorning = Rule+ { name = "morning"+ , pattern =+ [ regex "(in de )?morgen( van)?|(in de )?ochtend|\\'s ochtends|\\'s morgens"+ ]+ , prod = \_ ->+ let from = hour False 0+ to = hour False 12+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++-- TODO: Single-word composition (#110)+ruleMornings :: Rule+ruleMornings = Rule+ { name = "today/tomorrow/yesterday morning"+ , pattern =+ [ regex "(vanmorgen|morgenochtend|gisterenochtend)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ td1 <- case Text.toLower match of+ "vanmorgen" -> Just $ cycleNth TG.Day 0+ "morgenochtend" -> Just $ cycleNth TG.Day 1+ _ -> Just . cycleNth TG.Day $ - 1+ td2 <- interval TTime.Open (hour False 0) (hour False 12)+ Token Time . partOfDay <$> intersect td1 td2+ _ -> Nothing+ }++ruleThisPartofday :: Rule+ruleThisPartofday = Rule+ { name = "this <part-of-day>"+ , pattern =+ [ regex "deze|dit"+ , Predicate isAPartOfDay+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> Token Time . partOfDay <$>+ intersect (cycleNth TG.Day 0) td+ _ -> Nothing+ }++ruleThisCycle :: Rule+ruleThisCycle = Rule+ { name = "this <cycle>"+ , pattern =+ [ regex "dit|deze|komende?"+ , dimension TimeGrain+ ]+ , prod = \tokens -> case tokens of+ (_:Token TimeGrain grain:_) -> tt $ cycleNth grain 0+ _ -> Nothing+ }++ruleThisTime :: Rule+ruleThisTime = Rule+ { name = "this <time>"+ , pattern =+ [ regex "dit|deze|huidige?"+ , Predicate isOkWithThisNext+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ predNth 0 False td+ _ -> Nothing+ }++ruleDayofmonthNonOrdinalOfNamedmonth :: Rule+ruleDayofmonthNonOrdinalOfNamedmonth = Rule+ { name = "<day-of-month> (non ordinal) of <named-month>"+ , pattern =+ [ Predicate isDOMInteger+ , regex "van"+ , Predicate isAMonth+ ]+ , prod = \tokens -> case tokens of+ (token:_:Token Time td:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleAfterLunch :: Rule+ruleAfterLunch = Rule+ { name = "after lunch"+ , pattern =+ [ regex "na de lunch|na het middageten"+ ]+ , prod = \_ -> do+ let td1 = cycleNth TG.Day 0+ td2 <- interval TTime.Open (hour False 13) (hour False 17)+ Token Time . partOfDay <$> intersect td1 td2+ }++ruleOnANamedday :: Rule+ruleOnANamedday = Rule+ { name = "on a named-day"+ , pattern =+ [ regex "op( een)?"+ , Predicate isADayOfWeek+ ]+ , prod = \tokens -> case tokens of+ (_:x:_) -> Just x+ _ -> Nothing+ }++ruleYearLatent :: Rule+ruleYearLatent = Rule+ { name = "year (latent)"+ , pattern =+ [ Predicate $+ or . sequence [isIntegerBetween (- 10000) 0, isIntegerBetween 25 999]+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ y <- getIntValue token+ tt . mkLatent $ year y+ _ -> Nothing+ }++ruleAfterTimeofday :: Rule+ruleAfterTimeofday = Rule+ { name = "after <time-of-day>"+ , pattern =+ [ regex "na|vanaf|op zijn vroegst"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) -> tt $ withDirection TTime.After td+ _ -> Nothing+ }++ruleAfterTimeofdayPostfix :: Rule+ruleAfterTimeofdayPostfix = Rule+ { name = "<time-of-day> after"+ , pattern =+ [ dimension Time+ , regex "op zijn vroegst"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_:_) -> tt $ withDirection TTime.After td+ _ -> Nothing+ }++ruleNight :: Rule+ruleNight = Rule+ { name = "night"+ , pattern =+ [ regex "(\\'s nachts|(in de )?nacht)"+ ]+ , prod = \_ ->+ let from = hour False 20+ to = hour False 8+ in Token Time . mkLatent . partOfDay <$>+ interval TTime.Open from to+ }++-- TODO: Single-word composition (#110)+ruleNights :: Rule+ruleNights = Rule+ { name = "yesterday/tomorrow night"+ , pattern =+ [ regex "(morgen|gisteren)nacht"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (match:_)):_) -> do+ td1 <- case Text.toLower match of+ "morgen" -> Just $ cycleNth TG.Day 1+ _ -> Just . cycleNth TG.Day $ - 1+ td2 <- interval TTime.Open (hour False 18) (hour False 0)+ Token Time . partOfDay <$> intersect td1 td2+ _ -> Nothing+ }++ruleDayofmonthOrdinal :: Rule+ruleDayofmonthOrdinal = Rule+ { name = "<day-of-month> (ordinal)"+ , pattern =+ [ Predicate isDOMOrdinal+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) ->+ tt $ dayOfMonth v+ _ -> Nothing+ }++ruleTimeofdayAmpm :: Rule+ruleTimeofdayAmpm = Rule+ { name = "<time-of-day> am|pm"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "([ap])\\.?m\\.?(?:[\\s'\"-_{}\\[\\]()]|$)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td+ _ -> Nothing+ }++ruleOrdinalCycleAfterTime :: Rule+ruleOrdinalCycleAfterTime = Rule+ { name = "<ordinal> <cycle> after <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleOrdinalCycleOfTime :: Rule+ruleOrdinalCycleOfTime = Rule+ { name = "<ordinal> <cycle> of <time>"+ , pattern =+ [ dimension Ordinal+ , dimension TimeGrain+ , regex "in|van"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) ->+ tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td+ _ -> Nothing+ }++ruleAfterNextTime :: Rule+ruleAfterNextTime = Rule+ { name = "after next <time>"+ , pattern =+ [ regex "(ü)ber ?n(ä)chste[ns]?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td:_) ->+ tt $ predNth 1 True td+ _ -> Nothing+ }++ruleHhmm :: Rule+ruleHhmm = Rule+ { name = "hh:mm"+ , pattern = [ regex "((?:[01]?\\d)|(?:2[0-3]))[:hu]([0-5]\\d)(?:uur|u|h)?" ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do+ h <- parseInt m1+ m <- parseInt m2+ tt $ hourMinute False h m+ _ -> Nothing+ }++ruleYear :: Rule+ruleYear = Rule+ { name = "year"+ , pattern =+ [ Predicate $ isIntegerBetween 1000 2100+ ]+ , prod = \tokens -> case tokens of+ (token:_) -> do+ y <- getIntValue token+ tt $ year y+ _ -> Nothing+ }++ruleNamedmonthDayofmonthNonOrdinal :: Rule+ruleNamedmonthDayofmonthNonOrdinal = Rule+ { name = "<named-month> <day-of-month> (non ordinal)"+ , pattern =+ [ Predicate isAMonth+ , Predicate isDOMInteger+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:token:_) -> Token Time <$> intersectDOM td token+ _ -> Nothing+ }++ruleHhmmMilitary :: Rule+ruleHhmmMilitary = Rule+ { name = "hhmm (military)"+ , pattern =+ [ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (h:m:_)):_) -> do+ hh <- parseInt h+ mm <- parseInt m+ tt . mkLatent $ hourMinute False hh mm+ _ -> Nothing+ }++ruleAbsorptionOfAfterNamedDay :: Rule+ruleAbsorptionOfAfterNamedDay = Rule+ { name = "absorption of , after named day"+ , pattern =+ [ Predicate isADayOfWeek+ , regex ","+ ]+ , prod = \tokens -> case tokens of+ (x:_) -> Just x+ _ -> Nothing+ }++ruleLastDayofweekOfTime :: Rule+ruleLastDayofweekOfTime = Rule+ { name = "last <day-of-week> of <time>"+ , pattern =+ [ regex "laatste"+ , Predicate isADayOfWeek+ , regex "in|van"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (_:Token Time td1:_:Token Time td2:_) -> tt $ predLastOf td1 td2+ _ -> Nothing+ }++ruleHhmmMilitaryAmpm :: Rule+ruleHhmmMilitaryAmpm = Rule+ { name = "hhmm (military) am|pm"+ , pattern =+ [ regex "((?:1[012]|0?\\d))([0-5]\\d)"+ , regex "([ap])\\.?m\\.?(?:[\\s'\"-_{}\\[\\]()]|$)"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (hh:mm:_)):Token RegexMatch (GroupMatch (ap:_)):_) -> do+ h <- parseInt hh+ m <- parseInt mm+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m+ _ -> Nothing+ }++ruleTimeofdayTimeofdayInterval :: Rule+ruleTimeofdayTimeofdayInterval = Rule+ { name = "<time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\-|tot"+ , Predicate isATimeOfDay+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleTimeofdayTimeofdayInterval2 :: Rule+ruleTimeofdayTimeofdayInterval2 = Rule+ { name = "<time-of-day> - <time-of-day> (interval)"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "\\-|tot"+ , Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> interval TTime.Closed td1 td2+ _ -> Nothing+ }++ruleDurationAfterTime :: Rule+ruleDurationAfterTime = Rule+ { name = "<duration> after <time>"+ , pattern =+ [ dimension Duration+ , regex "na"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_:Token Time td:_) -> tt $ durationAfter dd td+ _ -> Nothing+ }++ruleOrdinalQuarter :: Rule+ruleOrdinalQuarter = Rule+ { name = "<ordinal> quarter"+ , pattern =+ [ dimension Ordinal+ , Predicate $ isGrain TG.Quarter+ ]+ , prod = \tokens -> case tokens of+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt .+ cycleNthAfter False TG.Quarter (v - 1) $ cycleNth TG.Year 0+ _ -> Nothing+ }++ruleTheDayofmonthOrdinal :: Rule+ruleTheDayofmonthOrdinal = Rule+ { name = "the <day-of-month> (ordinal)"+ , pattern =+ [ regex "der"+ , Predicate isDOMOrdinal+ ]+ , prod = \tokens -> case tokens of+ (_:Token Ordinal OrdinalData{TOrdinal.value = v}:_) ->+ tt $ dayOfMonth v+ _ -> Nothing+ }++ruleDurationBeforeTime :: Rule+ruleDurationBeforeTime = Rule+ { name = "<duration> before <time>"+ , pattern =+ [ dimension Duration+ , regex "voor"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Duration dd:_:Token Time td:_) ->+ tt $ durationBefore dd td+ _ -> Nothing+ }++rulePartofdayOfTime :: Rule+rulePartofdayOfTime = Rule+ { name = "<part-of-day> of <time>"+ , pattern =+ [ Predicate isAPartOfDay+ , regex "(van|op|in)( de)?"+ , dimension Time+ ]+ , prod = \tokens -> case tokens of+ (Token Time td1:_:Token Time td2:_) ->+ Token Time <$> intersect td1 td2+ _ -> Nothing+ }++ruleMmddyyyy :: Rule+ruleMmddyyyy = Rule+ { name = "dd/mm/yyyy"+ , pattern =+ [ regex "(3[01]|[12]\\d|0?[1-9])[/.-](1[0-2]|0?[1-9])[/.-](\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (Token RegexMatch (GroupMatch (m1:m2:m3:_)):_) -> do+ y <- parseInt m3+ m <- parseInt m2+ d <- parseInt m1+ tt $ yearMonthDay y m d+ _ -> Nothing+ }++ruleTimeofdayOclock :: Rule+ruleTimeofdayOclock = Rule+ { name = "<time-of-day> o'clock"+ , pattern =+ [ Predicate isATimeOfDay+ , regex "uur|h|u(?:[\\s'\"-_{}\\[\\]()]|$)"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:_) -> tt $ notLatent td+ _ -> Nothing+ }++ruleDayofmonthordinalNamedmonthYear :: Rule+ruleDayofmonthordinalNamedmonthYear = Rule+ { name = "<day-of-month>(ordinal) <named-month> year"+ , pattern =+ [ Predicate isDOMOrdinal+ , Predicate isAMonth+ , regex "(\\d{2,4})"+ ]+ , prod = \tokens -> case tokens of+ (token:+ Token Time td:+ Token RegexMatch (GroupMatch (match:_)):+ _) -> do+ n <- parseInt match+ dom <- intersectDOM td token+ Token Time <$> intersect dom (year n)+ _ -> Nothing+ }++ruleTimezone :: Rule+ruleTimezone = Rule+ { name = "<time> timezone"+ , pattern =+ [ Predicate $ and . sequence [isNotLatent, isATimeOfDay]+ , regex "\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT|SCT|SBT|SAST|SAMT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PHT|PHOT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|NCT|MYT|MVT|MUT|MST|MSK|MSD|MMT|MHT|MDT|MAWT|MART|MAGT|MAGST|LINT|LHST|LHDT|KUYT|KST|KRAT|KRAST|KGT|JST|IST|IRST|IRKT|IRKST|IRDT|IOT|IDT|ICT|HOVT|HKT|GYT|GST|GMT|GILT|GFT|GET|GAMT|GALT|FNT|FKT|FKST|FJT|FJST|EST|EGT|EGST|EET|EEST|EDT|ECT|EAT|EAST|EASST|DAVT|ChST|CXT|CVT|CST|COT|CLT|CLST|CKT|CHAST|CHADT|CET|CEST|CDT|CCT|CAT|CAST|BTT|BST|BRT|BRST|BOT|BNT|AZT|AZST|AZOT|AZOST|AWST|AWDT|AST|ART|AQTT|ANAT|ANAST|AMT|AMST|ALMT|AKST|AKDT|AFT|AEST|AEDT|ADT|ACST|ACDT)\\b"+ ]+ , prod = \tokens -> case tokens of+ (Token Time td:+ Token RegexMatch (GroupMatch (tz:_)):+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleADuration+ , ruleAboutTimeofday+ , ruleAbsorptionOfAfterNamedDay+ , ruleAfterDuration+ , ruleAfterLunch+ , ruleAfterNextTime+ , ruleAfterTimeofday+ , ruleAfterTimeofdayPostfix+ , ruleAfterWork+ , ruleAfternoon+ , ruleAfternoons+ , ruleAtTimeofday+ , ruleBetweenDatetimeAndDatetimeInterval+ , ruleBetweenTimeofdayAndTimeofdayInterval+ , ruleByTheEndOfTime+ , ruleDatetimeDatetimeInterval+ , ruleDayofmonthNonOrdinalNamedmonth+ , ruleDayofmonthNonOrdinalOfNamedmonth+ , ruleDayofmonthOrdinal+ , ruleDayofmonthordinalNamedmonth+ , ruleDayofmonthordinalNamedmonthYear+ , ruleDurationAfterTime+ , ruleDurationHenceAgo+ , ruleDurationBeforeTime+ , ruleDurationFromNow+ , ruleEvening+ , ruleEvenings+ , ruleExactlyTimeofday+ , ruleFromDatetimeDatetimeInterval+ , ruleFromTimeofdayTimeofdayInterval+ , ruleHhmm+ , ruleHhmmMilitary+ , ruleHhmmMilitaryAmpm+ , ruleHourofdayIntegerAsRelativeMinutes+ , ruleInDuration+ , ruleInduringThePartofday+ , ruleIntersect+ , ruleIntersectBy+ , ruleIntersectByOfFromS+ , ruleLastCycle+ , ruleLastCycleOfTime+ , ruleLastDayofweekOfTime+ , ruleLastNCycle+ , ruleLastTime+ , ruleLunch+ , ruleMidnighteodendOfDay+ , ruleMmdd+ , ruleMmddyyyy+ , ruleMonthDdddInterval+ , ruleMorning+ , ruleMornings+ , ruleNamedmonthDayofmonthNonOrdinal+ , ruleNamedmonthDayofmonthOrdinal+ , ruleNextCycle+ , ruleNextNCycle+ , ruleNextTime+ , ruleNight+ , ruleNights+ , ruleNthTimeAfterTime+ , ruleNthTimeAfterTime2+ , ruleNthTimeOfTime+ , ruleNthTimeOfTime2+ , ruleOnANamedday+ , ruleOnDate+ , ruleOrdinalCycleAfterTime+ , ruleOrdinalCycleOfTime+ , ruleOrdinalQuarter+ , ruleOrdinalQuarterYear+ , rulePartofdayOfTime+ , ruleRelativeMinutesToOrAfterIntegerPartOfDay+ , ruleTheCycleAfterTime+ , ruleTheCycleBeforeTime+ , ruleTheDayofmonthNonOrdinal+ , ruleTheDayofmonthOrdinal+ , ruleTheOrdinalCycleAfterTime+ , ruleTheOrdinalCycleOfTime+ , ruleThisCycle+ , ruleThisPartofday+ , ruleThisTime+ , ruleThisnextDayofweek+ , ruleTimeAfterNext+ , ruleTimePartofday+ , ruleTimeofdayAmpm+ , ruleTimeofdayApproximately+ , ruleTimeofdayLatent+ , ruleTimeofdayOclock+ , ruleTimeofdaySharp+ , ruleTimeofdayTimeofdayInterval+ , ruleTimeofdayTimeofdayInterval2+ , ruleUntilTimeofday+ , ruleUntilTimeofdayPostfix+ , ruleWeekend+ , ruleWithinDuration+ , ruleYear+ , ruleYearLatent+ , ruleYearLatent2+ , ruleYyyymmdd+ , ruleQuarterTotillbeforeIntegerHourofday+ , ruleHalfTotillbeforeIntegerHourofday+ , ruleQuarterAfterpastIntegerHourofday+ , ruleTimezone+ ]+ ++ ruleInstants+ ++ ruleDaysOfWeek+ ++ ruleMonths+ ++ ruleSeasons+ ++ ruleHolidays
Duckling/Time/PL/Rules.hs view
@@ -41,8 +41,8 @@ _ -> Nothing } -daysOfWeek :: [(Text.Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "poniedzia(l|ł)(ek|ku|kowi|kiem|kowy)|pon\\.?" ) , ( "Tuesday" , "wtorek|wtorku|wtorkowi|wtorkiem|wtr?\\.?" ) , ( "Wednesday" , "(Ś|ś|s)rod(a|ą|y|e|ę|zie|owy|o)|(s|ś|Ś)ro?\\.?" )@@ -52,17 +52,8 @@ , ( "Sunday" , "niedziel(a|i|ę|e|ą|o)|n(ie)?dz?\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text.Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "January" , "styczeń|styczen|stycznia|styczniowi|styczniem|styczniu|sty(cz)?\\.?" ) , ( "February" , "luty|lutego|lutemu|lut?\\.?" ) , ( "March" , "marzec|marca|marcowi|marcem|marcu|marz?\\.?" )@@ -77,15 +68,6 @@ , ( "December" , "grudzień|grudzien|grudnia|grudniowi|grudniem|grudniu|gru\\.?|grud\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleRelativeMinutesTotillbeforeIntegerHourofday :: Rule ruleRelativeMinutesTotillbeforeIntegerHourofday = Rule { name = "relative minutes to|till|before <integer> (hour-of-day)"@@ -323,7 +305,7 @@ [ Predicate $ isOrdinalBetween 1 24 ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . mkLatent $ hour True v _ -> Nothing }@@ -900,7 +882,7 @@ , regex "(z )?ran(o|a|u|em)" ] , prod = \tokens -> case tokens of- (Token Time td:_) -> tt $ timeOfDayAMPM td True+ (Token Time td:_) -> tt $ timeOfDayAMPM True td _ -> Nothing } @@ -1207,7 +1189,7 @@ , regex "(w )?noc(y|(a|ą))|(po ?)?po(l|ł)udni(em|e|a|u)|wiecz(o|ó)r(i|u|a|owi|em|rze)" ] , prod = \tokens -> case tokens of- (Token Time td:_) -> tt $ timeOfDayAMPM td False+ (Token Time td:_) -> tt $ timeOfDayAMPM False td _ -> Nothing } @@ -1286,7 +1268,7 @@ [ Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . mkLatent $ dayOfMonth v _ -> Nothing }@@ -1474,8 +1456,7 @@ _) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } @@ -1662,7 +1643,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/PT/Rules.hs view
@@ -13,6 +13,7 @@ module Duckling.Time.PT.Rules ( rules ) where +import Data.Text (Text) import Prelude import qualified Data.Text as Text @@ -25,15 +26,6 @@ import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG -ruleNamedday :: Rule-ruleNamedday = Rule- { name = "named-day"- , pattern =- [ regex "segunda((\\s|\\-)feira)?|seg\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 1- }- ruleSHourmintimeofday :: Rule ruleSHourmintimeofday = Rule { name = "às <hour-min>(time-of-day)"@@ -56,24 +48,6 @@ , prod = \_ -> tt $ cycleNth TG.Day 2 } -ruleNamedmonth12 :: Rule-ruleNamedmonth12 = Rule- { name = "named-month"- , pattern =- [ regex "dezembro|dez\\.?"- ]- , prod = \_ -> tt $ month 12- }--ruleNamedday2 :: Rule-ruleNamedday2 = Rule- { name = "named-day"- , pattern =- [ regex "ter(ç|c)a((\\s|\\-)feira)?|ter\\."- ]- , prod = \_ -> tt $ dayOfWeek 2- }- ruleNatal :: Rule ruleNatal = Rule { name = "natal"@@ -135,15 +109,6 @@ _ -> Nothing } -ruleNamedday6 :: Rule-ruleNamedday6 = Rule- { name = "named-day"- , pattern =- [ regex "s(á|a)bado|s(á|a)b\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 6- }- ruleDatetimeDatetimeInterval :: Rule ruleDatetimeDatetimeInterval = Rule { name = "<datetime> - <datetime> (interval)"@@ -158,15 +123,6 @@ _ -> Nothing } -ruleNamedmonth7 :: Rule-ruleNamedmonth7 = Rule- { name = "named-month"- , pattern =- [ regex "julho|jul\\.?"- ]- , prod = \_ -> tt $ month 7- }- ruleEvening :: Rule ruleEvening = Rule { name = "evening"@@ -227,15 +183,6 @@ _ -> Nothing } -ruleNamedday4 :: Rule-ruleNamedday4 = Rule- { name = "named-day"- , pattern =- [ regex "quinta((\\s|\\-)feira)?|qui\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 4- }- ruleProximoCycle :: Rule ruleProximoCycle = Rule { name = "proximo <cycle> "@@ -583,15 +530,6 @@ _ -> Nothing } -ruleNamedmonth :: Rule-ruleNamedmonth = Rule- { name = "named-month"- , pattern =- [ regex "janeiro|jan\\.?"- ]- , prod = \_ -> tt $ month 1- }- ruleTiradentes :: Rule ruleTiradentes = Rule { name = "Tiradentes"@@ -627,15 +565,6 @@ _ -> Nothing } -ruleNamedmonth3 :: Rule-ruleNamedmonth3 = Rule- { name = "named-month"- , pattern =- [ regex "mar(ç|c)o|mar\\.?"- ]- , prod = \_ -> tt $ month 3- }- ruleDepoisDasTimeofday :: Rule ruleDepoisDasTimeofday = Rule { name = "depois das <time-of-day>"@@ -689,15 +618,6 @@ interval TTime.Open from to } -ruleNamedmonth4 :: Rule-ruleNamedmonth4 = Rule- { name = "named-month"- , pattern =- [ regex "abril|abr\\.?"- ]- , prod = \_ -> tt $ month 4- }- ruleDimTimeDaManha :: Rule ruleDimTimeDaManha = Rule { name = "<dim time> da manha"@@ -737,15 +657,6 @@ , prod = \_ -> tt $ hour False 0 } -ruleNamedday5 :: Rule-ruleNamedday5 = Rule- { name = "named-day"- , pattern =- [ regex "sexta((\\s|\\-)feira)?|sex\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 5- }- ruleDdddMonthinterval :: Rule ruleDdddMonthinterval = Rule { name = "dd-dd <month>(interval)"@@ -797,15 +708,6 @@ _ -> Nothing } -ruleNamedmonth2 :: Rule-ruleNamedmonth2 = Rule- { name = "named-month"- , pattern =- [ regex "fevereiro|fev\\.?"- ]- , prod = \_ -> tt $ month 2- }- ruleNamedmonthnameddayPast :: Rule ruleNamedmonthnameddayPast = Rule { name = "<named-month|named-day> past"@@ -948,15 +850,6 @@ _ -> Nothing } -ruleNamedmonth6 :: Rule-ruleNamedmonth6 = Rule- { name = "named-month"- , pattern =- [ regex "junho|jun\\.?"- ]- , prod = \_ -> tt $ month 6- }- ruleDentroDeDuration :: Rule ruleDentroDeDuration = Rule { name = "dentro de <duration>"@@ -985,15 +878,6 @@ _ -> Nothing } -ruleNamedmonth8 :: Rule-ruleNamedmonth8 = Rule- { name = "named-month"- , pattern =- [ regex "agosto|ago\\.?"- ]- , prod = \_ -> tt $ month 8- }- ruleDimTimeDaTarde :: Rule ruleDimTimeDaTarde = Rule { name = "<dim time> da tarde"@@ -1292,7 +1176,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -1364,24 +1248,6 @@ _ -> Nothing } -ruleNamedmonth5 :: Rule-ruleNamedmonth5 = Rule- { name = "named-month"- , pattern =- [ regex "maio|mai\\.?"- ]- , prod = \_ -> tt $ month 5- }--ruleNamedday7 :: Rule-ruleNamedday7 = Rule- { name = "named-day"- , pattern =- [ regex "domingo|dom\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 7- }- ruleNossaSenhoraAparecida :: Rule ruleNossaSenhoraAparecida = Rule { name = "Nossa Senhora Aparecida"@@ -1413,15 +1279,6 @@ _ -> Nothing } -ruleNamedmonth10 :: Rule-ruleNamedmonth10 = Rule- { name = "named-month"- , pattern =- [ regex "outubro|out\\.?"- ]- , prod = \_ -> tt $ month 10- }- ruleAntesDasTimeofday :: Rule ruleAntesDasTimeofday = Rule { name = "antes das <time-of-day>"@@ -1465,15 +1322,6 @@ _ -> Nothing } -ruleNamedmonth11 :: Rule-ruleNamedmonth11 = Rule- { name = "named-month"- , pattern =- [ regex "novembro|nov\\.?"- ]- , prod = \_ -> tt $ month 11- }- ruleIndependecia :: Rule ruleIndependecia = Rule { name = "Independecia"@@ -1483,15 +1331,6 @@ , prod = \_ -> tt $ monthDay 9 7 } -ruleNamedday3 :: Rule-ruleNamedday3 = Rule- { name = "named-day"- , pattern =- [ regex "quarta((\\s|\\-)feira)?|qua\\.?"- ]- , prod = \_ -> tt $ dayOfWeek 3- }- ruleTomorrow :: Rule ruleTomorrow = Rule { name = "tomorrow"@@ -1501,15 +1340,6 @@ , prod = \_ -> tt $ cycleNth TG.Day 1 } -ruleNamedmonth9 :: Rule-ruleNamedmonth9 = Rule- { name = "named-month"- , pattern =- [ regex "setembro|set\\.?"- ]- , prod = \_ -> tt $ month 9- }- ruleTimezone :: Rule ruleTimezone = Rule { name = "<time> timezone"@@ -1520,10 +1350,43 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } +daysOfWeek :: [(Text, String)]+daysOfWeek =+ [ ( "Segunda-feira", "segunda((\\s|\\-)feira)?|seg\\.?" )+ , ( "Terça-feira", "ter(ç|c)a((\\s|\\-)feira)?|ter\\." )+ , ( "Quart-feira", "quarta((\\s|\\-)feira)?|qua\\.?" )+ , ( "Quinta-feira", "quinta((\\s|\\-)feira)?|qui\\.?" )+ , ( "Sexta-feira", "sexta((\\s|\\-)feira)?|sex\\.?" )+ , ( "Sábada", "s(á|a)bado|s(á|a)b\\.?" )+ , ( "Domingo", "domingo|dom\\.?" )+ ]++ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek daysOfWeek++months :: [(Text, String)]+months =+ [ ( "Janeiro" , "janeiro|jan\\.?" )+ , ( "Fevereiro" , "fevereiro|fev\\.?" )+ , ( "Março" , "mar(ç|c)o|mar\\.?" )+ , ( "Abril" , "abril|abr\\.?" )+ , ( "Maio" , "maio|mai\\.?" )+ , ( "Junho" , "junho|jun\\.?" )+ , ( "Julho" , "julho|jul\\.?" )+ , ( "Agosto" , "agosto|ago\\.?" )+ , ( "Setembro" , "setembro|set\\.?" )+ , ( "Outubro" , "outubro|out\\.?" )+ , ( "Novembro" , "novembro|nov\\.?" )+ , ( "Dezembro" , "dezembro|dez\\.?" )+ ]++ruleMonths :: [Rule]+ruleMonths = mkRuleMonths months+ rules :: [Rule] rules = [ ruleAfternoon@@ -1582,25 +1445,6 @@ , ruleNCycleProximoqueVem , ruleNPassadosCycle , ruleNProximasCycle- , ruleNamedday- , ruleNamedday2- , ruleNamedday3- , ruleNamedday4- , ruleNamedday5- , ruleNamedday6- , ruleNamedday7- , ruleNamedmonth- , ruleNamedmonth10- , ruleNamedmonth11- , ruleNamedmonth12- , ruleNamedmonth2- , ruleNamedmonth3- , ruleNamedmonth4- , ruleNamedmonth5- , ruleNamedmonth6- , ruleNamedmonth7- , ruleNamedmonth8- , ruleNamedmonth9 , ruleNamedmonthnameddayNext , ruleNamedmonthnameddayPast , ruleNaoDate@@ -1648,3 +1492,5 @@ , ruleYyyymmdd , ruleTimezone ]+ ++ ruleMonths+ ++ ruleDaysOfWeek
Duckling/Time/RO/Rules.hs view
@@ -22,6 +22,7 @@ import Duckling.Time.Helpers import Duckling.Time.Types (TimeData (..)) import Duckling.Types+import qualified Data.Text as Text import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG @@ -1011,7 +1012,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } @@ -1210,8 +1211,8 @@ _ -> Nothing } -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "luni" , "lu(n(ea|i)?)?" ) , ( "marti" , "ma(r((t|ț)(ea|i))?)?" ) , ( "miercuri" , "mi(e(rcur(ea|i))?)?" )@@ -1221,17 +1222,8 @@ , ( "duminica" , "du(m(inic(a|ă))?)?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "ianuarie" , "ian(uarie)?" ) , ( "februarie" , "feb(ruarie)?" ) , ( "martie" , "martie|mar" )@@ -1245,15 +1237,6 @@ , ( "noiembrie" , "noi(embrie)?" ) , ( "decembrie" , "dec(embrie)?" ) ]--ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- } rules :: [Rule] rules =
Duckling/Time/SV/Corpus.hs view
@@ -358,6 +358,8 @@ ] , examples (datetime (2013, 2, 13, 4, 30, 0) Minute) [ "om 24 timmar"+ , "2013-02-13 kl. 4:30"+ , "2013-02-13 kl 04:30" ] , examples (datetime (2013, 2, 13, 4, 0, 0) Hour) [ "om en dag"@@ -549,8 +551,11 @@ ] , examples (datetime (2013, 2, 14, 6, 0, 0) Minute) [ "torsdag kl. 8:00 GMT"+ , "torsdag kl. 8:00 gmt" , "torsdag klockan 8:00 GMT"+ , "torsdag klockan 8:00 gmt" , "torsdag 08:00 GMT"+ , "torsdag 08:00 gmt" ] , examples (datetime (2013, 2, 12, 14, 0, 0) Hour) [ "idag kl. 14"@@ -563,6 +568,7 @@ , "25/4 klockan 16:00" , "25-04 klockan 16:00" , "25-4 kl. 16:00"+ , "2013-04-25 kl 16:00" ] , examples (datetime (2013, 2, 13, 15, 0, 0) Minute) [ "15:00 imorgon"
Duckling/Time/SV/Rules.hs view
@@ -23,12 +23,13 @@ import Duckling.Time.Helpers import Duckling.Time.Types (TimeData (..)) import Duckling.Types+import qualified Data.Text as Text import qualified Duckling.Ordinal.Types as TOrdinal import qualified Duckling.Time.Types as TTime import qualified Duckling.TimeGrain.Types as TG -daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Mandag" , "måndag(en)?s?|mån\\.?" ) , ( "Tisdag" , "tisdag(en)?s?|tis?\\.?" ) , ( "Onsdag" , "onsdag(en)?s?|ons\\.?" )@@ -38,17 +39,8 @@ , ( "Sondag" , "söndag(en)?s?|sön\\.?" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ("Januari" , "januari|jan\\.?" ) , ("Februari" , "februari|feb\\.?" ) , ("Mars" , "mars|mar\\.?" )@@ -63,15 +55,6 @@ , ("December" , "december|dec\\.?" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleTheDayAfterTomorrow :: Rule ruleTheDayAfterTomorrow = Rule { name = "the day after tomorrow"@@ -243,7 +226,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -740,7 +723,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1026,7 +1009,7 @@ , dimension Time ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):+ (Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1086,7 +1069,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: Token Time td1: _: Token Time td2:@@ -1359,7 +1342,7 @@ [ Predicate isDOMOrdinal ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) ->+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . mkLatent $ dayOfMonth v _ -> Nothing }@@ -1537,7 +1520,7 @@ , Predicate $ isGrain TG.Quarter ] , prod = \tokens -> case tokens of- (Token Ordinal (OrdinalData {TOrdinal.value = v}):_) -> tt .+ (Token Ordinal OrdinalData{TOrdinal.value = v}:_) -> tt . cycleNthAfter False TG.Quarter (v - 1) $ cycleNth TG.Year 0 _ -> Nothing }@@ -1551,7 +1534,7 @@ ] , prod = \tokens -> case tokens of (_:- Token Ordinal (OrdinalData {TOrdinal.value = v}):+ Token Ordinal OrdinalData{TOrdinal.value = v}: _) -> tt $ dayOfMonth v _ -> Nothing }@@ -1659,7 +1642,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing }
Duckling/Time/Types.hs view
@@ -16,23 +16,24 @@ module Duckling.Time.Types where +import Control.Applicative ((<|>)) import Control.Arrow ((***)) import Control.DeepSeq import Control.Monad (join)-import Control.Applicative ((<|>)) import Data.Aeson import Data.Hashable-import qualified Data.HashMap.Strict as H import Data.Maybe import Data.Monoid import Data.Text (Text)+import GHC.Generics+import Prelude+import TextShow (showt)+import qualified Data.HashMap.Strict as H+import qualified Data.List as List import qualified Data.Text as Text import qualified Data.Time as Time import qualified Data.Time.Calendar.WeekDate as Time import qualified Data.Time.LocalTime.TimeZone.Series as Series-import GHC.Generics-import TextShow (showt)-import Prelude import Duckling.Resolve import Duckling.TimeGrain.Types (Grain)@@ -56,26 +57,26 @@ data IntervalDirection = Before | After deriving (Eq, Generic, Hashable, Ord, Show, NFData) --- Grain needed here for intersect data TimeData = TimeData { timePred :: Predicate , latent :: Bool- , timeGrain :: Grain+ , timeGrain :: Grain -- needed for intersect , notImmediate :: Bool , form :: Maybe Form , direction :: Maybe IntervalDirection+ , okForThisNext :: Bool -- allows specific this+Time } instance Eq TimeData where- (==) (TimeData _ l1 g1 n1 f1 d1) (TimeData _ l2 g2 n2 f2 d2) =+ (==) (TimeData _ l1 g1 n1 f1 d1 _) (TimeData _ l2 g2 n2 f2 d2 _) = l1 == l2 && g1 == g2 && n1 == n2 && f1 == f2 && d1 == d2 instance Hashable TimeData where- hashWithSalt s (TimeData _ latent grain imm form dir) = hashWithSalt s+ hashWithSalt s (TimeData _ latent grain imm form dir _) = hashWithSalt s (0::Int, (latent, grain, imm, form, dir)) instance Ord TimeData where- compare (TimeData _ l1 g1 n1 f1 d1) (TimeData _ l2 g2 n2 f2 d2) =+ compare (TimeData _ l1 g1 n1 f1 d1 _) (TimeData _ l2 g2 n2 f2 d2 _) = case compare g1 g2 of EQ -> case compare f1 f2 of EQ -> case compare l1 l2 of@@ -87,7 +88,7 @@ z -> z instance Show TimeData where- show (TimeData _ latent grain _ form dir) =+ show (TimeData _ latent grain _ form dir _) = "TimeData{" ++ "latent=" ++ show latent ++ ", grain=" ++ show grain ++@@ -102,16 +103,17 @@ type ResolvedValue TimeData = TimeValue resolve _ TimeData {latent = True} = Nothing resolve context TimeData {timePred, notImmediate, direction} = do- t <- case ts of- (behind, []) -> listToMaybe behind- (_, ahead:nextAhead:_)+ value <- case future of+ [] -> listToMaybe past+ ahead:nextAhead:_ | notImmediate && isJust (timeIntersect ahead refTime) -> Just nextAhead- (_, ahead:_) -> Just ahead+ ahead:_ -> Just ahead+ values <- Just . take 3 $ if List.null future then past else future Just $ case direction of- Nothing -> TimeValue (timeValue tzSeries t) .- map (timeValue tzSeries) $ take 3 future- Just d -> TimeValue (openInterval tzSeries d t) .- map (openInterval tzSeries d) $ take 3 future+ Nothing -> TimeValue (timeValue tzSeries value) $+ map (timeValue tzSeries) values+ Just d -> TimeValue (openInterval tzSeries d value) $+ map (openInterval tzSeries d) values where DucklingTime (Series.ZoneSeriesTime utcTime tzSeries) = referenceTime context refTime = TimeObject@@ -125,7 +127,7 @@ , maxTime = timePlus refTime TG.Year 2000 , minTime = timePlus refTime TG.Year $ - 2000 }- ts@(_, future) = runPredicate timePred refTime tc+ (past, future) = runPredicate timePred refTime tc timedata' :: TimeData timedata' = TimeData@@ -135,6 +137,7 @@ , notImmediate = False , form = Nothing , direction = Nothing+ , okForThisNext = False } data TimeContext = TimeContext
Duckling/Time/VI/Rules.hs view
@@ -38,51 +38,33 @@ , prod = \_ -> tt $ monthDay 1 1 } -daysOfWeek :: [(Text, String)]-daysOfWeek =- [ ( "Monday" , "th(ứ) (2|hai)" )- , ( "Tuesday" , "th(ứ) (3|ba)" )+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek+ [ ( "Monday" , "th(ứ) (2|hai)" )+ , ( "Tuesday" , "th(ứ) (3|ba)" ) , ( "Wednesday", "th(ứ) 4|th(ứ) b(ố)n|th(ứ) t(ư)" )- , ( "Thursday" , "th(ứ) (5|n(ă)m)" )- , ( "Friday" , "th(ứ) 6|th(ứ) s(á)u" )- , ( "Saturday" , "th(ứ) (7|b((ả)|(ẩ))y)" )- , ( "Sunday" , "ch(ủ) nh(ậ)t" )+ , ( "Thursday" , "th(ứ) (5|n(ă)m)" )+ , ( "Friday" , "th(ứ) 6|th(ứ) s(á)u" )+ , ( "Saturday" , "th(ứ) (7|b((ả)|(ẩ))y)" )+ , ( "Sunday" , "ch(ủ) nh(ậ)t" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =- [ ( "January" , "th(á)ng (gi(ê)ng|m(ộ)t)" )- , ( "February" , "th(á)ng hai" )- , ( "March" , "th(á)ng ba" )+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths+ [ ( "January" , "th(á)ng (gi(ê)ng|m(ộ)t)" )+ , ( "February" , "th(á)ng hai" )+ , ( "March" , "th(á)ng ba" ) , ( "April" , "th(á)ng t(ư)|th(á)ng b(ố)n" )- , ( "May" , "th(á)ng n(ă)m" )- , ( "June" , "th(á)ng s(á)u" )- , ( "July" , "th(á)ng b(ả)y" )- , ( "August" , "th(á)ng t(á)m" )- , ( "September", "th(á)ng ch(í)n" )- , ( "October" , "th(á)ng m(ư)(ờ)i" )+ , ( "May" , "th(á)ng n(ă)m" )+ , ( "June" , "th(á)ng s(á)u" )+ , ( "July" , "th(á)ng b(ả)y" )+ , ( "August" , "th(á)ng t(á)m" )+ , ( "September", "th(á)ng ch(í)n" )+ , ( "October" , "th(á)ng m(ư)(ờ)i" ) , ( "November" , "th(á)ng m(ư)(ờ)i m(ộ)t" )- , ( "December" , "th(á)ng m(ư)(ờ)i hai" )+ , ( "December" , "th(á)ng m(ư)(ờ)i hai" ) ] -ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- }- ruleDayofmonthNamedmonth :: Rule ruleDayofmonthNamedmonth = Rule { name = "<day-of-month> (numeric with day symbol) <named-month>"@@ -630,7 +612,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "s\225ng"+ tt $ timeOfDayAMPM (Text.toLower ap == "s\225ng") td _ -> Nothing } @@ -786,7 +768,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (_:ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -864,7 +846,7 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } @@ -905,8 +887,7 @@ _) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "a"+ tt . timeOfDayAMPM (Text.toLower ap == "a") $ hourMinute True h m _ -> Nothing } @@ -923,8 +904,7 @@ _) -> do h <- parseInt hh m <- parseInt mm- tt . timeOfDayAMPM (hourMinute True h m) $- Text.toLower ap == "s\225ng"+ tt . timeOfDayAMPM (Text.toLower ap == "s\225ng") $ hourMinute True h m _ -> Nothing }
Duckling/Time/ZH/Rules.hs view
@@ -770,7 +770,7 @@ ] , prod = \tokens -> case tokens of (Token Time td:Token RegexMatch (GroupMatch (ap:_)):_) ->- tt . timeOfDayAMPM td $ Text.toLower ap == "a"+ tt $ timeOfDayAMPM (Text.toLower ap == "a") td _ -> Nothing } @@ -959,13 +959,12 @@ , prod = \tokens -> case tokens of (Token Time td: Token RegexMatch (GroupMatch (tz:_)):- _) -> Token Time <$> inTimezone tz td+ _) -> Token Time <$> inTimezone (Text.toUpper tz) td _ -> Nothing } --daysOfWeek :: [(Text, String)]-daysOfWeek =+ruleDaysOfWeek :: [Rule]+ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday", "星期一|周一|礼拜一|禮拜一|週一" ) , ( "Tuesday", "星期二|周二|礼拜二|禮拜二|週二" ) , ( "Wednesday", "星期三|周三|礼拜三|禮拜三|週三" )@@ -975,17 +974,8 @@ , ( "Sunday", "星期日|星期天|礼拜天|周日|禮拜天|週日|禮拜日" ) ] -ruleDaysOfWeek :: [Rule]-ruleDaysOfWeek = zipWith go daysOfWeek [1..7]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ dayOfWeek i- }--months :: [(Text, String)]-months =+ruleMonths :: [Rule]+ruleMonths = mkRuleMonths [ ( "January", "一月(份)?" ) , ( "February", "二月(份)?" ) , ( "March", "三月(份)?" )@@ -999,15 +989,6 @@ , ( "November", "十一月(份)?" ) , ( "December", "十二月(份)?" ) ]--ruleMonths :: [Rule]-ruleMonths = zipWith go months [1..12]- where- go (name, regexPattern) i = Rule- { name = name- , pattern = [regex regexPattern]- , prod = \_ -> tt $ month i- } rules :: [Rule] rules =
+ Duckling/TimeGrain/AR/Rules.hs view
@@ -0,0 +1,41 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.TimeGrain.AR.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude++import Duckling.Dimensions.Types+import Duckling.Types+import qualified Duckling.TimeGrain.Types as TG++grains :: [(Text, String, TG.Grain)]+grains = [ ("second (grain) ", "(ثاني(ة|ه)?|ثواني|لحظ(ة|ه|ات))" , TG.Second)+ , ("minute (grain)" , "دق(يق(ة|ه)|ائق)" , TG.Minute)+ , ("hour (grain)" , "ساع(ة|ه|ات)" , TG.Hour)+ , ("day (grain)" , "يوم|(ا|أ)يام" , TG.Day)+ , ("week (grain)" , "(ا|أ|إ)س(بوع|ابيع)" , TG.Week)+ , ("month (grain)" , "شهر|(ا|أ|إ)شهر" , TG.Month)+ , ("quarter (grain)", "(ربع(ين|ان)|[أا]رباع)(سنة|عام)?" , TG.Quarter)+ , ("year (grain)" , "سن(ة|ين)|عام" , TG.Year)+ ]++rules :: [Rule]+rules = map go grains+ where+ go (name, regexPattern, grain) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> Just $ Token TimeGrain grain+ }
+ Duckling/TimeGrain/EL/Rules.hs view
@@ -0,0 +1,42 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.TimeGrain.EL.Rules+ ( rules ) where++import Data.Text (Text)+import Data.String+import Prelude++import Duckling.Dimensions.Types+import qualified Duckling.TimeGrain.Types as TG+import Duckling.Types++grains :: [(Text, String, TG.Grain)]+grains =+ [ ("second (grain) ", "δε[υύ]τερ([οό]λ[εέ]πτ)?(ου?|α|ων)", TG.Second)+ , ("minute (grain)" , "λεπτ(o|όν?|ού|ά|ών)" , TG.Minute)+ , ("hour (grain)" , "[ωώ](ρ(ας?|ες|ών))?" , TG.Hour)+ , ("day (grain)" , "η?μέρ(ας?|ες|ών)" , TG.Day)+ , ("week (grain)" , "ε?βδομάδ(ας?ν?|ες|ων)" , TG.Week)+ , ("month (grain)" , "μήν(ας?|ες|ών)" , TG.Month)+ , ("quarter (grain)", "τρ[ιί]μ[ηή]ν(ου?|α|ων)" , TG.Quarter)+ , ("year (grain)" , "έτ(ου?ς|η|ών)|χρ[οό]ν(ο[ιςυ]?|ι([αά]|ές)|ι?ών)"+ , TG.Year)+ ]++rules :: [Rule]+rules = map go grains+ where+ go (name, regexPattern, grain) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> Just $ Token TimeGrain grain+ }
Duckling/TimeGrain/NL/Rules.hs view
@@ -22,11 +22,11 @@ grains :: [(Text, String, TG.Grain)] grains = [ ("second (grain) " , "(seconde(n|s)?|sec|s)" , TG.Second) , ("minute (grain)" , "(minuut|minuten|min|m)", TG.Minute)- , ("hour (grain)" , "(u|h|uur|uren)", TG.Hour)- , ("day (grain)" , "(dagen|dag|d)", TG.Day)+ , ("hour (grain)" , "(uur|uren|u|h)", TG.Hour)+ , ("day (grain)" , "dagen|dag|d", TG.Day) , ("week (grain)" , "(weken|week|w)", TG.Week) , ("month (grain)" , "(maanden|maand|mnd)", TG.Month)- , ("quarter (grain)" , "kwartier", TG.Quarter)+ , ("quarter (grain)" , "(kwartaal|kwartalen)", TG.Quarter) , ("year (grain)" , "(jaren|jaar|j)", TG.Year) ]
+ Duckling/TimeGrain/RU/Rules.hs view
@@ -0,0 +1,41 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.TimeGrain.RU.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude++import Duckling.Dimensions.Types+import Duckling.TimeGrain.Types+import Duckling.Types++grains :: [(Text, String, Grain)]+grains = [ ("second (grain) ", "сек(унд(а|у|ы)?)?", Second)+ , ("minute (grain)" , "мин(ут(а|у|ы)?)?", Minute)+ , ("hour (grain)" , "ч(ас(а|ов)?)?", Hour)+ , ("day (grain)" , "день|дня|дней", Day)+ , ("week (grain)" , "недел(ь|я|и|ю)?", Week)+ , ("month (grain)" , "месяц(а|ев)?", Month)+ , ("quarter (grain)", "квартал(а)?", Quarter)+ , ("year (grain)" , "года?|лет", Year)+ ]++rules :: [Rule]+rules = map go grains+ where+ go (name, regexPattern, grain) = Rule+ { name = name+ , pattern = [regex regexPattern]+ , prod = \_ -> Just $ Token TimeGrain grain+ }
Duckling/TimeGrain/Types.hs view
@@ -61,7 +61,7 @@ updateUTCDay utcTime . Time.addGregorianMonthsClip $ 3 * n add utcTime Year n = updateUTCDay utcTime $ Time.addGregorianYearsClip n -inSeconds :: Grain -> Int -> Int+inSeconds :: Num a => Grain -> a -> a inSeconds NoGrain n = n inSeconds Second n = n inSeconds Minute n = n * 60
Duckling/Types.hs view
@@ -19,16 +19,16 @@ import Control.DeepSeq import Data.Aeson-import qualified Data.ByteString.Lazy as LB import Data.GADT.Compare import Data.Hashable import Data.Maybe import Data.String import Data.Text (Text)-import qualified Data.Text.Encoding as Text import Data.Typeable ((:~:)(Refl), Typeable) import GHC.Generics import Prelude+import qualified Data.ByteString.Lazy as LB+import qualified Data.Text.Encoding as Text import qualified Text.Regex.Base as R import qualified Text.Regex.PCRE as PCRE @@ -79,8 +79,8 @@ deriving (Eq, Show) instance Ord Candidate where- compare (Candidate (Resolved{range = Range s1 e1, node = Node{token = Token d1 _}}) score1 t1)- (Candidate (Resolved{range = Range s2 e2, node = Node{token = tok2}}) score2 t2)+ compare (Candidate Resolved{range = Range s1 e1, node = Node{token = Token d1 _}} score1 t1)+ (Candidate Resolved{range = Range s2 e2, node = Node{token = tok2}} score2 t2) | isDimension d1 tok2 = case starts of EQ -> case ends of EQ -> compare score1 score2@@ -132,10 +132,17 @@ , value :: Value , start :: Int , end :: Int+ , enode :: Node } deriving (Eq, Generic, Show, NFData) instance ToJSON Entity where- toEncoding = genericToEncoding defaultOptions+ toJSON ent = object+ [ "dim" .= dim ent+ , "body" .= body ent+ , "value" .= value ent+ , "start" .= start ent+ , "end" .= end ent+ ] toJText :: ToJSON x => x -> Text toJText = Text.decodeUtf8 . LB.toStrict . encode
Duckling/Types/Stash.hs view
@@ -41,7 +41,7 @@ fromList :: [Node] -> Stash fromList ns = Stash (IntMap.fromListWith HashSet.union $ map mkKV ns) where- mkKV n@(Node { nodeRange = Range start _ }) = (start, HashSet.singleton n)+ mkKV n@Node{nodeRange = Range start _} = (start, HashSet.singleton n) union :: Stash -> Stash -> Stash union (Stash set1) (Stash set2) =
Duckling/Url/Corpus.hs view
@@ -70,4 +70,13 @@ , examples (UrlData "aMaZon.co.uk/?page=home" "amazon.co.uk") [ "aMaZon.co.uk/?page=home" ]+ , examples (UrlData "https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax" "en.wikipedia.org")+ [ "https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax"+ ]+ , examples (UrlData "http://example.com/data.csv#cell=4,1-6,2" "example.com")+ [ "http://example.com/data.csv#cell=4,1-6,2"+ ]+ , examples (UrlData "http://example.com/bar.webm#t=40,80&xywh=160,120,320,240" "example.com")+ [ "http://example.com/bar.webm#t=40,80&xywh=160,120,320,240"+ ] ]
Duckling/Url/Helpers.hs view
@@ -6,7 +6,7 @@ -- of patent rights can be found in the PATENTS file in the same directory. -{-# LANGUAGE OverloadedStrings #-}+ module Duckling.Url.Helpers ( url
Duckling/Url/Rules.hs view
@@ -24,7 +24,7 @@ ruleURL = Rule { name = "url" , pattern =- [ regex "((([a-zA-Z]+)://)?(w{2,3}[0-9]*\\.)?(([\\w_-]+\\.)+[a-z]{2,4})(:(\\d+))?(/[^?\\s#]*)?(\\?[^\\s#]+)?)"+ [ regex "((([a-zA-Z]+)://)?(w{2,3}[0-9]*\\.)?(([\\w_-]+\\.)+[a-z]{2,4})(:(\\d+))?(/[^?\\s#]*)?(\\?[^\\s#]+)?(#[\\-,*=&a-z0-9]+)?)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (m:_:_protocol:_:domain:_:_:_port:_path:_query:_)):
+ Duckling/Volume/AR/Corpus.hs view
@@ -0,0 +1,65 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Volume.AR.Corpus+ ( corpus ) where++import Data.String+import Prelude++import Duckling.Testing.Types+import Duckling.Locale+import Duckling.Resolve+import Duckling.Volume.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale AR Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (VolumeValue Millilitre 250)+ [ "250 مل"+ , "250مل"+ , "250 ميليلتر"+ , "250 ملي لتر"+ ]+ , examples (VolumeValue Litre 2)+ [ "2 لتر"+ , "لتران"+ , "لترين"+ ]+ , examples (VolumeValue Gallon 3)+ [ "3 غالون"+ , "3 جالون"+ , "3 غالونات"+ , "3 جالونات"+ ]+ , examples (VolumeValue Hectolitre 3)+ [ "3 هكتوليتر"+ , "3 هكتو ليتر"+ ]+ , examples (VolumeValue Litre 0.5)+ [ "نصف لتر"+ , "نص لتر"+ ]+ , examples (VolumeValue Litre 0.25)+ [ "ربع لتر"+ ]+ , examples (VolumeValue Litre 1.5)+ [ "لتر ونصف"+ , "لتر و نص"+ , "لتر و نصف"+ , "لتر ونص"+ ]+ , examples (VolumeValue Litre 1.25)+ [ "لتر وربع"+ , "لتر و ربع"+ ]+ ]
+ Duckling/Volume/AR/Rules.hs view
@@ -0,0 +1,98 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Volume.AR.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude++import Duckling.Dimensions.Types+import Duckling.Types+import Duckling.Volume.Helpers+import qualified Duckling.Volume.Types as TVolume++ruleHalfLiter :: Rule+ruleHalfLiter = Rule+ { name = "half liter"+ , pattern =+ [ regex "نصف? لي?تي?ر"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 0.5+ }++ruleQuartorOfLiter :: Rule+ruleQuartorOfLiter = Rule+ { name = "quartor of liter"+ , pattern =+ [ regex "ربع لي?تي?ر"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 0.25+ }++ruleLiterAndHalf :: Rule+ruleLiterAndHalf = Rule+ { name = "liter and half"+ , pattern =+ [ regex "لي?تي?ر و ?نصف?"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 1.5+ }++ruleTwoLiters :: Rule+ruleTwoLiters = Rule+ { name = "two liters"+ , pattern =+ [ regex "لي?تي?ر(ان|ين)"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 2+ }++ruleLiterAndQuartor :: Rule+ruleLiterAndQuartor = Rule+ { name = "liter and quartor"+ , pattern =+ [ regex "لي?تي?ر و ?ربع"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 1.25+ }++volumes :: [(Text, String, TVolume.Unit)]+volumes =+ [ ("<latent vol> ml" , "مي?لي?( ?لي?تي?ر)?" , TVolume.Millilitre)+ , ("<vol> hectoliters" , "هي?كتو ?لي?تر" , TVolume.Hectolitre)+ , ("<vol> liters" , "لي?تي?ر(ات)?" , TVolume.Litre)+ , ("<latent vol> gallon", "[جغق]الون(ين|ان|ات)?", TVolume.Gallon)+ ]++ruleVolumes :: [Rule]+ruleVolumes = map go volumes+ where+ go :: (Text, String, TVolume.Unit) -> Rule+ go (name, regexPattern, u) = Rule+ { name = name+ , pattern = [ dimension Volume, regex regexPattern ]+ , prod = \tokens -> case tokens of+ (Token Volume vd:_) -> Just . Token Volume $ withUnit u vd+ _ -> Nothing+ }++rules :: [Rule]+rules =+ [ ruleHalfLiter+ , ruleTwoLiters+ , ruleQuartorOfLiter+ , ruleLiterAndHalf+ , ruleLiterAndQuartor+ ]+ ++ ruleVolumes
+ Duckling/Volume/RU/Corpus.hs view
@@ -0,0 +1,59 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE OverloadedStrings #-}++module Duckling.Volume.RU.Corpus+ ( corpus+ ) where++import Data.String+import Prelude++import Duckling.Locale+import Duckling.Resolve+import Duckling.Testing.Types+import Duckling.Volume.Types++corpus :: Corpus+corpus = (testContext {locale = makeLocale RU Nothing}, allExamples)++allExamples :: [Example]+allExamples = concat+ [ examples (VolumeValue Millilitre 250)+ [ "250 миллилитров"+ , "250мл"+ , "250 мл"+ ]+ , examples (VolumeValue Litre 2)+ [ "2 литра"+ , "2 л"+ , "два литра"+ ]+ , examples (VolumeValue Litre 1)+ [ "1 литр"+ , "один литр"+ , "1л"+ ]+ , examples (VolumeValue Gallon 3)+ [ "3 галлона"+ ]+ , examples (VolumeValue Hectolitre 3)+ [ "3 гектолитра"+ , "3 гл"+ , "3гл"+ ]+ , examples (VolumeValue Litre 0.5)+ [ "пол-литра"+ , "поллитра"+ , "пол литра"+ ]+ , examples (VolumeValue Litre 1.5)+ [ "полтора литра"+ ]+ ]
+ Duckling/Volume/RU/Rules.hs view
@@ -0,0 +1,54 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++{-# LANGUAGE GADTs #-}+{-# LANGUAGE OverloadedStrings #-}++module Duckling.Volume.RU.Rules+ ( rules+ ) where++import Data.String+import Data.Text (Text)+import Prelude++import Duckling.Dimensions.Types+import Duckling.Types+import Duckling.Volume.Helpers+import qualified Duckling.Volume.Types as TVolume++ruleHalfLiter :: Rule+ruleHalfLiter = Rule+ { name = "half liter"+ , pattern =+ [ regex "пол[-\\s]?литра"+ ]+ , prod = \_ -> Just . Token Volume . withUnit TVolume.Litre $ volume 0.5+ }++volumes :: [(Text, String, TVolume.Unit)]+volumes = [ ("<latent vol> ml" , "мл|миллилитр(а|ов)?" , TVolume.Millilitre)+ , ("<vol> hectoliters" , "гл|гектолитр(а|ов)?" , TVolume.Hectolitre)+ , ("<vol> liters" , "л(итр(а|ов)?)?" , TVolume.Litre)+ , ("<latent vol> gallon", "галлон(а|ов)?" , TVolume.Gallon)+ ]++ruleVolumes :: [Rule]+ruleVolumes = map go volumes+ where+ go :: (Text, String, TVolume.Unit) -> Rule+ go (name, regexPattern, u) = Rule+ { name = name+ , pattern = [ dimension Volume, regex regexPattern ]+ , prod = \tokens -> case tokens of+ (Token Volume vd:_) -> Just . Token Volume $ withUnit u vd+ _ -> Nothing+ }++rules :: [Rule]+rules = ruleHalfLiter:ruleVolumes
Duckling/Volume/Rules.hs view
@@ -18,9 +18,9 @@ import Duckling.Dimensions.Types import Duckling.Numeral.Types (NumeralData(..))-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Types import Duckling.Volume.Helpers+import qualified Duckling.Numeral.Types as TNumeral ruleNumeralAsVolume :: Rule ruleNumeralAsVolume = Rule
README.md view
@@ -1,6 +1,6 @@-+ -# Duckling [](https://travis-ci.org/facebookincubator/duckling)+# Duckling [](https://travis-ci.org/facebook/duckling) Duckling is a Haskell library that parses text into structured data. ```@@ -35,10 +35,12 @@ See `exe/ExampleMain.hs` for an example on how to integrate Duckling in your project.+If your backend doesn't run Haskell or if you don't want to spin your own Duckling server, you can directly use [wit.ai](https://wit.ai)'s built-in entities. ## Supported dimensions Duckling supports many languages, but most don't support all dimensions yet-(we need your help!).+(**we need your help!**).+Please look into [this directory](https://github.com/facebook/duckling/blob/master/Duckling/Dimensions) for language-specific support. | Dimension | Example input | Example value output | --------- | ------------- | --------------------@@ -72,7 +74,12 @@ To add a new language: * Make sure that the language code used follows the [ISO-639-1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * The first dimension to implement is `Numeral`.-* Follow [this example](https://github.com/facebookincubator/duckling/commit/24d3f199768be970149412c95b1c1bf5d76f8240).+* Follow [this example](https://github.com/facebook/duckling/commit/24d3f199768be970149412c95b1c1bf5d76f8240).++To add a new locale:+* There should be a need for diverging rules between the locale and the language.+* Make sure that the locale code is a valid [ISO3166 alpha2 country code](https://www.iso.org/obp/ui/#search/code/).+* Follow [this example](https://github.com/facebook/duckling/commit/1ab5f447d2635fe6d48887a501d333a52adff5b9). Rules have a name, a pattern and a production. Patterns are used to perform character-level matching (regexes on input) and
duckling.cabal view
@@ -1,5 +1,5 @@ name: duckling-version: 0.1.3.0+version: 0.1.4.0 synopsis: A Haskell library for parsing text into structured data. description: Duckling is a library for parsing text into structured data.@@ -45,12 +45,14 @@ , Duckling.Rules.CS , Duckling.Rules.DA , Duckling.Rules.DE+ , Duckling.Rules.EL , Duckling.Rules.EN , Duckling.Rules.ES , Duckling.Rules.ET , Duckling.Rules.FR , Duckling.Rules.GA , Duckling.Rules.HE+ , Duckling.Rules.HI , Duckling.Rules.HR , Duckling.Rules.HU , Duckling.Rules.ID@@ -60,6 +62,7 @@ , Duckling.Rules.KO , Duckling.Rules.MY , Duckling.Rules.NB+ , Duckling.Rules.NE , Duckling.Rules.NL , Duckling.Rules.PL , Duckling.Rules.PT@@ -82,6 +85,7 @@ , Duckling.Ranking.Classifiers.CS_XX , Duckling.Ranking.Classifiers.DA_XX , Duckling.Ranking.Classifiers.DE_XX+ , Duckling.Ranking.Classifiers.EL_XX , Duckling.Ranking.Classifiers.EN_CA , Duckling.Ranking.Classifiers.EN_GB , Duckling.Ranking.Classifiers.EN_US@@ -91,6 +95,7 @@ , Duckling.Ranking.Classifiers.FR_XX , Duckling.Ranking.Classifiers.GA_XX , Duckling.Ranking.Classifiers.HE_XX+ , Duckling.Ranking.Classifiers.HI_XX , Duckling.Ranking.Classifiers.HR_XX , Duckling.Ranking.Classifiers.HU_XX , Duckling.Ranking.Classifiers.ID_XX@@ -100,6 +105,7 @@ , Duckling.Ranking.Classifiers.KO_XX , Duckling.Ranking.Classifiers.MY_XX , Duckling.Ranking.Classifiers.NB_XX+ , Duckling.Ranking.Classifiers.NE_XX , Duckling.Ranking.Classifiers.NL_XX , Duckling.Ranking.Classifiers.PL_XX , Duckling.Ranking.Classifiers.PT_XX@@ -125,12 +131,14 @@ , Duckling.Dimensions.CS , Duckling.Dimensions.DA , Duckling.Dimensions.DE+ , Duckling.Dimensions.EL , Duckling.Dimensions.EN , Duckling.Dimensions.ES , Duckling.Dimensions.ET , Duckling.Dimensions.FR , Duckling.Dimensions.GA , Duckling.Dimensions.HE+ , Duckling.Dimensions.HI , Duckling.Dimensions.HR , Duckling.Dimensions.HU , Duckling.Dimensions.ID@@ -140,6 +148,7 @@ , Duckling.Dimensions.KO , Duckling.Dimensions.MY , Duckling.Dimensions.NB+ , Duckling.Dimensions.NE , Duckling.Dimensions.NL , Duckling.Dimensions.PL , Duckling.Dimensions.PT@@ -152,6 +161,8 @@ , Duckling.Dimensions.ZH -- AmountOfMoney+ , Duckling.AmountOfMoney.AR.Corpus+ , Duckling.AmountOfMoney.AR.Rules , Duckling.AmountOfMoney.EN.Corpus , Duckling.AmountOfMoney.EN.Rules , Duckling.AmountOfMoney.BG.Corpus@@ -174,6 +185,8 @@ , Duckling.AmountOfMoney.PT.Rules , Duckling.AmountOfMoney.RO.Corpus , Duckling.AmountOfMoney.RO.Rules+ , Duckling.AmountOfMoney.RU.Corpus+ , Duckling.AmountOfMoney.RU.Rules , Duckling.AmountOfMoney.SV.Corpus , Duckling.AmountOfMoney.SV.Rules , Duckling.AmountOfMoney.VI.Corpus@@ -203,6 +216,8 @@ , Duckling.Distance.NL.Rules , Duckling.Distance.RO.Corpus , Duckling.Distance.RO.Rules+ , Duckling.Distance.RU.Corpus+ , Duckling.Distance.RU.Rules , Duckling.Distance.TR.Corpus , Duckling.Distance.TR.Rules , Duckling.Distance.Helpers@@ -210,8 +225,12 @@ , Duckling.Distance.Types -- Duration+ , Duckling.Duration.AR.Corpus+ , Duckling.Duration.AR.Rules , Duckling.Duration.DA.Rules , Duckling.Duration.DE.Rules+ , Duckling.Duration.EL.Corpus+ , Duckling.Duration.EL.Rules , Duckling.Duration.EN.Corpus , Duckling.Duration.EN.Rules , Duckling.Duration.FR.Corpus@@ -238,6 +257,8 @@ , Duckling.Duration.ZH.Corpus , Duckling.Duration.RO.Corpus , Duckling.Duration.RO.Rules+ , Duckling.Duration.RU.Corpus+ , Duckling.Duration.RU.Rules , Duckling.Duration.TR.Corpus , Duckling.Duration.TR.Rules , Duckling.Duration.Helpers@@ -266,6 +287,8 @@ , Duckling.Numeral.DA.Rules , Duckling.Numeral.DE.Corpus , Duckling.Numeral.DE.Rules+ , Duckling.Numeral.EL.Corpus+ , Duckling.Numeral.EL.Rules , Duckling.Numeral.EN.Corpus , Duckling.Numeral.EN.Rules , Duckling.Numeral.ES.Corpus@@ -278,6 +301,8 @@ , Duckling.Numeral.GA.Rules , Duckling.Numeral.HE.Corpus , Duckling.Numeral.HE.Rules+ , Duckling.Numeral.HI.Corpus+ , Duckling.Numeral.HI.Rules , Duckling.Numeral.HR.Corpus , Duckling.Numeral.HR.Rules , Duckling.Numeral.HU.Corpus@@ -296,6 +321,8 @@ , Duckling.Numeral.MY.Rules , Duckling.Numeral.NB.Corpus , Duckling.Numeral.NB.Rules+ , Duckling.Numeral.NE.Corpus+ , Duckling.Numeral.NE.Rules , Duckling.Numeral.NL.Corpus , Duckling.Numeral.NL.Rules , Duckling.Numeral.PL.Corpus@@ -317,6 +344,7 @@ , Duckling.Numeral.RO.Corpus , Duckling.Numeral.RO.Rules , Duckling.Numeral.Helpers+ , Duckling.Numeral.Rules , Duckling.Numeral.Types -- Ordinal@@ -326,6 +354,8 @@ , Duckling.Ordinal.DA.Rules , Duckling.Ordinal.DE.Corpus , Duckling.Ordinal.DE.Rules+ , Duckling.Ordinal.EL.Corpus+ , Duckling.Ordinal.EL.Rules , Duckling.Ordinal.EN.Corpus , Duckling.Ordinal.EN.Rules , Duckling.Ordinal.ES.Corpus@@ -338,6 +368,8 @@ , Duckling.Ordinal.GA.Rules , Duckling.Ordinal.HE.Corpus , Duckling.Ordinal.HE.Rules+ , Duckling.Ordinal.HI.Corpus+ , Duckling.Ordinal.HI.Rules , Duckling.Ordinal.HR.Corpus , Duckling.Ordinal.HR.Rules , Duckling.Ordinal.HU.Corpus@@ -383,6 +415,8 @@ , Duckling.PhoneNumber.Types -- Quantity+ , Duckling.Quantity.AR.Corpus+ , Duckling.Quantity.AR.Rules , Duckling.Quantity.EN.Corpus , Duckling.Quantity.EN.Rules , Duckling.Quantity.FR.Corpus@@ -395,6 +429,8 @@ , Duckling.Quantity.PT.Rules , Duckling.Quantity.RO.Corpus , Duckling.Quantity.RO.Rules+ , Duckling.Quantity.RU.Corpus+ , Duckling.Quantity.RU.Rules , Duckling.Quantity.Helpers , Duckling.Quantity.Types @@ -402,6 +438,8 @@ , Duckling.Regex.Types -- Temperature+ , Duckling.Temperature.AR.Corpus+ , Duckling.Temperature.AR.Rules , Duckling.Temperature.EN.Corpus , Duckling.Temperature.EN.Rules , Duckling.Temperature.ES.Corpus@@ -431,18 +469,40 @@ , Duckling.Temperature.Types -- Time+ , Duckling.Time.AR.Corpus+ , Duckling.Time.AR.Rules , Duckling.Time.DA.Corpus , Duckling.Time.DA.Rules , Duckling.Time.DE.Corpus , Duckling.Time.DE.Rules+ , Duckling.Time.EL.Corpus+ , Duckling.Time.EL.Rules , Duckling.Time.EN.Corpus , Duckling.Time.EN.Rules+ , Duckling.Time.EN.AU.Corpus+ , Duckling.Time.EN.AU.Rules+ , Duckling.Time.EN.BZ.Corpus+ , Duckling.Time.EN.BZ.Rules , Duckling.Time.EN.CA.Corpus , Duckling.Time.EN.CA.Rules , Duckling.Time.EN.GB.Corpus , Duckling.Time.EN.GB.Rules+ , Duckling.Time.EN.IE.Corpus+ , Duckling.Time.EN.IE.Rules+ , Duckling.Time.EN.IN.Corpus+ , Duckling.Time.EN.IN.Rules+ , Duckling.Time.EN.JM.Corpus+ , Duckling.Time.EN.JM.Rules+ , Duckling.Time.EN.NZ.Corpus+ , Duckling.Time.EN.NZ.Rules+ , Duckling.Time.EN.PH.Corpus+ , Duckling.Time.EN.PH.Rules+ , Duckling.Time.EN.TT.Corpus+ , Duckling.Time.EN.TT.Rules , Duckling.Time.EN.US.Corpus , Duckling.Time.EN.US.Rules+ , Duckling.Time.EN.ZA.Corpus+ , Duckling.Time.EN.ZA.Rules , Duckling.Time.ES.Corpus , Duckling.Time.ES.Rules , Duckling.Time.FR.Corpus@@ -461,6 +521,8 @@ , Duckling.Time.KO.Rules , Duckling.Time.NB.Corpus , Duckling.Time.NB.Rules+ , Duckling.Time.NL.Corpus+ , Duckling.Time.NL.Rules , Duckling.Time.PL.Corpus , Duckling.Time.PL.Rules , Duckling.Time.PT.Corpus@@ -488,9 +550,11 @@ , Duckling.Time.TimeZone.Parse -- TimeGrain+ , Duckling.TimeGrain.AR.Rules , Duckling.TimeGrain.DA.Rules , Duckling.TimeGrain.DE.Rules , Duckling.TimeGrain.EN.Rules+ , Duckling.TimeGrain.EL.Rules , Duckling.TimeGrain.ES.Rules , Duckling.TimeGrain.FR.Rules , Duckling.TimeGrain.GA.Rules@@ -505,6 +569,7 @@ , Duckling.TimeGrain.PL.Rules , Duckling.TimeGrain.PT.Rules , Duckling.TimeGrain.RO.Rules+ , Duckling.TimeGrain.RU.Rules , Duckling.TimeGrain.SV.Rules , Duckling.TimeGrain.TR.Rules , Duckling.TimeGrain.VI.Rules@@ -518,6 +583,8 @@ , Duckling.Url.Types -- Volume+ , Duckling.Volume.AR.Corpus+ , Duckling.Volume.AR.Rules , Duckling.Volume.EN.Corpus , Duckling.Volume.EN.Rules , Duckling.Volume.ES.Corpus@@ -538,6 +605,8 @@ , Duckling.Volume.NL.Rules , Duckling.Volume.RO.Corpus , Duckling.Volume.RO.Rules+ , Duckling.Volume.RU.Corpus+ , Duckling.Volume.RU.Rules , Duckling.Volume.TR.Corpus , Duckling.Volume.TR.Rules , Duckling.Volume.Helpers@@ -546,12 +615,12 @@ build-depends: base >= 4.8.2 && < 5.0 , array >= 0.5.1.1 && < 0.6 , attoparsec >= 0.13.1.0 && < 0.14- , aeson >= 0.11.3.0 && < 1.1+ , aeson >= 0.11.3.0 && < 1.3 , bytestring >= 0.10.6.0 && < 0.11 , containers >= 0.5.6.2 && < 0.6 , deepseq >= 1.4.1.1 && < 1.5 , dependent-sum >= 0.3.2.2 && < 0.5- , extra >= 1.4.10 && < 1.6+ , extra >= 1.4.10 && < 1.7 , hashable >= 1.2.4.0 && < 1.3 , regex-base >= 0.93.2 && < 0.94 , regex-pcre >= 0.94.4 && < 0.95@@ -586,6 +655,7 @@ , Duckling.Dimensions.Tests -- AmountOfMoney+ , Duckling.AmountOfMoney.AR.Tests , Duckling.AmountOfMoney.EN.Tests , Duckling.AmountOfMoney.BG.Tests , Duckling.AmountOfMoney.ES.Tests@@ -597,6 +667,7 @@ , Duckling.AmountOfMoney.NB.Tests , Duckling.AmountOfMoney.PT.Tests , Duckling.AmountOfMoney.RO.Tests+ , Duckling.AmountOfMoney.RU.Tests , Duckling.AmountOfMoney.SV.Tests , Duckling.AmountOfMoney.VI.Tests , Duckling.AmountOfMoney.Tests@@ -612,10 +683,13 @@ , Duckling.Distance.NL.Tests , Duckling.Distance.PT.Tests , Duckling.Distance.RO.Tests+ , Duckling.Distance.RU.Tests , Duckling.Distance.TR.Tests , Duckling.Distance.Tests -- Duration+ , Duckling.Duration.AR.Tests+ , Duckling.Duration.EL.Tests , Duckling.Duration.EN.Tests , Duckling.Duration.FR.Tests , Duckling.Duration.GA.Tests@@ -627,6 +701,7 @@ , Duckling.Duration.PL.Tests , Duckling.Duration.PT.Tests , Duckling.Duration.RO.Tests+ , Duckling.Duration.RU.Tests , Duckling.Duration.SV.Tests , Duckling.Duration.TR.Tests , Duckling.Duration.ZH.Tests@@ -644,12 +719,14 @@ , Duckling.Numeral.CS.Tests , Duckling.Numeral.DA.Tests , Duckling.Numeral.DE.Tests+ , Duckling.Numeral.EL.Tests , Duckling.Numeral.EN.Tests , Duckling.Numeral.ES.Tests , Duckling.Numeral.ET.Tests , Duckling.Numeral.FR.Tests , Duckling.Numeral.GA.Tests , Duckling.Numeral.HE.Tests+ , Duckling.Numeral.HI.Tests , Duckling.Numeral.HR.Tests , Duckling.Numeral.HU.Tests , Duckling.Numeral.ID.Tests@@ -659,6 +736,7 @@ , Duckling.Numeral.KO.Tests , Duckling.Numeral.MY.Tests , Duckling.Numeral.NB.Tests+ , Duckling.Numeral.NE.Tests , Duckling.Numeral.NL.Tests , Duckling.Numeral.PL.Tests , Duckling.Numeral.PT.Tests@@ -675,12 +753,14 @@ , Duckling.Ordinal.AR.Tests , Duckling.Ordinal.DA.Tests , Duckling.Ordinal.DE.Tests+ , Duckling.Ordinal.EL.Tests , Duckling.Ordinal.EN.Tests , Duckling.Ordinal.ES.Tests , Duckling.Ordinal.ET.Tests , Duckling.Ordinal.FR.Tests , Duckling.Ordinal.GA.Tests , Duckling.Ordinal.HE.Tests+ , Duckling.Ordinal.HI.Tests , Duckling.Ordinal.HR.Tests , Duckling.Ordinal.HU.Tests , Duckling.Ordinal.ID.Tests@@ -705,15 +785,18 @@ , Duckling.PhoneNumber.Tests -- Quantity+ , Duckling.Quantity.AR.Tests , Duckling.Quantity.EN.Tests , Duckling.Quantity.FR.Tests , Duckling.Quantity.HR.Tests , Duckling.Quantity.KO.Tests , Duckling.Quantity.PT.Tests , Duckling.Quantity.RO.Tests+ , Duckling.Quantity.RU.Tests , Duckling.Quantity.Tests -- Temperature+ , Duckling.Temperature.AR.Tests , Duckling.Temperature.EN.Tests , Duckling.Temperature.ES.Tests , Duckling.Temperature.FR.Tests@@ -729,8 +812,10 @@ , Duckling.Temperature.Tests -- Time+ , Duckling.Time.AR.Tests , Duckling.Time.DA.Tests , Duckling.Time.DE.Tests+ , Duckling.Time.EL.Tests , Duckling.Time.EN.Tests , Duckling.Time.ES.Tests , Duckling.Time.FR.Tests@@ -741,6 +826,7 @@ , Duckling.Time.IT.Tests , Duckling.Time.KO.Tests , Duckling.Time.NB.Tests+ , Duckling.Time.NL.Tests , Duckling.Time.PL.Tests , Duckling.Time.PT.Tests , Duckling.Time.RO.Tests@@ -753,6 +839,7 @@ , Duckling.Url.Tests -- Volume+ , Duckling.Volume.AR.Tests , Duckling.Volume.EN.Tests , Duckling.Volume.ES.Tests , Duckling.Volume.FR.Tests@@ -763,6 +850,7 @@ , Duckling.Volume.PT.Tests , Duckling.Volume.NL.Tests , Duckling.Volume.RO.Tests+ , Duckling.Volume.RU.Tests , Duckling.Volume.TR.Tests , Duckling.Volume.Tests @@ -778,7 +866,7 @@ , Duckling.Ranking.Generate build-depends: duckling , base- , haskell-src-exts >= 1.18 && < 1.19+ , haskell-src-exts >= 1.18 && < 1.20 , text , unordered-containers default-language: Haskell2010
exe/Duckling/Ranking/Generate.hs view
@@ -27,8 +27,10 @@ import Duckling.Ranking.Types import Duckling.Rules import Duckling.Testing.Types+import qualified Duckling.Time.AR.Corpus as ARTime import qualified Duckling.Time.DA.Corpus as DATime import qualified Duckling.Time.DE.Corpus as DETime+import qualified Duckling.Time.EL.Corpus as ELTime import qualified Duckling.Time.EN.Corpus as ENTime import qualified Duckling.Time.EN.CA.Corpus as EN_CATime import qualified Duckling.Time.EN.GB.Corpus as EN_GBTime@@ -42,6 +44,7 @@ import qualified Duckling.Time.IT.Corpus as ITTime import qualified Duckling.Time.KO.Corpus as KOTime import qualified Duckling.Time.NB.Corpus as NBTime+import qualified Duckling.Time.NL.Corpus as NLTime import qualified Duckling.Time.PL.Corpus as PLTime import qualified Duckling.Time.PT.Corpus as PTTime import qualified Duckling.Time.RO.Corpus as ROTime@@ -157,11 +160,12 @@ getDefaultCorpusForLang lang = getCorpusForLang lang getCorpusForLang :: Lang -> Corpus-getCorpusForLang AR = (testContext, [])+getCorpusForLang AR = ARTime.corpus getCorpusForLang BG = (testContext, []) getCorpusForLang CS = (testContext, []) getCorpusForLang DA = DATime.corpus getCorpusForLang DE = DETime.corpus+getCorpusForLang EL = ELTime.corpus getCorpusForLang EN = ENTime.corpus getCorpusForLang ES = ESTime.corpus getCorpusForLang ET = (testContext, [])@@ -170,6 +174,7 @@ getCorpusForLang HR = HRTime.corpus getCorpusForLang HE = HETime.corpus getCorpusForLang HU = HUTime.corpus+getCorpusForLang HI = (testContext, []) getCorpusForLang ID = (testContext, []) getCorpusForLang IT = ITTime.corpus getCorpusForLang JA = (testContext, [])@@ -177,7 +182,8 @@ getCorpusForLang KO = KOTime.corpus getCorpusForLang MY = (testContext, []) getCorpusForLang NB = NBTime.corpus-getCorpusForLang NL = (testContext, [])+getCorpusForLang NE = (testContext, [])+getCorpusForLang NL = NLTime.corpus getCorpusForLang PL = PLTime.corpus getCorpusForLang PT = PTTime.corpus getCorpusForLang RO = ROTime.corpus
exe/ExampleMain.hs view
@@ -28,11 +28,13 @@ import qualified Data.Text as Text import qualified Data.Text.Encoding as Text +import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import Snap.Core import Snap.Http.Server import Duckling.Core import Duckling.Data.TimeZone+import Duckling.Resolve (DucklingTime) createIfMissing :: FilePath -> IO () createIfMissing f = do@@ -76,17 +78,18 @@ ds <- getPostParam "dims" tz <- getPostParam "tz" loc <- getPostParam "locale"+ ref <- getPostParam "reftime" case t of Nothing -> do modifyResponse $ setResponseStatus 422 "Bad Input" writeBS "Need a 'text' parameter to parse" Just tx -> do- refTime <- liftIO $ currentReftime tzs $- fromMaybe defaultTimeZone $ Text.decodeUtf8 <$> tz+ let timezone = parseTimeZone tz+ now <- liftIO $ currentReftime tzs timezone let context = Context- { referenceTime = refTime+ { referenceTime = maybe now (parseRefTime timezone) ref , locale = maybe (makeLocale (parseLang l) Nothing) parseLocale loc } @@ -101,6 +104,9 @@ defaultLocale = makeLocale defaultLang Nothing defaultTimeZone = "America/Los_Angeles" + parseTimeZone :: Maybe ByteString -> Text+ parseTimeZone = fromMaybe defaultTimeZone . fmap Text.decodeUtf8+ parseLocale :: ByteString -> Locale parseLocale x = maybe defaultLocale (`makeLocale` mregion) mlang where@@ -113,3 +119,9 @@ parseLang :: Maybe ByteString -> Lang parseLang l = fromMaybe defaultLang $ l >>= readMaybe . Text.unpack . Text.toUpper . Text.decodeUtf8++ parseRefTime :: Text -> ByteString -> DucklingTime+ parseRefTime timezone refTime = makeReftime tzs timezone utcTime+ where+ msec = read $ Text.unpack $ Text.decodeUtf8 refTime+ utcTime = posixSecondsToUTCTime $ fromInteger msec / 1000
+ tests/Duckling/AmountOfMoney/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.AmountOfMoney.AR.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.AmountOfMoney.AR.Corpus+import Duckling.Dimensions.Types+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This AmountOfMoney] corpus+ ]
tests/Duckling/AmountOfMoney/EN/Tests.hs view
@@ -7,17 +7,48 @@ module Duckling.AmountOfMoney.EN.Tests- ( tests ) where+ ( tests+ ) where -import Prelude import Data.String+import Prelude import Test.Tasty+import Test.Tasty.HUnit -import Duckling.Dimensions.Types import Duckling.AmountOfMoney.EN.Corpus+import Duckling.Dimensions.Types import Duckling.Testing.Asserts+import Duckling.Testing.Types (testContext)+import Duckling.Types (Range(..)) tests :: TestTree tests = testGroup "EN Tests" [ makeCorpusTest [This AmountOfMoney] corpus+ , makeNegativeCorpusTest [This AmountOfMoney] negativeCorpus+ , intersectTests+ , rangeTests ]++intersectTests :: TestTree+intersectTests = testCase "Intersect Test" $+ mapM_ (analyzedNTest testContext . withTargets [This AmountOfMoney]) xs+ where+ xs = [ ("7c7", 2)+ , ("7c7c", 3)+ , ("10 dollars 0.17", 2)+ , ("1.1 dollars 6", 2)+ , ("10 cents and 8 cents", 2)+ , ("10 dollars and 2 dollars", 2)+ , ("between 4.1 dollars and 4 dollars", 3)+ , ("between 4 dollars and 7 euros", 2)+ ]++rangeTests :: TestTree+rangeTests = testCase "Range Test" $+ mapM_ (analyzedRangeTest testContext . withTargets [This AmountOfMoney]) xs+ where+ xs = [ ("between 3 and 1 dollars", Range 14 23)+ , ("between 1 and between 2 and 3 dollars", Range 14 37)+ , ("10 cents and 0.1", Range 0 8)+ , ("Pay Kiran1 10eur", Range 11 16)+ ]
tests/Duckling/AmountOfMoney/FR/Tests.hs view
@@ -9,13 +9,13 @@ module Duckling.AmountOfMoney.FR.Tests ( tests ) where -import Prelude import Data.String+import Prelude import Test.Tasty +import Duckling.AmountOfMoney.FR.Corpus import Duckling.Dimensions.Types import Duckling.Testing.Asserts-import Duckling.AmountOfMoney.FR.Corpus tests :: TestTree tests = testGroup "FR Tests"
+ tests/Duckling/AmountOfMoney/RU/Tests.hs view
@@ -0,0 +1,23 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.AmountOfMoney.RU.Tests+ ( tests ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.AmountOfMoney.RU.Corpus+import Duckling.Dimensions.Types+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "RU Tests"+ [ makeCorpusTest [This AmountOfMoney] corpus+ ]
tests/Duckling/AmountOfMoney/Tests.hs view
@@ -12,6 +12,7 @@ import Prelude import Test.Tasty +import qualified Duckling.AmountOfMoney.AR.Tests as AR import qualified Duckling.AmountOfMoney.EN.Tests as EN import qualified Duckling.AmountOfMoney.BG.Tests as BG import qualified Duckling.AmountOfMoney.ES.Tests as ES@@ -23,12 +24,14 @@ import qualified Duckling.AmountOfMoney.NB.Tests as NB import qualified Duckling.AmountOfMoney.PT.Tests as PT import qualified Duckling.AmountOfMoney.RO.Tests as RO+import qualified Duckling.AmountOfMoney.RU.Tests as RU import qualified Duckling.AmountOfMoney.SV.Tests as SV import qualified Duckling.AmountOfMoney.VI.Tests as VI tests :: TestTree tests = testGroup "AmountOfMoney Tests"- [ EN.tests+ [ AR.tests+ , EN.tests , BG.tests , ES.tests , FR.tests@@ -39,6 +42,7 @@ , NB.tests , PT.tests , RO.tests+ , RU.tests , SV.tests , VI.tests ]
tests/Duckling/Api/Tests.hs view
@@ -10,23 +10,25 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} -module Duckling.Api.Tests (tests) where+module Duckling.Api.Tests+ ( tests+ ) where -import qualified Data.HashMap.Strict as HashMap-import qualified Data.HashSet as HashSet import Data.List (sortOn) import Data.Text (Text) import Prelude import Test.Tasty import Test.Tasty.HUnit+import qualified Data.HashMap.Strict as HashMap+import qualified Data.HashSet as HashSet import Duckling.Api import Duckling.Dimensions.Types import Duckling.Locale-import qualified Duckling.Numeral.Types as TNumeral import Duckling.Testing.Asserts import Duckling.Testing.Types import Duckling.Types+import qualified Duckling.Numeral.Types as TNumeral tests :: TestTree tests = testGroup "API Tests"@@ -40,7 +42,7 @@ parseTest = testCase "Parse Test" $ case parse sentence testContext [This Numeral] of [] -> assertFailure "empty result"- (Entity dim body value start end:_) -> do+ (Entity dim body value start end _:_) -> do assertEqual "dim" "number" dim assertEqual "body" "42" body assertEqual "value" val (toJText value)@@ -120,7 +122,8 @@ mapM_ check [ ( AR , [ This Email, This AmountOfMoney, This PhoneNumber, This Url- , This Numeral, This Ordinal+ , This Duration, This Numeral, This Ordinal, This Time, This Volume+ , This Temperature, This Quantity ] ) , ( PL@@ -134,4 +137,5 @@ check (l, expected) = case HashMap.lookup l supportedDimensions of Nothing -> assertFailure $ "no dimensions for " ++ show l Just actual ->- assertEqual ("wrong dimensions for " ++ show l) expected actual+ assertEqual ("wrong dimensions for " ++ show l)+ (HashSet.fromList expected) (HashSet.fromList actual)
+ tests/Duckling/Distance/RU/Tests.hs view
@@ -0,0 +1,23 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Distance.RU.Tests+ ( tests ) where++import Prelude+import Data.String+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Distance.RU.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "RU Tests"+ [ makeCorpusTest [This Distance] corpus+ ]
tests/Duckling/Distance/Tests.hs view
@@ -22,6 +22,7 @@ import qualified Duckling.Distance.NL.Tests as NL import qualified Duckling.Distance.PT.Tests as PT import qualified Duckling.Distance.RO.Tests as RO+import qualified Duckling.Distance.RU.Tests as RU import qualified Duckling.Distance.TR.Tests as TR tests :: TestTree@@ -36,5 +37,6 @@ , NL.tests , PT.tests , RO.tests+ , RU.tests , TR.tests ]
+ tests/Duckling/Duration/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Duration.AR.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Duration.AR.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This Duration] corpus+ ]
+ tests/Duckling/Duration/EL/Tests.hs view
@@ -0,0 +1,25 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Duration.EL.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Duration.EL.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "EL Tests"+ [ makeCorpusTest [This Duration] corpus+ , makeNegativeCorpusTest [This Duration] negativeCorpus+ ]
+ tests/Duckling/Duration/RU/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Duration.RU.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Duration.RU.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "RU Tests"+ [ makeCorpusTest [This Duration] corpus+ ]
tests/Duckling/Duration/Tests.hs view
@@ -10,10 +10,12 @@ ( tests ) where -import Prelude import Data.String+import Prelude import Test.Tasty +import qualified Duckling.Duration.AR.Tests as AR+import qualified Duckling.Duration.EL.Tests as EL import qualified Duckling.Duration.EN.Tests as EN import qualified Duckling.Duration.FR.Tests as FR import qualified Duckling.Duration.GA.Tests as GA@@ -25,13 +27,16 @@ import qualified Duckling.Duration.PL.Tests as PL import qualified Duckling.Duration.PT.Tests as PT import qualified Duckling.Duration.RO.Tests as RO+import qualified Duckling.Duration.RU.Tests as RU import qualified Duckling.Duration.SV.Tests as SV import qualified Duckling.Duration.TR.Tests as TR import qualified Duckling.Duration.ZH.Tests as ZH tests :: TestTree tests = testGroup "Duration Tests"- [ EN.tests+ [ AR.tests+ , EL.tests+ , EN.tests , FR.tests , GA.tests , HU.tests@@ -42,6 +47,7 @@ , PL.tests , PT.tests , RO.tests+ , RU.tests , SV.tests , TR.tests , ZH.tests
+ tests/Duckling/Numeral/EL/Tests.hs view
@@ -0,0 +1,22 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++module Duckling.Numeral.EL.Tests+ ( tests ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Numeral.EL.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "EL Tests"+ [ makeCorpusTest [This Numeral] corpus+ ]
tests/Duckling/Numeral/EN/Tests.hs view
@@ -22,11 +22,14 @@ import Duckling.Numeral.Types import Duckling.Testing.Asserts import Duckling.Testing.Types+import Duckling.Types (Range(..)) tests :: TestTree tests = testGroup "EN Tests" [ makeCorpusTest [This Numeral] corpus , surroundTests+ , intersectTests+ , rangeTests ] surroundTests :: TestTree@@ -45,3 +48,19 @@ [ "10.99$" ] ]++intersectTests :: TestTree+intersectTests = testCase "Intersect Test" $+ mapM_ (analyzedNTest testContext . withTargets [This Numeral]) xs+ where+ xs = [ ("10 millions minus 10", 2)+ ]++rangeTests :: TestTree+rangeTests = testCase "Range Test" $+ mapM_ (analyzedRangeTest testContext . withTargets [This Numeral]) xs+ where+ xs = [ ("negative negative 5", Range 9 19) -- prevent double negatives+ , ("negative-5", Range 8 10) -- prevent double negatives+ , ("- -5", Range 2 4) -- prevent clash with engine tokenizer+ ]
+ tests/Duckling/Numeral/HI/Tests.hs view
@@ -0,0 +1,23 @@+--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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++module Duckling.Numeral.HI.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Numeral.HI.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "HI Tests"+ [ makeCorpusTest [This Numeral] corpus+ ]
+ tests/Duckling/Numeral/NE/Tests.hs view
@@ -0,0 +1,23 @@+--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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.++module Duckling.Numeral.NE.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Numeral.NE.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "NE Tests"+ [ makeCorpusTest [This Numeral] corpus+ ]
tests/Duckling/Numeral/Tests.hs view
@@ -17,12 +17,14 @@ import qualified Duckling.Numeral.CS.Tests as CS import qualified Duckling.Numeral.DA.Tests as DA import qualified Duckling.Numeral.DE.Tests as DE+import qualified Duckling.Numeral.EL.Tests as EL import qualified Duckling.Numeral.EN.Tests as EN import qualified Duckling.Numeral.ES.Tests as ES import qualified Duckling.Numeral.ET.Tests as ET import qualified Duckling.Numeral.FR.Tests as FR import qualified Duckling.Numeral.GA.Tests as GA import qualified Duckling.Numeral.HE.Tests as HE+import qualified Duckling.Numeral.HI.Tests as HI import qualified Duckling.Numeral.HR.Tests as HR import qualified Duckling.Numeral.HU.Tests as HU import qualified Duckling.Numeral.ID.Tests as ID@@ -32,6 +34,7 @@ import qualified Duckling.Numeral.KO.Tests as KO import qualified Duckling.Numeral.MY.Tests as MY import qualified Duckling.Numeral.NB.Tests as NB+import qualified Duckling.Numeral.NE.Tests as NE import qualified Duckling.Numeral.NL.Tests as NL import qualified Duckling.Numeral.PL.Tests as PL import qualified Duckling.Numeral.PT.Tests as PT@@ -50,12 +53,14 @@ , CS.tests , DA.tests , DE.tests+ , EL.tests , EN.tests , ES.tests , ET.tests , FR.tests , GA.tests , HE.tests+ , HI.tests , HR.tests , HU.tests , ID.tests@@ -65,6 +70,7 @@ , KO.tests , MY.tests , NB.tests+ , NE.tests , NL.tests , PL.tests , PT.tests
+ tests/Duckling/Ordinal/EL/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Ordinal.EL.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Ordinal.EL.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "EL Tests"+ [ makeCorpusTest [This Ordinal] corpus+ ]
+ tests/Duckling/Ordinal/HI/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Ordinal.HI.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Ordinal.HI.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "HI Tests"+ [ makeCorpusTest [This Ordinal] corpus+ ]
tests/Duckling/Ordinal/Tests.hs view
@@ -15,12 +15,14 @@ import qualified Duckling.Ordinal.AR.Tests as AR import qualified Duckling.Ordinal.DA.Tests as DA import qualified Duckling.Ordinal.DE.Tests as DE+import qualified Duckling.Ordinal.EL.Tests as EL import qualified Duckling.Ordinal.EN.Tests as EN import qualified Duckling.Ordinal.ES.Tests as ES import qualified Duckling.Ordinal.ET.Tests as ET import qualified Duckling.Ordinal.FR.Tests as FR import qualified Duckling.Ordinal.GA.Tests as GA import qualified Duckling.Ordinal.HE.Tests as HE+import qualified Duckling.Ordinal.HI.Tests as HI import qualified Duckling.Ordinal.HR.Tests as HR import qualified Duckling.Ordinal.HU.Tests as HU import qualified Duckling.Ordinal.ID.Tests as ID@@ -44,12 +46,14 @@ [ AR.tests , DA.tests , DE.tests+ , EL.tests , EN.tests , ES.tests , ET.tests , FR.tests , GA.tests , HE.tests+ , HI.tests , HR.tests , HU.tests , ID.tests
+ tests/Duckling/Quantity/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Quantity.AR.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Quantity.AR.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This Quantity] corpus+ ]
tests/Duckling/Quantity/EN/Tests.hs view
@@ -10,8 +10,8 @@ ( tests ) where -import Prelude import Data.String+import Prelude import Test.Tasty import Duckling.Dimensions.Types
+ tests/Duckling/Quantity/RU/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Quantity.RU.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Quantity.RU.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "RU Tests"+ [ makeCorpusTest [This Quantity] corpus+ ]
tests/Duckling/Quantity/Tests.hs view
@@ -6,25 +6,31 @@ -- of patent rights can be found in the PATENTS file in the same directory. -module Duckling.Quantity.Tests (tests) where+module Duckling.Quantity.Tests+ ( tests+ ) where -import Prelude import Data.String+import Prelude import Test.Tasty +import qualified Duckling.Quantity.AR.Tests as AR import qualified Duckling.Quantity.EN.Tests as EN import qualified Duckling.Quantity.FR.Tests as FR import qualified Duckling.Quantity.HR.Tests as HR import qualified Duckling.Quantity.KO.Tests as KO import qualified Duckling.Quantity.PT.Tests as PT import qualified Duckling.Quantity.RO.Tests as RO+import qualified Duckling.Quantity.RU.Tests as RU tests :: TestTree tests = testGroup "Quantity Tests"- [ EN.tests+ [ AR.tests+ , EN.tests , FR.tests , HR.tests , KO.tests , PT.tests , RO.tests+ , RU.tests ]
+ tests/Duckling/Temperature/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Temperature.AR.Tests+ ( tests+ ) where++import Prelude+import Data.String+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Temperature.AR.Corpus+import Duckling.Testing.Asserts++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This Temperature] corpus+ ]
tests/Duckling/Temperature/Tests.hs view
@@ -12,6 +12,7 @@ import Data.String import Test.Tasty +import qualified Duckling.Temperature.AR.Tests as AR import qualified Duckling.Temperature.EN.Tests as EN import qualified Duckling.Temperature.ES.Tests as ES import qualified Duckling.Temperature.FR.Tests as FR@@ -27,7 +28,8 @@ tests :: TestTree tests = testGroup "Temperature Tests"- [ EN.tests+ [ AR.tests+ , EN.tests , ES.tests , FR.tests , GA.tests
tests/Duckling/Testing/Asserts.hs view
@@ -13,6 +13,7 @@ , analyzedFirstTest , analyzedNTest , analyzedNothingTest+ , analyzedRangeTest , makeCorpusTest , makeNegativeCorpusTest , withTargets@@ -73,6 +74,16 @@ makeNegativeCorpusTest :: [Some Dimension] -> NegativeCorpus -> TestTree makeNegativeCorpusTest targets (context, xs) = testCase "Negative Corpus Tests" $ mapM_ (analyzedNothingTest context . (, targets)) xs++analyzedRangeTest :: Context -> (Text, [Some Dimension], Range) -> IO ()+analyzedRangeTest context (input, targets, expRange) = case tokens of+ [] -> assertFailure $ "empty result on " ++ show input+ (_:_:_) -> assertFailure $+ show (length tokens) ++ " tokens found for " ++ show input+ (token:_) ->+ assertEqual ("wrong range for " ++ show input) expRange (range token)+ where+ tokens = analyze input context $ HashSet.fromList targets analyzedNothingTest :: Context -> (Text, [Some Dimension]) -> IO () analyzedNothingTest context (input, targets) =
+ tests/Duckling/Time/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Time.AR.Tests+ ( tests ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Testing.Asserts+import Duckling.Time.AR.Corpus++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This Time] corpus+ , makeNegativeCorpusTest [This Time] negativeCorpus+ ]
+ tests/Duckling/Time/EL/Tests.hs view
@@ -0,0 +1,23 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Time.EL.Tests+ ( tests ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Testing.Asserts+import Duckling.Time.EL.Corpus++tests :: TestTree+tests = testGroup "EL Tests"+ [ makeCorpusTest [This Time] corpus+ ]
tests/Duckling/Time/EN/Tests.hs view
@@ -29,9 +29,19 @@ import Duckling.Time.Corpus import Duckling.Time.EN.Corpus import Duckling.TimeGrain.Types (Grain(..))+import Duckling.Types (Range(..))+import qualified Duckling.Time.EN.AU.Corpus as AU+import qualified Duckling.Time.EN.BZ.Corpus as BZ import qualified Duckling.Time.EN.CA.Corpus as CA import qualified Duckling.Time.EN.GB.Corpus as GB+import qualified Duckling.Time.EN.IE.Corpus as IE+import qualified Duckling.Time.EN.IN.Corpus as IN+import qualified Duckling.Time.EN.JM.Corpus as JM+import qualified Duckling.Time.EN.NZ.Corpus as NZ+import qualified Duckling.Time.EN.PH.Corpus as PH+import qualified Duckling.Time.EN.TT.Corpus as TT import qualified Duckling.Time.EN.US.Corpus as US+import qualified Duckling.Time.EN.ZA.Corpus as ZA tests :: TestTree tests = testGroup "EN Tests"@@ -40,12 +50,21 @@ , exactSecondTests , valuesTest , intersectTests+ , rangeTests , localeTests ] localeTests :: TestTree localeTests = testGroup "Locale Tests"- [ testGroup "EN_CA Tests"+ [ testGroup "EN_AU Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeAU AU.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeAU []+ ]+ , testGroup "EN_BZ Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeBZ BZ.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeBZ []+ ]+ , testGroup "EN_CA Tests" [ makeCorpusTest [This Time] $ withLocale corpus localeCA CA.allExamples , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeCA [] ]@@ -53,15 +72,52 @@ [ makeCorpusTest [This Time] $ withLocale corpus localeGB GB.allExamples , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeGB [] ]+ , testGroup "EN_IE Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeIE IE.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeIE []+ ]+ , testGroup "EN_IN Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeIN IN.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeIN []+ ]+ , testGroup "EN_JM Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeJM JM.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeJM []+ ]+ , testGroup "EN_NZ Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeNZ NZ.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeNZ []+ ]+ , testGroup "EN_PH Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localePH PH.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localePH []+ ]+ , testGroup "EN_TT Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeTT TT.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeTT []+ ] , testGroup "EN_US Tests" [ makeCorpusTest [This Time] $ withLocale corpus localeUS US.allExamples , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeUS [] ]+ , testGroup "EN_ZA Tests"+ [ makeCorpusTest [This Time] $ withLocale corpus localeZA ZA.allExamples+ , makeNegativeCorpusTest [This Time] $ withLocale negativeCorpus localeZA []+ ] ] where+ localeAU = makeLocale EN $ Just AU+ localeBZ = makeLocale EN $ Just BZ localeCA = makeLocale EN $ Just CA localeGB = makeLocale EN $ Just GB+ localeIE = makeLocale EN $ Just IE+ localeIN = makeLocale EN $ Just IN+ localeJM = makeLocale EN $ Just JM+ localeNZ = makeLocale EN $ Just NZ+ localePH = makeLocale EN $ Just PH+ localeTT = makeLocale EN $ Just TT localeUS = makeLocale EN $ Just US+ localeZA = makeLocale EN $ Just ZA exactSecondTests :: TestTree exactSecondTests = testCase "Exact Second Tests" $@@ -89,6 +145,7 @@ [ "now" , "8 o'clock tonight" , "tonight at 8 o'clock"+ , "yesterday" ] parseValuesSize :: Value -> Maybe Int parseValuesSize x = length <$> parseValues x@@ -102,4 +159,17 @@ xs = [ ("tomorrow July", 2) , ("Mar tonight", 2) , ("Feb tomorrow", 1) -- we are in February+ ]++rangeTests :: TestTree+rangeTests = testCase "Range Test" $+ mapM_ (analyzedRangeTest testContext . withTargets [This Time]) xs+ where+ xs = [ ("at 615.", Range 0 6) -- make sure ruleHHMMLatent allows this+ , ("last in 2'", Range 5 10) -- ruleLastTime too eager+ , ("this in 2'", Range 5 10) -- ruleThisTime too eager+ , ("next in 2'", Range 5 10) -- ruleNextTime too eager+ , ("this this week", Range 5 14) -- ruleThisTime too eager+ , ("one ninety nine a m", Range 11 19) -- ruleMilitarySpelledOutAMPM2+ , ("thirteen fifty nine a m", Range 15 23) -- ruleMilitarySpelledOutAMPM ]
+ tests/Duckling/Time/NL/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Time.NL.Tests+ ( tests ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Testing.Asserts+import Duckling.Time.NL.Corpus++tests :: TestTree+tests = testGroup "NL Tests"+ [ makeCorpusTest [This Time] corpus+ , makeNegativeCorpusTest [This Time] negativeCorpus+ ]
tests/Duckling/Time/Tests.hs view
@@ -24,9 +24,11 @@ import Duckling.Testing.Types import Duckling.Time.Types import Duckling.TimeGrain.Types+import qualified Duckling.Time.AR.Tests as AR import qualified Duckling.Time.DA.Tests as DA import qualified Duckling.Time.DE.Tests as DE import qualified Duckling.Time.EN.Tests as EN+import qualified Duckling.Time.EL.Tests as EL import qualified Duckling.Time.ES.Tests as ES import qualified Duckling.Time.FR.Tests as FR import qualified Duckling.Time.GA.Tests as GA@@ -36,6 +38,7 @@ import qualified Duckling.Time.IT.Tests as IT import qualified Duckling.Time.KO.Tests as KO import qualified Duckling.Time.NB.Tests as NB+import qualified Duckling.Time.NL.Tests as NL import qualified Duckling.Time.PL.Tests as PL import qualified Duckling.Time.PT.Tests as PT import qualified Duckling.Time.RO.Tests as RO@@ -45,8 +48,10 @@ tests :: TestTree tests = testGroup "Time Tests"- [ DA.tests+ [ AR.tests+ , DA.tests , DE.tests+ , EL.tests , EN.tests , ES.tests , FR.tests@@ -57,6 +62,7 @@ , IT.tests , KO.tests , NB.tests+ , NL.tests , PL.tests , PT.tests , RO.tests
+ tests/Duckling/Volume/AR/Tests.hs view
@@ -0,0 +1,24 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Volume.AR.Tests+ ( tests+ ) where++import Data.String+import Prelude+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Testing.Asserts+import Duckling.Volume.AR.Corpus++tests :: TestTree+tests = testGroup "AR Tests"+ [ makeCorpusTest [This Volume] corpus+ ]
+ tests/Duckling/Volume/RU/Tests.hs view
@@ -0,0 +1,23 @@+-- 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. An additional grant+-- of patent rights can be found in the PATENTS file in the same directory.+++module Duckling.Volume.RU.Tests+ ( tests ) where++import Prelude+import Data.String+import Test.Tasty++import Duckling.Dimensions.Types+import Duckling.Testing.Asserts+import Duckling.Volume.RU.Corpus++tests :: TestTree+tests = testGroup "RU Tests"+ [ makeCorpusTest [This Volume] corpus+ ]
tests/Duckling/Volume/Tests.hs view
@@ -6,12 +6,15 @@ -- of patent rights can be found in the PATENTS file in the same directory. -module Duckling.Volume.Tests (tests) where+module Duckling.Volume.Tests+ ( tests+ ) where -import Prelude import Data.String+import Prelude import Test.Tasty +import qualified Duckling.Volume.AR.Tests as AR import qualified Duckling.Volume.EN.Tests as EN import qualified Duckling.Volume.ES.Tests as ES import qualified Duckling.Volume.FR.Tests as FR@@ -22,11 +25,13 @@ import qualified Duckling.Volume.NL.Tests as NL import qualified Duckling.Volume.PT.Tests as PT import qualified Duckling.Volume.RO.Tests as RO+import qualified Duckling.Volume.RU.Tests as RU import qualified Duckling.Volume.TR.Tests as TR tests :: TestTree tests = testGroup "Volume Tests"- [ EN.tests+ [ AR.tests+ , EN.tests , ES.tests , FR.tests , GA.tests@@ -36,5 +41,6 @@ , NL.tests , PT.tests , RO.tests+ , RU.tests , TR.tests ]