Wassim Malleh
Wassim Malleh

Reputation: 1

How can I add case insensitivity in Duckling software

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.

Upvotes: 0

Views: 80

Answers (1)

amalloy
amalloy

Reputation: 92117

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
  }

Upvotes: 2

Related Questions