home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / ISPSRC.ZIP / makedict.sh < prev    next >
Text File  |  1991-06-18  |  2KB  |  61 lines

  1. : Use /bin/sh
  2. #
  3. # $Id: makedict.sh,v 1.5 89/04/28 01:12:10 geoff Exp $
  4. #
  5. # Copyright 1987, 1988, 1989, by Geoff Kuenning, Manhattan Beach, CA
  6. # Permission for non-profit use is hereby granted.
  7. # All other rights reserved.
  8. # See "version.h" for a more complete copyright notice.
  9. #
  10. # $Log:    makedict.sh,v $
  11. # Revision 1.5  89/04/28  01:12:10  geoff
  12. # Change Header to Id;  nobody cares about my pathnames.
  13. # Revision 1.4  88/12/26  02:31:22  geoff
  14. # Add a copyright notice.
  15. # Revision 1.3  87/09/24  23:24:28  geoff
  16. # Get rid of colons in the optional-variable setting (Israel Pinkas).
  17. # Revision 1.2  87/05/28  21:15:29  geoff
  18. # Fix a typo
  19. # Revision 1.1  87/05/10  20:19:23  geoff
  20. # Initial revision
  21. #
  22. #    Make a beginning dictionary file for ispell, using an existing
  23. #    speller.
  24. #
  25. #    Usage:
  26. #
  27. #    makedict file-list
  28. #
  29. #    The specified files are collected, split into words, and run through
  30. #    the system speller (usually spell(1)).  Any words that the speller
  31. #    accepts will be written to the standard output for use in making
  32. #    an ispell dictionary.  Usually, you will want to run the output
  33. #    of this script through "munchlist" to get a final dictionary.
  34. #
  35.  
  36. # This program must produce a list of INCORRECTLY spelled words on standard
  37. # output, given a list of words on standard input.  If you don't have a
  38. # speller, but do have a lot of correctly-spelled files, try /bin/true.
  39. #
  40. SPELLPROG="${SPELLPROG-spell}"
  41.  
  42. TMP=${TMPDIR-/tmp}/mkdict$$
  43.  
  44. case "$#" in
  45.     0)
  46.     set X -
  47.     shift
  48.     ;;
  49. esac
  50.  
  51. trap "/bin/rm ${TMP}; exit 1" 1 2 15
  52.  
  53. cat "$@" | deroff | tr -cs "[A-Z][a-z]'" '[\012*]' | sort -uf -o ${TMP}
  54. $SPELLPROG < ${TMP} | comm -13 - ${TMP}
  55. /bin/rm ${TMP}
  56.