Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Token = forall a.(Resolve a, Eq a, Hashable a, Show a, NFData a) => Token (Dimension a) a
- data Seal s where
- withSeal :: Seal s -> (forall t. s t -> r) -> r
- class (Show a, Typeable a, Typeable (DimensionData a)) => CustomDimension a where
- type DimensionData a
- dimRules :: a -> [Rule]
- dimLangRules :: Lang -> a -> [Rule]
- dimLocaleRules :: Region -> a -> [Rule]
- dimDependents :: a -> HashSet (Seal Dimension)
- data Dimension a where
- RegexMatch :: Dimension GroupMatch
- AmountOfMoney :: Dimension AmountOfMoneyData
- CreditCardNumber :: Dimension CreditCardNumberData
- Distance :: Dimension DistanceData
- Duration :: Dimension DurationData
- Email :: Dimension EmailData
- Numeral :: Dimension NumeralData
- Ordinal :: Dimension OrdinalData
- PhoneNumber :: Dimension PhoneNumberData
- Quantity :: Dimension QuantityData
- Temperature :: Dimension TemperatureData
- Time :: Dimension TimeData
- TimeGrain :: Dimension Grain
- Url :: Dimension UrlData
- Volume :: Dimension VolumeData
- CustomDimension :: CustomDimension a => a -> Dimension (DimensionData a)
- isDimension :: Dimension a -> Token -> Bool
- data ResolvedVal = forall a.(Resolve a, Eq (ResolvedValue a), Show (ResolvedValue a), ToJSON (ResolvedValue a)) => RVal (Dimension a) (ResolvedValue a)
- data Node = Node {}
- data ResolvedToken = Resolved {}
- data Candidate = Candidate ResolvedToken Double Bool
- data Range = Range Int Int
- type Production = [Token] -> Maybe Token
- type Predicate = Token -> Bool
- data PatternItem
- type Pattern = [PatternItem]
- data Rule = Rule {}
- data Entity = Entity {}
- toJText :: ToJSON x => x -> Text
- regex :: String -> PatternItem
- dimension :: Typeable a => Dimension a -> PatternItem
- singleStringLookupRule :: HashMap Text a -> Text -> (a -> Maybe Token) -> Rule
Documentation
Instances
GEq s => Eq (Seal s) Source # | |
GShow s => Show (Seal s) Source # | |
Hashable (Seal Dimension) Source # | |
TextShow (Seal Dimension) Source # | |
Defined in Duckling.Types showbPrec :: Int -> Seal Dimension -> Builder # showb :: Seal Dimension -> Builder # showbList :: [Seal Dimension] -> Builder # showtPrec :: Int -> Seal Dimension -> Text # showt :: Seal Dimension -> Text # showtList :: [Seal Dimension] -> Text # showtlPrec :: Int -> Seal Dimension -> Text # showtl :: Seal Dimension -> Text # showtlList :: [Seal Dimension] -> Text # |
class (Show a, Typeable a, Typeable (DimensionData a)) => CustomDimension a where Source #
type DimensionData a Source #
data Dimension a where Source #
GADT for differentiating between dimensions Each dimension should have its own constructor and provide the data structure for its parsed data
Instances
data ResolvedVal Source #
forall a.(Resolve a, Eq (ResolvedValue a), Show (ResolvedValue a), ToJSON (ResolvedValue a)) => RVal (Dimension a) (ResolvedValue a) |
Instances
Eq ResolvedVal Source # | |
Defined in Duckling.Types (==) :: ResolvedVal -> ResolvedVal -> Bool # (/=) :: ResolvedVal -> ResolvedVal -> Bool # | |
Show ResolvedVal Source # | |
Defined in Duckling.Types showsPrec :: Int -> ResolvedVal -> ShowS # show :: ResolvedVal -> String # showList :: [ResolvedVal] -> ShowS # |
Instances
Eq Node Source # | |
Show Node Source # | |
Generic Node Source # | |
Hashable Node Source # | |
Defined in Duckling.Types | |
NFData Node Source # | |
Defined in Duckling.Types | |
type Rep Node Source # | |
Defined in Duckling.Types type Rep Node = D1 ('MetaData "Node" "Duckling.Types" "duckling-0.2.0.0-4AU1pRwMU7E8YjNdB7ILfy" 'False) (C1 ('MetaCons "Node" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nodeRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range) :*: S1 ('MetaSel ('Just "token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Token)) :*: (S1 ('MetaSel ('Just "children") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Node]) :*: S1 ('MetaSel ('Just "rule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
data ResolvedToken Source #
Instances
Eq ResolvedToken Source # | |
Defined in Duckling.Types (==) :: ResolvedToken -> ResolvedToken -> Bool # (/=) :: ResolvedToken -> ResolvedToken -> Bool # | |
Ord ResolvedToken Source # | |
Defined in Duckling.Types compare :: ResolvedToken -> ResolvedToken -> Ordering # (<) :: ResolvedToken -> ResolvedToken -> Bool # (<=) :: ResolvedToken -> ResolvedToken -> Bool # (>) :: ResolvedToken -> ResolvedToken -> Bool # (>=) :: ResolvedToken -> ResolvedToken -> Bool # max :: ResolvedToken -> ResolvedToken -> ResolvedToken # min :: ResolvedToken -> ResolvedToken -> ResolvedToken # | |
Show ResolvedToken Source # | |
Defined in Duckling.Types showsPrec :: Int -> ResolvedToken -> ShowS # show :: ResolvedToken -> String # showList :: [ResolvedToken] -> ShowS # |
Instances
Eq Range Source # | |
Ord Range Source # | |
Show Range Source # | |
Generic Range Source # | |
Hashable Range Source # | |
Defined in Duckling.Types | |
NFData Range Source # | |
Defined in Duckling.Types | |
type Rep Range Source # | |
Defined in Duckling.Types type Rep Range = D1 ('MetaData "Range" "Duckling.Types" "duckling-0.2.0.0-4AU1pRwMU7E8YjNdB7ILfy" 'False) (C1 ('MetaCons "Range" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
type Pattern = [PatternItem] Source #
Instances
regex :: String -> PatternItem Source #