Safe Haskell | None |
---|---|
Language | Haskell2010 |
Everything needed to run Duckling.
- data Context = Context {}
- data Dimension a where
- RegexMatch :: Dimension GroupMatch
- AmountOfMoney :: Dimension AmountOfMoneyData
- 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
- fromName :: Text -> Maybe (Some Dimension)
- data Entity = Entity {}
- data Lang
- data Some k tag :: forall k. (k -> *) -> * where
- toName :: Dimension a -> Text
- parse :: Text -> Context -> [Some Dimension] -> [Entity]
- supportedDimensions :: HashMap Lang [Some Dimension]
- currentReftime :: HashMap Text TimeZoneSeries -> Text -> IO DucklingTime
- makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime
Documentation
Context | |
|
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
parse :: Text -> Context -> [Some Dimension] -> [Entity] Source #
Parses input
and returns a curated list of entities found.
currentReftime :: HashMap Text TimeZoneSeries -> Text -> IO DucklingTime Source #
Builds a DucklingTime
for timezone tz
at current time.
If no series
found for tz
, uses UTC.
makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime Source #
Builds a DucklingTime
for timezone tz
at utcTime
.
If no series
found for tz
, uses UTC.