-- 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.


{-# LANGUAGE OverloadedStrings #-}

module Duckling.PhoneNumber.Corpus
  ( corpus
  , negativeCorpus
  ) where

import Prelude
import Data.String

import Duckling.PhoneNumber.Types
import Duckling.Testing.Types

corpus :: Corpus
corpus :: Corpus
corpus = (Context
testContext, Options
testOptions, [Example]
allExamples)

negativeCorpus :: NegativeCorpus
negativeCorpus :: NegativeCorpus
negativeCorpus = (Context
testContext, Options
testOptions, [Text]
examples)
  where
    examples :: [Text]
examples =
      [ Text
"12345"
      , Text
"1234567890123456777777"
      , Text
"12345678901234567"
      ]

allExamples :: [Example]
allExamples :: [Example]
allExamples = [[Example]] -> [Example]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
  [ PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"6507018887")
             [ Text
"650-701-8887"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"(+1) 6507018887")
             [ Text
"(+1)650-701-8887"
             , Text
"(+1)   650 - 701  8887"
             , Text
"(+1) 650-701-8887"
             , Text
"+1 6507018887"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"(+33) 146647998")
             [ Text
"+33 1 46647998"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"0620702220")
             [ Text
"06 2070 2220"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"6507018887 ext 897")
             [ Text
"(650)-701-8887 ext 897"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"(+1) 2025550121")
             [ Text
"+1-202-555-0121"
             , Text
"+1 202.555.0121"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"4866827")
             [ Text
"4.8.6.6.8.2.7"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"06354640807")
             [ Text
"06354640807"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"18998078030")
             [ Text
"18998078030"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"61992852776")
             [ Text
"61 - 9 9285-2776"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"19997424919")
             [ Text
"(19) 997424919"
             ]
  , PhoneNumberValue -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> PhoneNumberValue
PhoneNumberValue Text
"(+55) 19992842606")
             [ Text
"+55 19992842606"
             ]
  ]