Found a new issue regarding spaces in the parser :)
As an example, in English the insertInto pattern is `(put|insert|stick) (.+) (?:in) (.+)`. If given an input like "insert bone into hole", Parser correctly generates an action object even though the pattern matches the input exactly. This is because the initial match is skipped:
if( sorgente != this.commands && override != this.override.commands && input.indexOf(" ") == -1 && (obj.singolo === undefined || obj.singolo == false) ){ let matches = input.match(new RegExp("^"+pattern+"$", 'i')); if( matches != null) return input; }
The input contains spaces, so the above logic is skipped due to `input.indexOf(" ") != -1`. Otherwise, there would be a match and the raw input would be returned directly.
It appears the presence of the space is used to indicate whether this is an action and/or potentially has subjects. Unfortunately, since there are no spaces in Chinese, any inputs that match the pattern enter the above logic and return a string, not an action object. As an example, we would enter the Chinese equivalent of "insertboneintohole" and Parser.parse will return the string instead of the action.
How would you recommend adjusting the logic to handle this? I'm not sure if it is safe to remove the `input.IndexOf(" ") == -1` condition.