def get_amqp_routing_key(nick, msg):
# simplify the key significantly
offset = 0
- key = shlex.split(re.sub(r'[^a-zäöüß0-9 "\'.]', '', msg["body"].lower()))
+ key = shlex.split(re.sub(r'[^a-zäöüß0-9 "\'.-]', '', msg["body"].lower()))
if not key:
# simple dots, smilies, emoji shit, pass through
key = shlex.split(msg["body"].lower())
}
result = requests.post('http://ws.detectlanguage.com/0.2/detect', data=data).json()
educated_guess = result['data']['detections'][0]
+ logger.info("detected language: %s", str(educated_guess))
if not educated_guess['isReliable']:
return Action(msg='not sure about the language.')
else: