Still attempting to kill off this delay.
This commit is contained in:
@@ -133,16 +133,16 @@ class OutputManager:
|
||||
"""
|
||||
if not text:
|
||||
return text
|
||||
|
||||
|
||||
# Handle dots at the beginning of words (like .local, .bashrc, .config)
|
||||
# Look for non-word character (or start of string), dot, then word characters
|
||||
text = re.sub(r'(?<!\w)\.(\w+)', r'dot \1', text)
|
||||
|
||||
# Replace dots that appear between word characters with spoken form
|
||||
# Use a loop to handle multiple consecutive dots like www.example.com or a.b.c.d
|
||||
while re.search(r'\b\w+\.\w+\b', text):
|
||||
text = re.sub(r'\b(\w+)\.(\w+)\b', r'\1 dot \2', text)
|
||||
|
||||
text = re.sub(r"(?<!\w)\.(\w+)", r"dot \1", text)
|
||||
|
||||
# Replace dots between word characters in one pass. The old loop
|
||||
# rescanned the full speech string once per remaining dotted word,
|
||||
# which made large directory listings block the event loop for seconds.
|
||||
text = re.sub(r"(?<=\w)\.(?=\w)", " dot ", text)
|
||||
|
||||
return text
|
||||
|
||||
def speak_text(
|
||||
|
||||
Reference in New Issue
Block a user