Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(correction-learner): tokenize non-ASCII so auto-learn works for Cyrillic/CJK/etc. (#666)

wake0up0ne07883c595bc69
diff --git a/src/utils/correctionLearner.js b/src/utils/correctionLearner.js
index 0431a8000..74c5da416 100644
--- a/src/utils/correctionLearner.js
+++ b/src/utils/correctionLearner.js
@@ -28,7 +28,7 @@ function editDistance(a, b) {
function tokenize(text) {
return text
.split(/\s+/)
- .map((w) => w.replace(/^[^\w]+|[^\w]+$/g, ""))
+ .map((w) => w.replace(/^[^\p{L}\p{N}_]+|[^\p{L}\p{N}_]+$/gu, ""))
.filter((w) => w.length > 0);
}