100 WORDS
auto-counter
|
Notes: This is my first Java applet. I wrote it to facilitate the 100words
writing prompt (rule: write exactly 100 words, any topic, per day), as well
as to finally learn some Java.
You can type directly in the window, or paste text in. Although it's designed
to count to 100, it can hold significantly more than that (when testing it,
I got up to 250,000 words before giving up).
I've made some options available because, as the 100words site points out,
different people have different preferences for counting.
- Count Numbers: Treat numbers just like letters. C3PO counts
as one word, as does 867-5309 (with "Ignore Hyphens" also checked).
When this is turned off, C3PO counts as two words, and 867-5309 counts as
none. (/, ,, and . between digits are counted as digits: 3/4, 4.6,
and 5,432.4 are each counted as either one word or none, depending on the
setting. When this is on, "This/dark 3/4 night" is counted as four
words.)
- Ignore Chars > 127: Count any characters above 127 range
as letters. This range contains many foreign letters, but be forewarned that
it also contains some non-symbols as well (typeset quotes and dashes are treated
like their non-typeset counterparts, to the best of my current ability; special
characters can be flakey -- let me know if you encounter any problems).
- Ignore Apostrophes: Count apostrophes (', `) as letters when
they're between letters, spaces otherwise. When this is selected, can't is
one word; otherwise, it's two.
- Ignore Hyphens: Count single hyphens (-) as letters when they're
between letters, spaces otherwise. When this is selected, two-way is one word;
otherwise, it's two. Note: Double hyphens (--) are always counted as
spaces.
- Count HTML tags: Count any material between < and >.
If this is not selected, any information after a < will be ignored until
a > is encountered. Please note that tags within words won't break
the count: this (t<b>h</b>is) is one word, not three (it
becomes five if this option is selected).
Also, you'll note that the word count indicator changes color. Green
means you have plenty of space left, yellow means
you're getting close, black means you've met the mark, and red
means you've gone over the limit.
Once you're done typing, simply select the text in the window, and copy and
paste it to the word processor of your choice.
Would you like the code for this? Click here.
Please report any errors encountered, or forward any suggestions, to me.
Namaste: Have a glorious day. =}
Original code and this page (c)2002 Paul Kershaw. All rights reserved. Code
is offered in the spirit of open source, and should not be modified or resold
for commercial purposes with the explicit prior consent of the author.