duckling_old icon indicating copy to clipboard operation
duckling_old copied to clipboard

Thai number not found

Open Bongsakorn opened this issue 8 years ago • 1 comments

I created rule for 0..10 and 21..99 like this

"integer (0..10) - thai number"
    #"๐|๑๐|๑|๒|๓|๔|๕|๖|๗|๘|๙"
    {:dim :number
     :integer true
     :value (get {"๐" 0 "๑๐" 10 "๑" 1 "๒" 2 "๓" 3 "๔" 4 "๕" 5 "๖" 6 "๗" 7 "๘" 8 "๙" 9} (:text %1))}

"integer 21..99 - thai number"
     [#(#{2 3 4 5 6 7 8 9} (:value %)) (integer 1 9)]
     {:dim :number
      :integer true
      :value (+ (* (:value %1) 10) (:value %2))}

when I test number "๒๔", result is correct. but when I try testing number like "๒๒", "๓๓", "๔๔" and so on. It cannot found anything.

0 FAIL "๑๑"
    Expected null
1 FAIL "๓๓"
    Expected null

Any suggestion?

Bongsakorn avatar May 19 '16 10:05 Bongsakorn

Hi, can you prepend the corpus/rules files with an underscore (_) and do a Pull Request. This allows to save your work while getting help from somebody else in the community.

l5t avatar May 24 '16 03:05 l5t