diff --git a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/helper/HolidayProvider.scala b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/helper/HolidayProvider.scala index f6e4c118..1ca869b9 100644 --- a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/helper/HolidayProvider.scala +++ b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/helper/HolidayProvider.scala @@ -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), "护士节", "护士节"), @@ -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), "健康素食日", "健康素食日"), @@ -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)} diff --git a/duckling-fork-chinese/learning/src/main/scala/com/xiaomi/duckling/dimension/time/Examples.scala b/duckling-fork-chinese/learning/src/main/scala/com/xiaomi/duckling/dimension/time/Examples.scala index 091e04b5..1d3a050e 100644 --- a/duckling-fork-chinese/learning/src/main/scala/com/xiaomi/duckling/dimension/time/Examples.scala +++ b/duckling-fork-chinese/learning/src/main/scala/com/xiaomi/duckling/dimension/time/Examples.scala @@ -301,7 +301,7 @@ 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("愚人节")), @@ -309,6 +309,8 @@ object Examples extends DimExamples { (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("国庆节", "十一", "国庆")),