Repository navigation
Conversation
neur0map
left a comment
There was a problem hiding this comment.
🔴 Changes requested — 0 critical and 1 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.
🦊 mika's reviewIncremental review: new commits since the last checkpoint. Summary
Change diagramflowchart LR
Input["Language override or locale"] --> OCR["ryoku-cmd-ocr"]
Models["System and user language data"] --> OCR
OCR --> Tesseract["Tesseract"]
Tesseract --> Clipboard["Cleaned clipboard text"]
Estimated review effort: 2/5 · risk: medium 📁 Walkthrough details
|
|
Thanks for the work here, this needs to target unstable-dev instead of main |
ea039b7 to
95c3707
Compare
|
All four findings are addressed in 95c3707:
Retested on the same box: |
neur0map
left a comment
There was a problem hiding this comment.
🔍 Review findings — 1 blocking issue(s): see the inline comments and the walkthrough for details.
Blocking findings were addressed (verified at 95c3707cd6).
95c3707 to
1f0d6ad
Compare
|
The fifth finding is fixed in 1f0d6ad: Verified with |
neur0map
left a comment
There was a problem hiding this comment.
🔴 Changes requested — 0 critical and 1 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.
ryoku-cmd-ocr called tesseract with no -l, so every capture ran the eng model. Chinese text came back as Latin-looking garbage, and the 2>/dev/null on the same line hid the missing-model error, which made a missing package look like a bad selection. The script now takes --lang, falls back to RYOKU_OCR_LANG and then to the session locale (zh, ja, ko, else eng), always keeping eng for mixed captures. Requested models are checked against tesseract --list-langs: a missing primary model stops the run with the package name to install, and a user-level pack under ~/.local/share/ryoku-ocr/tessdata works without root. Chinese output loses the spaces tesseract inserts between Han characters, so the copied text is usable as-is. tesseract-data-chi_sim, chi_tra, jpn and kor join optdepends on ryoku-desktop, since only eng data ships by default. Note: Fixed: OCR follows the session language and reports missing language data instead of copying garbage
1f0d6ad to
8446ca5
Compare
|
Both new findings are fixed in 8446ca5:
|
Blocking findings were addressed (verified at 8446ca5544).
What changed
ryoku-cmd-ocrcalledtesseract "$tmp" -without-l, so every capture ran theengmodel: Chinese text came back as Latin-looking garbage. The2>/dev/nullon that same line hid the missing-model error, so a box withouttesseract-data-chi_simlooked like a bad selection instead of a missing package.This PR:
--lang LANG, thenRYOKU_OCR_LANG, then the session locale (zh*tochi_sim,ja*tojpn,ko*tokor, elseeng), always withengappended for mixed captures;tesseract --list-langs: a missing primary model stops the run and names the package to install, a missing secondary one is dropped with a notice;~/.local/share/ryoku-ocr/tessdata(orRYOKU_OCR_TESSDATA), which is the only way a box without root gets a language;PDF 文件;tesseract-data-chi_sim,chi_tra,jpnandkortooptdependsonryoku-desktop, next to the existing hardtesseractandtesseract-data-eng;docs/ui-ux.mdand aFixedline toCHANGELOG.md.Say if you would rather have the language live in
shell.jsonor the Ryoshot settings page; the flag and the environment variable are the smallest surface that does not touch the Hub. The user-level tessdata directory is also easy to drop if you would rather keep packages as the only source of models.Area
ryoku(the script and its docs) andrelease(the PKGBUILD).How it was tested
On a running Ryoku box (Amaterasu v1.1.0, 0bf1174), driving the script the way Ryoshot does (
ryoku-cmd-ocr --file <png>) against a 56 px render of 今天下午三点在三楼会议室开会:SR F=REZZIWNEA=--lang chi_sim今天下午三总在三楼会议室开会--lang chi_sim+engHello world 123--lang chi_sim, no traineddataNo OCR data for chi_sim (install tesseract-data-chi_sim)--lang chi_tra, no traineddatachi_tra--nopeThe 总 for 点 is the chi_sim model, not the script. Clipboard and notifications were captured through a PATH shim first so the real session was untouched, then the script was run for real once to confirm the Ryoshot path end to end.
Checklist
[area] scope: summarycommit subject.CHANGELOG.mdupdated in the area I touched.--no-verify.bash -n(no Lua or QML in this change).docs/ui-ux.md.Confidence Score: 5/5

The PR appears safe to merge; all numbered previous findings are fixed.Summary
OCR now follows the selected language, checks available models, combines user and system data, and removes extra spaces in Chinese text.
Reviews (3) · Last reviewed commit: "[ryoku] ocr: follow the session language..." · Reviewed by Greptile