I was creating a consultant bot for a property agency, when it turned out that LUIS.ai (the AI that understands natural language) doesn’t recognize numbers like
345 萬 (it means
3,450,000 in Chinese and is often used in property prices).
Number (like 245) that can be used in calculations or database queries.
For fun, I also decided to throw in support for some Cantonese slang, such as 廿
yaa for 20, 卅
saa for 30 and 卌
sei aa for 40.
The code of
chinese-numbers.js is in public domain on my GitHub.