Skip to content

mathparse and mathematical evaluation #2256

Open
@AskellAytch

Description

@AskellAytch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions