Skip to content

Commit

Permalink
Fix accents on _parse_callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlberLC committed Jun 13, 2022
1 parent e541717 commit bf77832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions multibot/bots/multi_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@ def _parse_callbacks(
minimum_ratio_to_match: float = constants.MINIMUM_RATIO_TO_MATCH
) -> OrderedSet[RegisteredCallback]:
text = text.lower()
# text = flanautils.remove_accents(text)
text = flanautils.replace(text, {'á': 'a', 'é': 'e', 'í': 'i', 'ó': 'o', 'ú': 'u',
'à': 'a', 'è': 'e', 'ì': 'i', 'ò': 'o', 'ù': 'u',
'â': 'a', 'ê': 'e', 'î': 'i', 'ô': 'o', 'û': 'u',
'ä': 'a', 'ë': 'e', 'ï': 'i', 'ö': 'o', 'ü': 'u'})
text = flanautils.translate(text, {'?': ' ', '¿': ' ', '!': ' ', '¡': ' '})
# text = flanautils.translate(text, {'auto': 'automatico', 'matico': None, 'matic': None})
original_text_words = OrderedSet(text.split())
text_words = original_text_words - flanautils.CommonWords.all_words

Expand Down

0 comments on commit bf77832

Please sign in to comment.