WordCountDoc.tioga
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Wes Irish, January 12, 1989 4:06:06 pm PST
Last Edited by: Gasbarro November 14, 1988 5:11:42 pm PST
Jules Bloomenthal November 1, 1990 6:49 pm PST
WordCount
PCEDAR 2.0 —
WordCount
Wesley Irish (among others)
© Copyright 1988, 1990 Xerox Corporation. All rights reserved.
Abstract: WordCount is very similar to the UNIX command wc. WordCount counts the number of lines, words, and characters in a file (or stream, or rope, or selection). Wc can be used from the Command Tool, via a "Top Button", and via a programers interface.
Created by: ..., Nix, Beach, Atkinson, Swinehart, WIrish, ...
Maintained by: Wesley Irish <WIrish.pa>
Keywords: Tioga, word count, count, lines, words, characters, carriage return, line feed, newline.
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

1. Command Tool
WordCount [-l] [-w] [-c] [-s] [-f] [-a] [-t] [file1] [file2] ... [filen]
WordCount counts lines, words, and characters in the specified file(s), or in the current selection if the -s option is used. It also reports a total count if two or more files are counted or if the -a option is used specifying that the individual counts should be added together and only the total given.
WordCount normally defines a word to be a string of characters delimited by white-space; that is spaces, tabs, newlines, or other control characters. The -t option defines words to be similar to cedar tokens.
Tioga documents are seen as simple documents (comments and formatting evaporate).
Lines are defined to be the number of CR, LF, CR/LF pairs encountered. If the last line is not terminated by a CR and/or LF it is counted as a line none the less.
WordCount is very similar to the UNIX command wc.

OPTIONS
l Count lines.
w Count words.
c Count characters.
s Count the current selection. (Useful for a CommandTool button.)
f Don't include file names in output message.
a Individual counts should be added together and only the total given.
t Define word breaks to be similar to cedar tokens rather than white-space.
The default is -lwc (count lines, words, and characters).
When files are specified on the command line, their names will be printed along with the counts (unless you use the -f switch).
2. Tioga
The WordCountButton command adds a WC button to the row of "Top Buttons". Clicking this button with the left mouse button will report the number of lines, words, and characters in the current selection via the Message Window. Clicking with the right button will report for the entire viewer. Holding the shift key will count using token mode rather than white-space mode.
3. Programers interface
The WordCount interface will count the number of lines, words, and characters in a file (or stream, or rope, or the current selection).