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] 将“晚上5点”映射到“下午5点” #213

Merged
merged 1 commit into from
Feb 20, 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 @@ -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))
}
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("过三分钟")),
Expand Down
Loading