Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DUCK] 节日同名优先 #214

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ class LocalHolidayProvider extends HolidayProvider {
(monthDay(4, 23), "世界读书日", "世界读书日|读书日"),
(monthDay(4, 26), "国际知识产权日", "国际知识产权日|知识产权日"),
(monthDay(4, 30), "国际爵士日", "国际爵士日|爵士日"),
(monthDay(4, 4), "台湾儿童节", "台湾儿童节|儿童节"),
(monthDay(4, 6), "米粉节", "米粉节"),
(monthDay(5, 1), "劳动节", "五一国际劳动节|51国际劳动节|国际劳动节|五一劳动节|劳动节|五一"),
(monthDay(5, 12), "护士节", "护士节"),
Expand All @@ -197,6 +196,7 @@ class LocalHolidayProvider extends HolidayProvider {
(monthDay(5, 4), "五四青年节", "中国五四青年节|五四青年节|中国54青年节|54青年节|中国青年节|青年节"),
(monthDay(5, 8), "世界红十字日", "世界红十字日"),
(monthDay(6, 1), "儿童节", "国际六一儿童节|六一儿童节|国际61儿童节|61儿童节|儿童节|六一"),
(monthDay(4, 4), "台湾儿童节", "台湾儿童节|儿童节"),
(monthDay(6, 11), "中国人口日", "中国人口日"),
(monthDay(6, 14), "世界献血日", "世界献血日"),
(monthDay(6, 15), "健康素食日", "健康素食日"),
Expand Down Expand Up @@ -279,7 +279,11 @@ class LocalHolidayProvider extends HolidayProvider {

val builder = Maps.newTreeMap[String, String]()
normalMap.foreach{
case (pt, normalSet) => normalSet.foreach(normal => builder.put(pt, normal))
case (pt, normalSet) => normalSet.foreach(normal =>
if (!builder.containsKey(pt) || builder.containsKey(pt) && pt == normal) {
builder.put(pt, normal)
}
)
}
val tokenMapBuilder = ImmutableMap.builder[String, Token]()
tokenMap.toMap.foreach{case (k, v) => tokenMapBuilder.put(k, v)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,16 @@ object Examples extends DimExamples {
(ymd(2014, 1, 1, holiday = "元旦节"), List("元旦", "元旦节", "阳历新年")),
(ymd(2013, 3, 8, holiday = "妇女节"), List("妇女节")),
(ymd(2013, 5, 1, holiday = "劳动节"), List("劳动节", "五一国际劳动节")),
(ymd(2013, 6, 1, holiday = "儿童节"), List("61儿童节")),
(ymd(2013, 6, 1, holiday = "儿童节"), List("儿童节")),
(ymd(2013, 8, 1, holiday = "建军节"), List("建军节", "八一建军节")),
(ymd(2013, 12, 25, holiday = "圣诞节"), List("圣诞", "圣诞节")),
(ymd(2013, 4, 1, holiday = "愚人节"), List("愚人节")),
(ymd(2013, 11, 1, holiday = "万圣节"), List("万圣节")),
(ymd(2013, 12, 20, holiday = "澳门回归纪念日"), List("澳门回归纪念日")),
(ymd(2013, 2, 14, holiday = "情人节"), List("情人节", "圣瓦伦丁节")),
(ymd(2013, 3, 15, holiday = "国际消费者权益日"), List("国际消费者权益日", "三一五")),
(ymd(2013, 6, 16, holiday = "父亲节"), List("父亲节")),
(ymd(2013, 11, 28, holiday = "感恩节"), List("感恩节")),
(ymd(2013, 5, 12, holiday = "母亲节"), List("母亲节")),
(ymd(2013, 8, 8, holiday = "台湾父亲节"), List("台湾父亲节")),
(ymd(2013, 10, 1, holiday = "国庆节"), List("国庆节", "十一", "国庆")),
Expand Down
Loading