X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=blobdiff_plain;f=es%2Fxml%2Fispell-pae.sh;fp=es%2Fxml%2Fispell-pae.sh;h=58441b18107f5daa6ae295086ee4b4d218fabd4c;hp=0000000000000000000000000000000000000000;hb=f4bdee5083ca9a72713637e1e979aa183e06faea;hpb=97545603aea8298f1eceb604ff65085cc7adfced diff --git a/es/xml/ispell-pae.sh b/es/xml/ispell-pae.sh new file mode 100755 index 0000000..58441b1 --- /dev/null +++ b/es/xml/ispell-pae.sh @@ -0,0 +1,44 @@ +#!/bin/sh -e +# +# Do a spell check of PAE files using a standard dictionary +# + +DICTFILE=pae-dict.ispell + +check_dict() { + [ -r "$DICTFILE" ] && return 0 + [ -e "$DICTFILE" ] && echo "ERROR: Dictionary file $DICTFILE does not exist. Incomplete checkout?" >&2 + [ ! -f "$DICTFILE" ] && echo "ERROR: Dictionary file $DICTFILE is not a regular file." >&2 + return 1 +} + +usage() { + echo "Usage: $0 book.xml [book2.xml ...]" +} + +if [ -z "$*" ] ; then + usage + exit 1 +fi + +if ! check_dict ; then + echo "There was an error with the dictionary file. Aborting" >&2 + exit 1 +fi + +for file in $* ; do + if [ -f "$file" ] && [ -r "$file" ] ; then + echo "Running spell check for $file" + ispell -H -p $DICTFILE $file + else + echo -n "ERROR: Will not check '$file'" >&2 + if [ ! -e "$file" ] ; then + echo -n " it does not exist." >&2 + elif [ ! -f "$file" ] ; then + echo " it is not a regular file." >&2 + fi + echo + fi +done + +exit 0