Skip to content

Commit

Permalink
修复 '九月18到九月22' 能组合成 repeat 的问题 (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
du00cs authored Sep 24, 2024
1 parent 617c943 commit b7503c2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ trait Rules extends DimRules {
)

private def intersectToken(options: Options, td1: TimeData, td2: TimeData): Option[Token] = {
println(td1, td2)
// 破除(y-m)-d和y-(m-d)均构造出来的问题
if (td1.hint == YearMonth && td2.hint == DayOnly) None
// 固定顺序,避免(y-m)-(d H-M-S) 以及(y)-(m-d H-M-S)出现
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ trait Rules extends DimRules with LazyLogging {
// 周一到周五早上八点
val ruleIntervalTime = Rule(
name = "<interval> <time/interval>",
pattern = List(isInterval.predicate, isDimension(Time).predicate),
pattern = List(isInterval.predicate, and(isDimension(Time), isNotLatent).predicate),
prod = tokens { case Token(Time, outer: TimeData) :: Token(Time, inner: TimeData):: _
if outer.timeGrain > inner.timeGrain && (inner.timePred.maxGrain.isEmpty || outer.timeGrain > inner.timePred.maxGrain.get) =>
val oInterval = outer.timePred.asInstanceOf[TimeIntervalsPredicate]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ object Engine extends LazyLogging {
val p :: ps = rule.pattern
val newRule = rule.copy(pattern = ps)
if (verboseMatch) {
logger.info(s"apply rule of: ${rule.name}")
logger.info(s"match first - apply rule of: ${rule.name}")
}
val valid = lookupItem(sentence, p, stash, position)
valid.map(mkMatch(route, newRule))
Expand Down
2 changes: 1 addition & 1 deletion duckling-fork-chinese/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object Dependencies {
lazy val jlineJansi = "org.jline" % "jline-terminal-jansi" % "3.21.0"
lazy val config = "com.typesafe" % "config" % "1.3.4"
lazy val guava = "com.google.guava" % "guava" % "30.1.1-jre"
lazy val lombok = "org.projectlombok" % "lombok" % "1.18.24" % Provided
lazy val lombok = "org.projectlombok" % "lombok" % "1.18.30" % Provided
lazy val httpclient = "org.apache.httpcomponents" % "httpclient" % "4.5.13"
lazy val java8 = "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
lazy val lunar = "com.github.heqiao2010" % "lunar" % "1.5"
Expand Down

0 comments on commit b7503c2

Please sign in to comment.