diff --git a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/Rules.scala b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/Rules.scala index 8cdda10..92d3e25 100644 --- a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/Rules.scala +++ b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/Rules.scala @@ -211,7 +211,7 @@ trait Rules extends DimRules { } ) - private val RecentPattern = "(上|下|近|这|前|后)|(后面|过去|未来|接下来|之前|往前|向前|今后|之后|往后|向后|最近)的?" + private val RecentPattern = "(上|下|近|这|前|后面?)|(过去|未来|接下来|之前|往前|向前|今后|之后|往后|向后|最近|将来)的?" /** * 时间区间: @@ -228,7 +228,7 @@ trait Rules extends DimRules { val s = if (StringUtils.isBlank(g1)) g2 else g1 // 月必须是x个月 s match { - case "下" | "后" | "接下来" | "未来" | "今后" | "之后" | "向后" | "往后" | "后面" => + case "下" | "后" | "接下来" | "未来" | "今后" | "之后" | "向后" | "往后" | "后面" | "将来" => val td: Option[TimeData] = // 未来一周=未来七天 if ((s == "未来" || s == "接下来") && g == Week) { 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 1d3a050..ff3c855 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 @@ -291,6 +291,14 @@ object Examples extends DimExamples { ), List("未来一周", "一周内") ), + ( + localDateTimeInterval( + LocalDateTime.of(2013, 2, 12, 0, 0, 0), + LocalDateTime.of(2013, 2, 22, 0, 0, 0), + Day + ), + List("未来十天", "将来十天", "后面十天", "后十天", "之后十天") + ), ( datetime(LocalDateTime.of(2013, 3, 5, 4, 30, 0), Second), List("三星期后", "三星期之后", "三个礼拜后", "三个礼拜之后", "三星期以后", "三星期过后")