From 1192782729c8b771477e99790ed274d33ac73cd7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 24 Apr 2024 00:49:04 +0200 Subject: [PATCH] [tts.picovoice] Convert digits before replacing other substrings. --- platypush/plugins/tts/picovoice/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/tts/picovoice/__init__.py b/platypush/plugins/tts/picovoice/__init__.py index 9f7496a822..69c00c6c90 100644 --- a/platypush/plugins/tts/picovoice/__init__.py +++ b/platypush/plugins/tts/picovoice/__init__.py @@ -59,10 +59,12 @@ class TextConversionUtils: @classmethod def convert(cls, text: str) -> str: + text = cls._convert_digits(text) + for pattern, replacement in TextConversionUtils._conversions_map: text = pattern.sub(replacement, text) - return cls._convert_digits(text) + return text class TtsPicovoicePlugin(TtsPlugin):