-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chinese locales + fix TW National Day
Summary: * Moving `ruleNationalDay` from `ZH` rules to specific locales: `zh_CN`, `zh_HK`, `zh_MO` * Fixed National Day for `zh_TW`. Reviewed By: blandinw Differential Revision: D6057565 fbshipit-source-id: 8f9f2ab
- Loading branch information
1 parent
33a08bb
commit fb1dcaa
Showing
23 changed files
with
3,894 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- 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 OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.CN.Corpus | ||
( allExamples | ||
) where | ||
|
||
import Data.String | ||
import Prelude | ||
|
||
import Duckling.Testing.Types hiding (examples) | ||
import Duckling.Time.Corpus | ||
import Duckling.Time.Types hiding (Month) | ||
import Duckling.TimeGrain.Types hiding (add) | ||
|
||
allExamples :: [Example] | ||
allExamples = concat | ||
[ examples (datetime (2013, 10, 1, 0, 0, 0) Day) | ||
[ "国庆" | ||
, "國慶" | ||
, "国庆节" | ||
, "国庆節" | ||
, "國慶节" | ||
, "國慶節" | ||
] | ||
, examples (datetimeInterval ((2013, 10, 1, 18, 0, 0), (2013, 10, 2, 0, 0, 0)) Hour) | ||
[ "国庆节晚上" | ||
, "國慶節晚上" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- 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 GADTs #-} | ||
{-# LANGUAGE NoRebindableSyntax #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.CN.Rules | ||
( rules | ||
) where | ||
|
||
import Prelude | ||
|
||
import Duckling.Regex.Types | ||
import Duckling.Time.Helpers | ||
import Duckling.Types | ||
|
||
ruleNationalDay :: Rule | ||
ruleNationalDay = Rule | ||
{ name = "national day" | ||
, pattern = | ||
[ regex "(国庆|國慶)(节|節)?" | ||
] | ||
, prod = \_ -> tt $ monthDay 10 1 | ||
} | ||
|
||
rules :: [Rule] | ||
rules = | ||
[ ruleNationalDay | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- 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 OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.HK.Corpus | ||
( allExamples | ||
) where | ||
|
||
import Data.String | ||
import Prelude | ||
|
||
import Duckling.Testing.Types hiding (examples) | ||
import Duckling.Time.Corpus | ||
import Duckling.Time.Types hiding (Month) | ||
import Duckling.TimeGrain.Types hiding (add) | ||
|
||
allExamples :: [Example] | ||
allExamples = concat | ||
[ examples (datetime (2013, 10, 1, 0, 0, 0) Day) | ||
[ "国庆" | ||
, "國慶" | ||
, "国庆节" | ||
, "国庆節" | ||
, "國慶节" | ||
, "國慶節" | ||
] | ||
, examples (datetimeInterval ((2013, 10, 1, 18, 0, 0), (2013, 10, 2, 0, 0, 0)) Hour) | ||
[ "国庆节晚上" | ||
, "國慶節晚上" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- 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 GADTs #-} | ||
{-# LANGUAGE NoRebindableSyntax #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.HK.Rules | ||
( rules | ||
) where | ||
|
||
import Prelude | ||
|
||
import Duckling.Regex.Types | ||
import Duckling.Time.Helpers | ||
import Duckling.Types | ||
|
||
ruleNationalDay :: Rule | ||
ruleNationalDay = Rule | ||
{ name = "national day" | ||
, pattern = | ||
[ regex "(国庆|國慶)(节|節)?" | ||
] | ||
, prod = \_ -> tt $ monthDay 10 1 | ||
} | ||
|
||
rules :: [Rule] | ||
rules = | ||
[ ruleNationalDay | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- 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 OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.MO.Corpus | ||
( allExamples | ||
) where | ||
|
||
import Data.String | ||
import Prelude | ||
|
||
import Duckling.Testing.Types hiding (examples) | ||
import Duckling.Time.Corpus | ||
import Duckling.Time.Types hiding (Month) | ||
import Duckling.TimeGrain.Types hiding (add) | ||
|
||
allExamples :: [Example] | ||
allExamples = concat | ||
[ examples (datetime (2013, 10, 1, 0, 0, 0) Day) | ||
[ "国庆" | ||
, "國慶" | ||
, "国庆节" | ||
, "国庆節" | ||
, "國慶节" | ||
, "國慶節" | ||
] | ||
, examples (datetimeInterval ((2013, 10, 1, 18, 0, 0), (2013, 10, 2, 0, 0, 0)) Hour) | ||
[ "国庆节晚上" | ||
, "國慶節晚上" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- 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 GADTs #-} | ||
{-# LANGUAGE NoRebindableSyntax #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Duckling.Time.ZH.MO.Rules | ||
( rules | ||
) where | ||
|
||
import Prelude | ||
|
||
import Duckling.Regex.Types | ||
import Duckling.Time.Helpers | ||
import Duckling.Types | ||
|
||
ruleNationalDay :: Rule | ||
ruleNationalDay = Rule | ||
{ name = "national day" | ||
, pattern = | ||
[ regex "(国庆|國慶)(节|節)?" | ||
] | ||
, prod = \_ -> tt $ monthDay 10 1 | ||
} | ||
|
||
rules :: [Rule] | ||
rules = | ||
[ ruleNationalDay | ||
] |
Oops, something went wrong.