Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

@CorentinTh
Copy link
Member

No description provided.

@CorentinTh CorentinTh requested a review from Copilot June 29, 2025 12:57
@CorentinTh CorentinTh self-assigned this Jun 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds configuration support for Tesseract OCR, allowing users to specify custom OCR languages for text extraction. Key changes include:

  • Introduction of new configuration types in src/types.ts.
  • Updates to extractors and use case functions to pass and validate a configuration object.
  • Enhancements to tests with concurrent execution and fixture configuration.

Reviewed Changes

Copilot reviewed 10 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Added ExtractorConfig and PartialExtractorConfig types.
src/extractors/img.extractor.ts Updated the extractor to receive a config parameter and use its languages.
src/extractors.usecases.ts Modified extractText to parse and pass configuration.
src/extractors.usecases.test.ts Updated fixture handling; tests now run concurrently with config support.
src/extractors.models.ts Updated extractor definition to require a config parameter.
src/config.ts Added config parsing to validate and apply Tesseract languages with a default.
src/config.test.ts Added tests to verify configuration parsing.
package.json Added dependency on @corentinth/chisels.
fixtures/009-png-with-french-text/* Updated expected output and added fixture configuration.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

const mimeType = mime.getType(fixture);
for (const fixture of fixturesDir) {
// use test.concurrent to run the tests in parallel -> need to use the provided expect
test.concurrent(`fixture ${fixture}`, async ({ expect }) => {
Copy link

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using the globally imported 'expect' instead of destructuring it from the test context in the test.concurrent callback, as this pattern may be non-standard for Vitest.

Suggested change
test.concurrent(`fixture ${fixture}`, async ({ expect }) => {
test.concurrent(`fixture ${fixture}`, async () => {

Copilot uses AI. Check for mistakes.
@CorentinTh CorentinTh enabled auto-merge (squash) June 29, 2025 12:59
@CorentinTh CorentinTh merged commit 2149b50 into main Jun 29, 2025
1 check passed
@CorentinTh CorentinTh deleted the ocr-language branch June 29, 2025 13:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants