commit 800bfc6c36b4b1c0cf10ed715ab0ab18df6b5668 Author: Castro0o Date: Fri Feb 23 09:25:56 2018 +0100 Moved output list.txt,plain.txt from src/ to output/. src/. Otherwise git will want to track these outputs, when it should only be tracking the tools :) Added some color vars diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f707e4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +images/** +output/** + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c4244bb --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +images=$(wildcard images/*.jpg) +# creates: images/001.jpg images/002.jpg images/000.jpg + +color_w:="\033[0;29m" # add color to output +color_r:="\033[0;31m" # echo $(color_r) something +color_g:="\033[0;32m" +color_b:="\033[0;34m" +space:= $(empty) $(empty) +newline:= '\n' +listtxt:= $(subst $(space),$(newline),$(images)) +# subst is a way to do string replacements, it works like this: $(subst $(delimitator),$(replacement),$(list)) +# it's used here to make a list of the images, with one filename on each line + + +dirs: # create the directories for the working structures + mkdir images # scanned image dir + mkdir output # outputs dir + @echo $(color_r)'Directories made' + +tesseract: + echo $(listtxt) > output/list.txt + tesseract output/list.txt output/plain + +myscript: tesseract + cat output/plain.txt | python3 src/myscript.py > output/a-new-file.txt + + +# Changes: moved output list.txt,plain.txt from src/ to output/. src/ should be a dir for source-code and not outputs. Otherwise git will want to track these outputs, when it should only be tracking the tools :) + +# ** Makefile Syntax notes ** +# @ preceding command tells make not to print the command being executed +# diff --git a/README b/README new file mode 100644 index 0000000..12c24cc --- /dev/null +++ b/README @@ -0,0 +1,8 @@ + +*Tools for working with scanned pages* + +Makefile: +* `make dirs`: create the working folder structure +* `make tessaract` +* `make myscript` +