From b3d73102fc41ed85ae77bfcd9d852f17707ced82 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 21 Aug 2025 23:29:45 -0400 Subject: [PATCH] Fenrir will now read dots in the middle of or at the beginning of words regardless of punctuation settings. --- src/fenrirscreenreader/core/outputManager.py | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/fenrirscreenreader/core/outputManager.py b/src/fenrirscreenreader/core/outputManager.py index 44555e62..68e5690a 100644 --- a/src/fenrirscreenreader/core/outputManager.py +++ b/src/fenrirscreenreader/core/outputManager.py @@ -77,6 +77,27 @@ class OutputManager: def get_last_echo(self): return self.last_echo + def process_mid_word_punctuation(self, text): + """ + Process punctuation that appears mid-word to ensure proper pronunciation. + Specifically handles dots between word characters (e.g., "settings.conf" -> "settings dot conf") + and dots at word beginnings (e.g., ".local" -> "dot local") + while preserving sentence-ending periods and other punctuation behavior. + """ + 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'(?