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
- CustomDimension :: CustomDimension a => a -> Dimension (DimensionData a)
- data Entity = Entity {}
- data Lang
- data Locale
- data Node = Node {}
- newtype Options = Options {
- withLatent :: Bool
- data Range = Range Int Int
- data Region
- data Some k (tag :: k -> *) :: forall k. (k -> *) -> * where
- fromName :: Text -> Maybe (Some Dimension)
- makeLocale :: Lang -> Maybe Region -> Locale
- toName :: Dimension a -> Text
- parse :: Text -> Context -> Options -> [Some Dimension] -> [Entity]
- supportedDimensions :: HashMap Lang [Some Dimension]
- allLocales :: HashMap Lang (HashSet Region)
- currentReftime :: HashMap Text TimeZoneSeries -> Text -> IO DucklingTime
- fromZonedTime :: ZonedTime -> DucklingTime
- makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime
Documentation
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
ISO 639-1 Language. See https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
ISO 3166-1 alpha-2 Country code (includes regions and territories). See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
parse :: Text -> Context -> Options -> [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.
fromZonedTime :: ZonedTime -> DucklingTime Source #
Builds a DucklingTime
from a ZonedTime
.
makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime Source #
Builds a DucklingTime
for timezone tz
at utcTime
.
If no series
found for tz
, uses UTC.