-- 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.Email.DE.Corpus
  ( corpus
  , negativeCorpus
  ) where

import Data.String
import Prelude
import qualified Data.Text as Text

import Duckling.Email.Types
import Duckling.Locale
import Duckling.Resolve
import Duckling.Testing.Types

context :: Context
context :: Context
context = Context
testContext {locale :: Locale
locale = Lang -> Maybe Region -> Locale
makeLocale Lang
DE Maybe Region
forall a. Maybe a
Nothing}

negativeCorpus :: NegativeCorpus
negativeCorpus :: NegativeCorpus
negativeCorpus = (Context
context, Options
testOptions, [Text]
examples)
  where
    examples :: [Text]
examples =
      [ Text
"fitness at 6.40"
      , Text
"class at 12.00"
      , Text
"tonight at 9.15"
      , Text
" dot 2@abci"
      , Text
"x@ dot x"
      , Text
"x@ x dot "
      , Text
"abc@x dot "
      , Int -> Text -> Text
Text.replicate Int
10000 Text
"a at a"
      ]

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

allExamples :: [Example]
allExamples :: [Example]
allExamples = [[Example]] -> [Example]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
  [ EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"alice@exAmple.io")
             [ Text
"alice at exAmple.io"
             ]
  , EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"yo+yo@blah.org")
             [ Text
"yo+yo at blah.org"
             ]
  , EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"1234+abc@x.net")
             [ Text
"1234+abc at x.net"
             ]
  , EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"jean-jacques@stuff.co.uk")
             [ Text
"jean-jacques at stuff.co.uk"
             ]
  , EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"asdf+ab.c@gmail.com")
             [ Text
"asdf+ab punkt c at gmail punkt com"
             ]
  , EmailData -> [Text] -> [Example]
forall a. ToJSON a => a -> [Text] -> [Example]
examples (Text -> EmailData
EmailData Text
"asdf.k@fb.com")
             [ Text
"asdf punkt k@fb punkt com"
             ]
  ]