[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
RE: Program to count word-repetitions?
- Subject: RE: Program to count word-repetitions?
- From: Jack Shafer jacksh@xxxxxxxx
- Date: Thu, 8 Jan 1998 11:14:37 -0800
One of our resident XPL geniuses--Distefano? Baehr? Holmgren?--once wrote an
XPL routine for me called count.pm that produces a single column document
that contains every unique word in a file and the number of times it appears
in the document.
WARNING: You run count.pm on an open file, and because it changes that file
into the COUNT file you should make sure you have a copy of the file you're
counting somewhere else on your hard drive.
Here it is as an attachment. ≪COUNT.PM≫
--Jack Shafer
> -----Original Message-----
> From: Eric Van Tassel [SMTP:101233.342@xxxxxxxx]
> Sent: Thursday, January 08, 1998 7:53 AM
> To: XyWrite_mailing_list
> Subject: Program to count word-repetitions?
>
> One of my major vices as a writer is the over-use of certain favorite
> words, and I was once delighted to see my editor employ a program to help
> me avoid this pitfall.
>
> A couple of years back, when I wrote a piece for the N.Y. Times (Sunday
> Arts & Leisure), the article was set using a program that seemed to be
> XyWrite-related. When I saw first proofs of the article, each place where
> I
> had re-used the same word was flagged, with a code indicating the number
> of
> times that word had been used.
>
> Does anyone know how it's done? Is there an XPL routine I can use, or
> adapt, to perform this function?
>
> It would be especially helpful, though not absolutely essential, if the
> program linked up uses of the same word in different parts of speech (e.g.
> "find/found"). Perhaps this could be dealt with (albeit tediously) if I
> compiled, over time, my own dictionary of words and expressions that I
> have
> a particular weakness for. If the program used such a dictionary, it might
> also employ (though at this moment I don't see how I would write such a
> routine) cross-links between syntactical variants of the same root word.
> But such a refinement would be a luxury: it would be nice if I could just
> catch the crudest direct repetitions.
>
> Cheers
> Eric Van Tassel
>
>
> PS: I've just seen a possible way to simplify the creation of the
> dictionary of my own particular "dangerous" words. Even if the program
> isn't sensitive to syntactical variants, perhaps it could be asked to save
> a list of all the words that it has had to alert me to in a particular
> job.
> I could merge the word lists from several jobs, to build the core of my
> personal pitfall dictionary; then all I'd have to do would be to
> (presumably manually) add variant parts of speech.
> But (as Richard III says) I'm running before my horse to market: first I
> need the program itself.
begin 600 COUNT.PM
MKDQ"+6-O=6YT+6%L+G!M('1O(&-O=6YT(&ED96YT:6-A;"!N=6UB97)SK_^!
M0:Y353DQ+/^!'V5S(##_@0G_@1__@3__@'VO_X$?97,@,?^!":Y'3"UA='1R
M:6)U=&6O#0H-"D%T('1H92!B96=I;FYI;F<@=&AE(&1IO/3VN25,Y.:\IKZY'
M3"UE;F2OKD5)K_^!"ZY'3"UT=V^O#0H-"D1E9FEN92!T:&4@9FER2!R971U2!E
M