diff --git a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/rule/FuzzyDayIntervals.scala b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/rule/FuzzyDayIntervals.scala index fe8e62aa..33fef4ec 100644 --- a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/rule/FuzzyDayIntervals.scala +++ b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/rule/FuzzyDayIntervals.scala @@ -45,7 +45,7 @@ object FuzzyDayIntervals { case "上午" => ("上午", (8, 12), (4, 12)) case "中午" | "午间" => ("中午", (12, 14), (10, 15)) case "下午" => ("下午", (12, 18), (12, 0)) - case "晚上" | "晚间" | "夜里" | "夜间" | "夜晚" | "晚" => ("晚上", (18, 0), (18, 0)) + case "晚上" | "晚间" | "夜里" | "夜间" | "夜晚" | "晚" => ("晚上", (18, 0), (17, 0)) case "午夜" | "凌晨" | "半夜" => ("凌晨", (0, 6), (0, 8)) case "傍晚" | "黄昏" => ("傍晚", (17, 19), (16, 20)) } @@ -180,7 +180,7 @@ object FuzzyDayIntervals { else if (h == 12 && (s == "晚上" || s == "晚间")) 24 else { val (part, (from, _), _) = between(s) - if (part == "晚上" && h < 6) h // 晚上2点 => 凌晨2点 + if (part == "晚上" && h < 5) h // 晚上2点 => 凌晨2点 else if (from >= 12 && h < 12) h + 12 else h } 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 cb298d83..091e04b5 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 @@ -149,6 +149,7 @@ object Examples extends DimExamples { (hms(4, 30, 0), List("现在", "此时", "此刻", "当前", "4:30:00", "04点30分0秒")), (hm(15, 15), List("下午三点十五", "下午3:15", "15:15", "3:15pm", "3:15p.m", "下午三点一刻", "下午的三点一刻")), (yMdHms(d=13, H=2, grain = Hour), List("晚上两点")), + (yMdHms(d=12, H=17, grain = Hour), List("晚上五点")), (hm(16, 40), List("十六时四十分", "十六点四十")), (hm(6, 10), List("六点十分", "六点一十")), (hms(4, 33, 0), List("过三分钟")),