# Description: 
#   A script to provide what is called a "gist" translation of a text file
#   It was called tradoos because apparently there is some translating
#   software called 'trados'
#
# Notes:
#   The naming convention for this script uses the perhaps RFC language
#   codes which are more commonly used in relation to 'language negotiation'
#   for web-browsers and web-servers.

# See Also:
#   gist-translate-blah-multi.sh
3

 for line in $(cat $1 | sed "/^[^a-zA-Z]*$/d" | tr ' ' '#')
 do
   s=$(echo $line | tr '#' ' ')
   echo $s
   #-- process each word in the line, reducing to lower case
   #-- and removing puntuation
   for v in $(echo $s | tr '[A-Z]' '[a-z]' | sed "s/[^a-z]/ /g")
   do
     i2e.sh -e $v | sed "/^ *$/d"  \
       | head -1 | sed "s/not found in.*/[???]/gi"  \
       | sed "s/^[^:]*://" \
       | sed 's/A (abrev\. de amperio)/uno/i'  \
       | tr '\n' ' '
   done
   echo ""
   echo "+++++++++"
 done