diff --git a/Duckling/Duration/ZH/Corpus.hs b/Duckling/Duration/ZH/Corpus.hs index 298f5dbbb..1d102a555 100644 --- a/Duckling/Duration/ZH/Corpus.hs +++ b/Duckling/Duration/ZH/Corpus.hs @@ -12,15 +12,17 @@ module Duckling.Duration.ZH.Corpus ( corpus ) where -import Prelude import Data.String +import Prelude import Duckling.Duration.Types +import Duckling.Locale +import Duckling.Resolve import Duckling.Testing.Types import Duckling.TimeGrain.Types (Grain(..)) corpus :: Corpus -corpus = (testContext, allExamples) +corpus = (testContext {locale = makeLocale ZH Nothing}, allExamples) allExamples :: [Example] allExamples = concat diff --git a/Duckling/Locale.hs b/Duckling/Locale.hs index 30e40dbf7..65155f8d7 100644 --- a/Duckling/Locale.hs +++ b/Duckling/Locale.hs @@ -69,7 +69,11 @@ instance TextShow Lang where -- | ISO 3166-1 alpha-2 Country code (includes regions and territories). -- See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 data Region - = GB + = CN + | GB + | HK + | MO + | TW | US deriving (Bounded, Enum, Eq, Generic, Hashable, Ord, Read, Show) @@ -97,4 +101,5 @@ makeLocale lang (Just region) allLocales :: HashMap Lang (HashSet Region) allLocales = HashMap.fromList [ (EN, HashSet.fromList [GB, US]) + , (ZH, HashSet.fromList [CN, HK, MO, TW]) ] diff --git a/Duckling/Ranking/Classifiers/ZH_CN.hs b/Duckling/Ranking/Classifiers/ZH_CN.hs new file mode 100644 index 000000000..f8efcd593 --- /dev/null +++ b/Duckling/Ranking/Classifiers/ZH_CN.hs @@ -0,0 +1,879 @@ +-- 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. + +----------------------------------------------------------------- +-- Auto-generated by regenClassifiers +-- +-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +-- @generated +----------------------------------------------------------------- +{-# LANGUAGE OverloadedStrings #-} +module Duckling.Ranking.Classifiers.ZH_CN (classifiers) where +import Data.String +import Prelude +import qualified Data.HashMap.Strict as HashMap +import Duckling.Ranking.Types + +classifiers :: Classifiers +classifiers + = HashMap.fromList + [("