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

Offen
#379 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
56/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
1
Forks
4
Ø Merge
8 Std. 17 Min.
Gemergte PRs (30 T.)
46

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/screencast-mcp

Alle Issues in TMHSDigital/screencast-mcp

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.