0

I am using Duckling software. In the FR Rules file:

ruleDemain :: Rule
ruleDemain = Rule
  { name = "demain"
  , pattern =
     [ regex "(le len)?demain"
     ]
  , prod = \_ -> tt $ cycleNth TG.Day 1
  }

I want the software to be able to interpret demain and Demain as the same word. I am looking for a global solution for all the rules.

  • I don't really know anything about the library, so there may be a More Official Way, but... perhaps changing that to `"(le len)?[Dd]emain"` is good enough for you? – Daniel Wagner May 23 '22 at 16:47
  • Yes that's useful for one rule but am looking for a global way to solve this for all rules. – Wassim Malleh May 23 '22 at 17:24

1 Answers1

2

According to that tool's readme, it uses PCRE for its regexes. So you should be able to use (?i) for case-insensitive mode:

ruleDemain :: Rule
ruleDemain = Rule
  { name = "demain"
  , pattern =
     [ regex "(?i)(le len)?demain"
     ]
  , prod = \_ -> tt $ cycleNth TG.Day 1
  }
amalloy
  • 89,153
  • 8
  • 140
  • 205