OCR: choose the recognizer language per call (find_text, index_recording, wait_for_change)

Ouverte
#379 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
56/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
backend

Piste de recherche

Start with src/utils/ocr.ts and trace how OCR is created and how language handling is reported; then follow the callers in src/tools/findText.ts, src/tools/doctor.ts, and src/utils/recordingIndex.ts. Check how index_recording builds its cache key and how caller options are documented. Done means the selected language is used, unsupported languages report installed options, doctor lists them, and changing language invalidates the index cache.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

effort: medium enhancement help wanted priority: medium

Summary

OCR always uses the Windows user-profile languages. A recording of a Japanese or German app on an English-profile machine is read with the English recognizer, even when that language pack is installed. There is no way to choose the language per call.

Where

  • src/utils/ocr.ts:309 (OcrEngine::TryCreateFromUserProfileLanguages())
  • src/utils/ocr.ts:72-75 (the only language handling is an error hint)
  • Callers: find_text, index_recording, wait_for_change (mode text), bug_report, pipeline redact.secrets

Suggested fix

  • Add an optional language (BCP-47, such as ja, de-DE) to the OCR helper. Use OcrEngine::TryCreateFromLanguage([Windows.Globalization.Language]::new($lang)) and fail clearly when IsLanguageSupported is false, listing OcrEngine.AvailableRecognizerLanguages.
  • Expose it on the callers above (or as one SCREENCAST_OCR_LANGUAGE default plus a per-call override).
  • doctor lists the installed OCR languages.
  • Include the language in the index_recording cache key, so switching languages re-indexes.

Acceptance criteria

  • find_text { language: "de-DE" } uses the German recognizer when installed
  • An uninstalled language returns an error naming the installed ones
  • doctor reports available OCR languages
  • Index cache is invalidated on language change

Getting started

  • Relevant files: src/utils/ocr.ts, src/tools/findText.ts, src/tools/doctor.ts, src/utils/recordingIndex.ts
  • Run npm run docs after adding the parameter

Filed by repo-audit/feature-ideas at 1ac339f. Severity: medium. Effort: M. audit-key: enhancement|src/utils/ocr.ts|language

Langage dominant
TypeScript
Étoiles
1
Forks
4
Merge moyen
8 h 17 min
PR mergées (30 j)
46

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/screencast-mcp

Toutes les issues de TMHSDigital/screencast-mcp

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.