{-# LANGUAGE OverloadedStrings #-}
module Duckling.Quantity.EN.Corpus
( corpus
, latentCorpus
) where
import Prelude
import Data.String
import Duckling.Quantity.Types
import Duckling.Resolve (Options(..))
import Duckling.Testing.Types
corpus :: Corpus
corpus :: Corpus
corpus = (Context
testContext, Options
testOptions, [Example]
allExamples)
latentCorpus :: Corpus
latentCorpus :: Corpus
latentCorpus = (Context
testContext, Options
testOptions {withLatent :: Bool
withLatent = Bool
True}, [Example]
latentExamples)
where
latentExamples :: [Example]
latentExamples = [[Example]] -> [Example]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
[
QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Unnamed Double
4 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"around 4"
, Text
"four"
, Text
"~ four"
]
,
QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Unnamed Double
38.5 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"about 38.5"
]
]
allExamples :: [Example]
allExamples :: [Example]
allExamples = [[Example]] -> [Example]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
[ QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Pound Double
2 (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"meat"))
[ Text
"two pounds of meat"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Gram Double
2 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"2 grams"
, Text
"0.002 kg"
, Text
"2 g."
, Text
"2 gs"
, Text
"2/1000 kilograms"
, Text
"2000 milligrams"
, Text
"2,000 milligrams"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Gram Double
1000 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"a kilogram"
, Text
"a kg"
, Text
"1 k.g."
, Text
"1 k.gs"
, Text
"1000 gs"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Pound Double
1 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"a Pound"
, Text
"1 lb"
, Text
"a lb"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Ounce Double
2 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"2 ounces"
, Text
"2oz"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Cup Double
3 (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"sugar"))
[ Text
"3 Cups of sugar"
, Text
"3 Cups of SugAr"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Cup Double
0.75 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"3/4 cup"
, Text
"0.75 cup"
, Text
".75 cups"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
simple Unit
Gram Double
500 (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"strawberries"))
[ Text
"500 grams of strawberries"
, Text
"500g of strawberries"
, Text
"0.5 kilograms of strawberries"
, Text
"0.5 kg of strawberries"
, Text
"500000mg of strawberries"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> (Double, Double) -> Maybe Text -> QuantityValue
between Unit
Gram (Double
100,Double
1000) (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"strawberries"))
[ Text
"100-1000 gram of strawberries"
, Text
"between 100 and 1000 grams of strawberries"
, Text
"from 100 to 1000 g of strawberries"
, Text
"100 - 1000 g of strawberries"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> (Double, Double) -> Maybe Text -> QuantityValue
between Unit
Gram (Double
2,Double
7) Maybe Text
forall a. Maybe a
Nothing)
[ Text
"around 2 -7 g"
, Text
"~2-7 grams"
, Text
"from 2 to 7 g"
, Text
"between 2.0 g and about 7.0 g"
, Text
"between 0.002 kg and about 0.007 kg"
, Text
"2 - ~7 grams"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
under Unit
Pound Double
6 (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"meat"))
[ Text
"less than six pounds of meat"
, Text
"no more than 6 lbs of meat"
, Text
"below 6.0 pounds of meat"
, Text
"at most six pounds of meat"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
above Unit
Cup Double
2 Maybe Text
forall a. Maybe a
Nothing)
[ Text
"exceeding 2 Cups"
, Text
"at least two Cups"
, Text
"over 2 Cups"
, Text
"more than 2 Cups"
]
, QuantityValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Unit -> Double -> Maybe Text -> QuantityValue
above Unit
Ounce Double
4 (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"chocolate"))
[ Text
"exceeding 4 oz of chocolate"
, Text
"at least 4.0 oz of chocolate"
, Text
"over four ounces of chocolate"
, Text
"more than four ounces of chocolate"
]
]