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

Aberta
#379 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
56/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
1
Forks
4
Merge médio
8h 17min
PRs com merge (30d)
46

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/screencast-mcp

Todas as issues de TMHSDigital/screencast-mcp

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.