Newsgroups: sci.crypt
Path: msuinfo!caen!zaphod.mps.ohio-state.edu!usc!ucla-cs!ucla-ma!euphemia!pmontgom
From: pmontgom@euphemia.math.ucla.edu (Peter Montgomery)
Subject: Re: More analysis programs
Message-ID: <1992Jan20.191444.28263@math.ucla.edu>
Sender: news@math.ucla.edu
Organization: UCLA Mathematics Department
References: <1992Jan20.165449.26864@uwm.edu>
Date: Mon, 20 Jan 92 19:14:44 GMT

In article <1992Jan20.165449.26864@uwm.edu> rick@ee.uwm.edu writes:
>Would anyone else care to post analysis programs they've found useful?

	I have found this csh script useful in
finding misspellings missed by "spell".
For example, in one document I noticed the word "roll" even
though it discussed neither motion nor food (should have been "role").
When applied to software programs, I uncover errors like
inconsistent capitalization of variable names (both XYZ and xyz).
You may want to change the list of significant characters on the "tr"
line (e.g., in a document you might want "mother-in-law"
to show up as one word, whereas in a program you
want X1-X2 to show up as one occurrence of X1 and one of X2).

	Problem: deroff removes characters following `/',
so TeX macro names don't show up as a unit.

#! /bin/csh -f
# This script produces a list of all words used in a document, and
# their frequencies.
#
#       Usage:     words docname
#
# where "docname" is the name of the document.

deroff $* | tr -cs 'A-Za-z0-9-_/*$\\' '\012' |    \
	    sort -f                          |    \
	    uniq -c                          |    \
	    pr -2 -w84 -h $cwd
--
        Peter L. Montgomery              Internet: pmontgom@math.ucla.edu
        Department of Mathematics, UCLA, Los Angeles, CA  90024-1555  USA
Is the depression over?  Will 17 years software experience help when I get
a Ph.D. in March?  Interested in computer performance and number theory.
