Fix replace with single braces in dialog
This commit is contained in:
parent
a3798e1a2c
commit
e5ec573705
@ -42,7 +42,7 @@ class Skill:
|
||||
random_line = get_random_line_from_file(file)
|
||||
|
||||
for key, val in data.items():
|
||||
if "{{" + key + "}}" in random_line:
|
||||
if "{{" + key + "}}" in random_line or "{" + key + "}" in random_line:
|
||||
# TODO: replace when found a better TTS engine for french
|
||||
# as the french tts don't support float in sentence, convert it to an integer
|
||||
if is_float(val):
|
||||
@ -50,6 +50,7 @@ class Skill:
|
||||
val = str(val).split(".")[0] + " virgule " + str(val).split(".")[1]
|
||||
|
||||
random_line = random_line.replace("{{" + key + "}}", val)
|
||||
random_line = random_line.replace("{" + key + "}", val)
|
||||
|
||||
self.speak(random_line)
|
||||
|
||||
|
Reference in New Issue
Block a user