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] 限制"2月2"一类的表达 #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -205,7 +205,7 @@ trait Rules extends DimRules {
val ruleNamedMonthDayOfMonth = Rule(
name = "date: <named-month> <day-of-month>",
pattern =
List(and(isAMonth, isHint(Hint.MonthOnly)).predicate, isIntegerBetween(1, 31).predicate),
List(and(isAMonth, isHint(Hint.MonthOnly)).predicate, isIntegerBetween(11, 31).predicate),
prod = tokens {
case Token(Date, td: TimeData) :: token :: _ =>
for (td <- intersectDOM(td, token)) yield {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,14 @@ object Examples extends DimExamples {
(ymd(2013, 8, 15, holiday = "中秋节", calendar = Lunar(false)), List("下一个中秋节")),
// (ymd(2012, 2, 12), List("一年前的今天")),
(ymd(2022, 10, 1, direction = IntervalDirection.Before), List("2022年10月1号之前")),
(ymd(2013, 7, 19, direction = IntervalDirection.Before), List("七月十九日之前")),
(ymd(2022, 10, 1, direction = IntervalDirection.After), List("2022年10月1号之后")),
(h(12), List("今天12点")),
(h(15), List("今天3点")),
// 8点,不是20点
(datetime(LocalDateTime.of(2013, 2, 11, 8, 0, 0), Hour), List("2013年2月11号8点")),
(datetime(LocalDateTime.of(2013, 2, 14, 8, 0, 0), Hour), List("2月14号8点")),
(datetime(LocalDateTime.of(2013, 2, 2, 0, 0, 0), Day), List("2013年2月2", "2013年2月第二天", "今年2月的第二天", "本月第二天")),
(datetime(LocalDateTime.of(2013, 2, 2, 0, 0, 0), Day), List("2013年2月第二天", "今年2月的第二天", "本月第二天")),
(datetime(LocalDateTime.of(2013, 1, 2, 0, 0, 0), Day), List("2013年的第二天", "今年的第二天", "今年倒数第364天")),
(datetime(LocalDateTime.of(2013, 5, 31, 0, 0, 0), Day), List("5月的最后一天", "5月最后一天", "5月第31天"))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object NaiveBayesDebug {
val targets = FullDimensions.convert(dim.split(","))
val options = Options(targets = targets, withLatent = false, full = true)
options.rankOptions.setRanker(Some(Ranker.NaiveBayes))
options.rankOptions.setWinnerOnly(true)
options.rankOptions.setWinnerOnly(false)
options.rankOptions.setCombinationRank(false)
options.rankOptions.setRangeRankAhead(false)
options.timeOptions.setResetTimeOfDay(false)
Expand Down
Loading