Skip to content

Fix accented input matching and false misstrokes with Plover#276

Open
mekalika wants to merge 1 commit into
didoesdigital:masterfrom
mekalika:fix/unicode-steno-input-nfc
Open

Fix accented input matching and false misstrokes with Plover#276
mekalika wants to merge 1 commit into
didoesdigital:masterfrom
mekalika:fix/unicode-steno-input-nfc

Conversation

@mekalika
Copy link
Copy Markdown

@mekalika mekalika commented May 9, 2026

Problem

  • Lesson text and typed text could disagree when accents differed by Unicode normalization (e.g. precomposed é vs e + combining acute), so matching looked wrong compared to paste.
  • After normalizing, multiple input events in one debounced batch could still produce false misstrokes: strokeAccuracy treats same-length adjacent snapshots as extra attempts.

Changes

  • matchSplitText: Normalize expected and actualText to NFC before comparing; tests for José NFC/NFD.
  • App.tsx: Normalize textarea value to NFC so buffer/state aligns with matchSplitText prefixes; stop pushing buffer.slice(0, -1) into phrase attempts so one batch stays one steno stroke for stroke counting.

Testing

  • pnpm exec vitest run src/utils/matchSplitText.test.ts src/utils/strokeAccuracy.test.ts
  • Manual: Plover output for accented words (e.g. José) in a lesson.

Fixes #275

Normalize lesson and typed text to NFC so composed/decomposed accents
compare equal. Normalize textarea input so buffer slicing matches
matchSplitText output. Stop appending debounced buffer intermediates so
strokeAccuracy does not treat multi-event OS input as extra attempts.

Adds matchSplitText tests for NFC/NFD José.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

José always counted as a misstroke

1 participant