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] 修复 '九月18到九月22' 能组合成 repeat 的问题 #241

Merged
merged 1 commit into from
Sep 24, 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 @@ -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
Loading