Skip to content

Commit

Permalink
限制"2月2"一类的表达
Browse files Browse the repository at this point in the history
  • Loading branch information
du00cs committed Nov 14, 2024
1 parent af3a3f8 commit a0ff48f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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

0 comments on commit a0ff48f

Please sign in to comment.