goldendict-ng/howto/How to use ocr together with GoldenDict.md

71 lines
2.5 KiB
Markdown
Raw Normal View History

# Current Situation
GoldenDict did offer a functionality to translate the word under cursor(when scan popup been enabled) on Windows.
the technique used there is old and can not work crossplatform .
with the help of another great tool [Capture2Text](https://sourceforge.net/projects/capture2text/) ,GoldenDict can work with ocr seamlessly.
# Note
Capture2Text has offered Windows precompiled executable files.I think it would be easier and possible to make it work on Linux as some afforts have tried.
2022-01-28 03:28:47 +00:00
- [Capture2Text Linux Port](https://github.com/GSam/Capture2Text )
- [another on nixos](https://github.com/sikmir/nur-packages/blob/7c876e3fb20160781207a8f652fb052647e6da0d/pkgs/misc/capture2text/default.nix) from [sikmir](https://github.com/goldendict/goldendict/issues/1445#issuecomment-1022972220)
# Configuration
after installation of both software.
configure the Capture2Text ,see screenshot following
## configure external `Call Executable` path (Windows for example)
`path\GoldenDict.exe "${capture}"`
![image](https://user-images.githubusercontent.com/105986/151507994-97ab732d-686a-47b1-b950-3b2db076ef4c.png)
## configure hotkey
I only left three of them .
![image](https://user-images.githubusercontent.com/105986/151481239-16cbb733-746c-425d-bc6c-2bb5e5a158c5.png)
## configure `First word only`
without this configuration ,it will capture the last word of
![image](https://user-images.githubusercontent.com/105986/151481312-4e9bc457-6667-4e80-95bd-6f2ad58c37e1.png)
## Use it
2022-01-28 04:55:26 +00:00
place the cursor on the word (can be on the image ),press
- Win+W to capture the first word.
2022-01-28 04:56:31 +00:00
![image](https://user-images.githubusercontent.com/105986/151481735-6c1c7fc1-715f-4f5c-a98c-7452099b9709.png)
2022-01-28 04:55:26 +00:00
- Win+Q select rectangle.
![image](https://user-images.githubusercontent.com/105986/151489148-6fb09787-8d27-4c55-92bb-b385e23ed859.png)
2022-01-28 04:56:31 +00:00
2022-01-28 04:55:26 +00:00
result:
2022-01-28 04:56:31 +00:00
2022-01-28 04:57:41 +00:00
![image](https://user-images.githubusercontent.com/105986/151489807-71231884-75bf-45e7-9bfa-b5242be1b189.png)
2022-01-28 04:55:26 +00:00
2022-01-30 08:03:37 +00:00
## use Capture2Text on Linxu
2022-01-30 08:04:36 +00:00
### download and build the capture2text
https://github.com/xiaoyifang/Capture2Text
2022-01-30 08:03:37 +00:00
![2022-01-30 15-54-35屏幕截图](https://user-images.githubusercontent.com/105986/151691526-f28cc053-f6e0-4099-b677-f7a4657aa9fc.png)
### settings
![2022-01-30 15-54-35屏幕截图1](https://user-images.githubusercontent.com/105986/151691583-eda3e059-a77f-4476-a5a5-18d34463005e.png)
### start capture
`Ctrl+Shift+Q`
![image](https://user-images.githubusercontent.com/105986/151691692-955caf26-e828-4ffe-a630-b17b66b8a955.png)
### end capture
press `Ctrl+Shift+Q` again.