Make W|A obfuscator more robust

This commit is contained in:
Tanner Collin 2022-09-09 16:34:41 -06:00
parent dbc6bc0f43
commit d970ec9d83

12
main.py
View File

@ -154,14 +154,10 @@ def think_send(query):
result = result.replace('Stephen Wolfram', 'Tanner') # lol result = result.replace('Stephen Wolfram', 'Tanner') # lol
result = result.replace('and his team', '') result = result.replace('and his team', '')
if '(according to' in result: for word in ['according to', 'asked', 'although', 'approximately']:
result = result.split('(according to')[0] idx = result.lower().find('('+word)
if idx > 0:
if '(asked' in result: result = result[:idx-1]
result = result.split('(asked')[0]
if '(although' in result:
result = result.split('(although')[0]
if result == 'Error': if result == 'Error':
result = 'INSUFFICIENT DATA FOR A MEANINGFUL ANSWER.' result = 'INSUFFICIENT DATA FOR A MEANINGFUL ANSWER.'