ppn2ocr: Make PPN a command line parameter

pull/27/head
Gerber, Mike 5 years ago
parent 2a4b204fbe
commit 1585247482

@ -1,16 +1,19 @@
#!/bin/sh #!/bin/bash
#ppn="PPN719671574" # Get OCR results as a OCR-D workspace for a given PPN
#ppn="PPN726351202" # Einblattdruck
#ppn=PPN787969397 # Folz, Hans: Abenteuerliches Klopfan, 1481
#ppn=PPN833534149 # Der von Wienn Rueff was ordnung || die Burger auf denen plaetzen ... , 1528
ppn=PPN77164308X # Bericht des Evangelischen Vereins an seine Mitglieder und Freunde , 1915
set -e # Abort on error
set -e
self_dir=`dirname $0` show_help() {
self_dir=`realpath $self_dir` cat <<-EOH
Usage: $0 PPN77164308X
Get OCR results as a OCR-D workspace for a given PPN
Options:
--help Show this message and exit.
EOH
}
make_workspace () { make_workspace () {
ppn=$1 ppn=$1
@ -40,6 +43,23 @@ make_workspace () {
} }
# Command line parameters
OPTS=`getopt -o h --long help -- "$@"`
eval set -- "$OPTS"
while true; do
case "$1" in
-h|--help) show_help; exit; shift;;
--) shift; break;;
*) break;;
esac
done
if [ -z "$1" ]; then show_help; exit; fi
ppn=$1
# From here, the magic happens
self_dir=`dirname $0`
self_dir=`realpath $self_dir`
make_workspace $ppn $ppn make_workspace $ppn $ppn
$self_dir/run-docker-hub -I PRESENTATION --skip-validation $self_dir/run-docker-hub -I PRESENTATION --skip-validation

Loading…
Cancel
Save