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 bf81d42..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 @@ -575,15 +575,6 @@ trait Rules extends DimRules { } ) - val tomorrow = Rule( - name = "次日|第二天", - pattern = List("次日|第二天".regex), - prod = tokens { - case Token(RegexMatch, GroupMatch(s :: _)) :: _ => - tt(cycleNthThis(1, Day, Day, Year)) - } - ) - def openInterval(td: TimeData, direction: IntervalDirection): Option[Token] = { val pred = SequencePredicate(List(td, TimeData(TimeOpenIntervalPredicate(direction), timeGrain = Grain.NoGrain))) tt(TimeData(pred, timeGrain = td.timeGrain, hint = Hint.Sequence)) @@ -591,7 +582,6 @@ trait Rules extends DimRules { val composite = List( ruleRecentTime, - tomorrow, ruleNthTimeOfTime, ruleNthTimeOfTime2, ruleIntersect, diff --git a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/date/Rules.scala b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/date/Rules.scala index dec0e0a..b29ed1e 100644 --- a/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/date/Rules.scala +++ b/duckling-fork-chinese/core/src/main/scala/com/xiaomi/duckling/dimension/time/date/Rules.scala @@ -28,7 +28,7 @@ import com.xiaomi.duckling.dimension.matcher.{GroupMatch, RegexMatch} import com.xiaomi.duckling.dimension.matcher.Prods.{regexMatch, singleRegexMatch} import com.xiaomi.duckling.dimension.numeral.Predicates.{getIntValue, isIntegerBetween} import com.xiaomi.duckling.dimension.numeral.seq.{DigitSequence, DigitSequenceData} -import com.xiaomi.duckling.dimension.time.Prods.intersectDOM +import com.xiaomi.duckling.dimension.time.Prods.{intersectDOM, tt} import com.xiaomi.duckling.dimension.time.duration.{isADecade, Duration, DurationData} import com.xiaomi.duckling.dimension.time.enums.Grain._ import com.xiaomi.duckling.dimension.time.enums.Hint.{NoHint, RecentNominal, YearMonth} @@ -229,6 +229,15 @@ trait Rules extends DimRules { } ) + val tomorrow = Rule( + name = "次日", + pattern = List("次日".regex), + prod = tokens { + case Token(RegexMatch, GroupMatch(s :: _)) :: _ => + tt(cycleNthThis(1, Day, Day, Year)) + } + ) + val ruleDecade = Rule( name = "date: tens of decade", pattern = List(isADecade.predicate, "年代".regex),