Skip to content

Commit

Permalink
filter multiple **
Browse files Browse the repository at this point in the history
  • Loading branch information
hairygael authored Dec 2, 2024
1 parent d51e888 commit 1dbad4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/5_Mouth.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def onFilterText(text):
params = []
function_call_str = "*{}({})*".format(extracted_word, param_str) if param_str else "*{}*".format(extracted_word)
filtered_text = filtered_text.replace(function_call_str, "")
# Now filter multiple **
text = re.sub(r'\*\*(?!\*)', '', text)
print("Filtered Text:", filtered_text.strip())
if runtime.isStarted('i01.mouth'):
i01_mouth.speak(filtered_text)
Expand Down

0 comments on commit 1dbad4b

Please sign in to comment.