From 0bd5e025348a861e53e02cd46775c867bd17376f Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Wed, 3 Mar 2021 20:23:28 -0600 Subject: [PATCH] chore: jptesseract now behaves as expected --- .local/bin/jptesseract | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/jptesseract b/.local/bin/jptesseract index 92b7c26..b4e880d 100755 --- a/.local/bin/jptesseract +++ b/.local/bin/jptesseract @@ -21,8 +21,8 @@ cd /tmp/jptesseract || exit; # Screenshot with flameshot, save to /tmp directory if flameshot gui -d "$DELAY" -r --path /tmp/jptesseract/.useless > /tmp/jptesseract/jp_text_image.png; then # Read from /tmp directory with Tesseract - tesseract -l jpn /tmp/jptesseract/jp_text_image.png /tmp/jptesseract/jp_output - - # Take output and send it to the clipboard - xclip -selection clipboard < /tmp/jptesseract/jp_output.txt; + tesseract -l jpn -c preserve_interword_spaces=1 /tmp/jptesseract/jp_text_image.png /tmp/jptesseract/jp_output + + # Remove \f which will be present at the end of jp_output + tr -d '\f' < /tmp/jptesseract/jp_output.txt | xclip -selection clipboard; fi