home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / diffword.icn < prev    next >
Text File  |  2000-07-29  |  822b  |  32 lines

  1. ############################################################################
  2. #
  3. #    File:     diffword.icn
  4. #
  5. #    Subject:  Program to list different words
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 9, 1989
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program lists all the different words in the input text.
  18. #  The definition of a "word" is naive.
  19. #
  20. ############################################################################
  21.  
  22. procedure main()
  23.    local letter, words, text
  24.  
  25.    letter := &letters
  26.    words := set()
  27.    while text := read() do
  28.       text ? while tab(upto(letter)) do
  29.          insert(words,tab(many(letter)))
  30.    every write(!sort(words))
  31. end
  32.