You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed there seems to be a couple of issues when inputting mixed words with numbers in the terminal_example.py:
KeyError
$ python terminal_example.py
Type something to begin...
ninety seven - 7
Traceback (most recent call last):
File "terminal_example.py", line 30, in <module>
bot_input = bot.get_response(None)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 113, in get_response
statement, response = self.generate_response(input_statement, conversation_id)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 132, in generate_response
response = self.logic.process(input_statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/multi_adapter.py", line 49, in process
if adapter.can_process(statement):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 33, in can_process
response = self.process(statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 59, in process
mathparse.parse(expression, language=self.language)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 269, in parse
postfix = to_postfix(tokens)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 176, in to_postfix
while (opstack != []) and (precedence[opstack[-1]] >= precedence[token]):
KeyError: '9ty'
IndexError
$ python terminal_example.py
sType something to begin...
seven - 7
Traceback (most recent call last):
File "terminal_example.py", line 30, in <module>
bot_input = bot.get_response(None)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 113, in get_response
statement, response = self.generate_response(input_statement, conversation_id)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 132, in generate_response
response = self.logic.process(input_statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/multi_adapter.py", line 49, in process
if adapter.can_process(statement):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 33, in can_process
response = self.process(statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 59, in process
mathparse.parse(expression, language=self.language)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 271, in parse
return evaluate_postfix(postfix)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 203, in evaluate_postfix
a = stack.pop()
IndexError: pop from empty list
...and...
$ python terminal_example.py
Type something to begin...
ninetyseven - seven
Traceback (most recent call last):
File "terminal_example.py", line 30, in <module>
bot_input = bot.get_response(None)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 113, in get_response
statement, response = self.generate_response(input_statement, conversation_id)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 132, in generate_response
response = self.logic.process(input_statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/multi_adapter.py", line 49, in process
if adapter.can_process(statement):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 33, in can_process
response = self.process(statement)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chatterbot/logic/mathematical_evaluation.py", line 59, in process
mathparse.parse(expression, language=self.language)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 271, in parse
return evaluate_postfix(postfix)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mathparse/mathparse.py", line 203, in evaluate_postfix
a = stack.pop()
IndexError: pop from empty list
Some type of exception handling here would probably be better than just crashing perhaps.
The text was updated successfully, but these errors were encountered:
I noticed there seems to be a couple of issues when inputting mixed words with numbers in the
terminal_example.py
:KeyError
IndexError
...and...
Some type of exception handling here would probably be better than just crashing perhaps.
The text was updated successfully, but these errors were encountered: