ChatterBot icon indicating copy to clipboard operation
ChatterBot copied to clipboard

mathparse and mathematical evaluation

Open AskellAytch opened this issue 3 years ago • 0 comments

Question: Is the code eighteen hundred and twenty-one?

Result in a fatal error

error

Explanation: in eighteen (and sixteen, seventeen, and all that jazz) chatterbot sees EIGHT first hence turning "eighteen" in "8een" hence the keyword error.

Solution i found: in the file mathwords.py (of the library mathparse), add a space ' ' after each number raising an issue (four, six, seven, eight, nine) to force chatterbot to see the difference bewteen eight and eighteen.

fix_error

Haven't invistigate further for other language nor other mathematical evaluation.

Hope it will help whoever reads this.

Cheers

AskellAytch avatar Jun 30 '22 14:06 AskellAytch