-
Notifications
You must be signed in to change notification settings - Fork 6
Rofi language multiselect #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedFailed to post review comments. Configuration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds CLI-selectable OCR languages: Python now accepts a langs argument and validates it against pytesseract; shell script adds interactive language selection (rofi), logging, preflight file/dir checks, and passes chosen languages to the Python OCR step. Minor formatting and error-handling updates included. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant SH as OCR4Linux.sh
participant TS as tesseract
participant PY as OCR4Linux.py
participant PT as pytesseract
U->>SH: run script
SH->>TS: tesseract --list-langs
TS-->>SH: available langs
SH->>U: rofi multi-select (includes ALL)
U-->>SH: selected langs
SH->>SH: check_if_files_exist()
SH->>PY: python OCR4Linux.py <img> <out> <langs>
PY->>PT: get_languages()
PT-->>PY: recognized langs
PY->>PY: process_langs(preferred)
alt resolved langs empty/error
PY-->>SH: exit 1 (error)
else resolved langs valid
PY->>TS: tesseract -l <resolved langs> ...
TS-->>PY: OCR result
PY-->>SH: output produced
SH->>U: clipboard/output updated
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Ruff (0.12.2)OCR4Linux.py�[1;31mruff failed�[0m Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 language selection functionality to the OCR4Linux tool, allowing users to choose their preferred languages for OCR operations through a rofi multiselect dialog. This enhancement aims to improve OCR accuracy and performance by using targeted language models.
- Adds a
choose_lang()function that presents available Tesseract languages via rofi multiselect - Modifies the Python OCR script to accept and process language parameters
- Updates argument handling to support the new language parameter
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| OCR4Linux.sh | Adds language selection UI and passes selected languages to Python script |
| OCR4Linux.py | Updates to accept language parameter and validates selected languages against available Tesseract languages |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
I tried the code in this pr and it didn't work at all. |
|
you are more than welcome to implement some of the issues in the repo btw |
Lets user choose theirs preferred language for the current operation. This improves the ocr results and probably is faster.