forked from baozkan/duckling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDucklingRequestSample.hs
36 lines (30 loc) · 1.14 KB
/
DucklingRequestSample.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- 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 ScopedTypeVariables #-}
{-# OPTIONS -fno-full-laziness #-}
module Main (main) where
import Control.Monad
import Data.Some
import System.Environment
import Duckling.Debug
import Duckling.Dimensions.Types
import Duckling.Locale
main :: IO ()
main = do
(repeatCount :: Int) <- read . head <$> getArgs
void $ replicateM repeatCount $ void $ do
debug en "My number is 123" [This PhoneNumber,This Distance,This Numeral,This Email]
debug en "Wednesday 5:00PM 3/29/2017" [This Numeral,This Time]
debug zh "12:30pm" [This Time]
debug en "tomorrow at 4pm" [This Time]
debug en "Tomorrow at 12.30?" [This Time]
debug en "Wednesday 9am" [This Time]
debug en "Sure do! Will 11:30 work?" [This Time,This AmountOfMoney]
debug en "8:00am" [This Time]
where
en = makeLocale EN Nothing
zh = makeLocale ZH Nothing