#!/bin/csh -f

# Copies each file or standard input to standard output with words
# output one per line and with punctuation removed.

cat $* | sepwords | depunc \
  | tr -s '\-*_/~\011\040' '[\012*]' \
  | egrep -v '^([A-Z]\.|&)$' \
  | sed s+\[\]\"\'\)\}\.\!\?\,\;\:\]\*\$++ \
  | sed s+\^\[\"\`\(\{\[\]\*++ \
  | grep -v \^\[\'\#\$\]\\\{0,1\\\}'[0-9.+()]*$' \
  | grep -v '^[0-9.+()]*%\{0,1\}$' \
  | egrep -v '^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$' \
  | egrep -v '^[0-9]*([0456789]th|11th|12th|13th|[023456789]?(1st|2nd|3rd))$'
