Re: when words aren't words
Re: when words aren't words
- Subject: Re: when words aren't words
- From: David Hanauer <email@hidden>
- Date: Mon, 14 Nov 2005 13:41:55 -0500
Words as seen by Tex-Edit Plus are not words as defined by the
AppleScript Language Guide. Useful, but not the same. TextEdit
gives the same result as AppleScript.
It sure would be nice if text processing applications had their own
text item delimiters. More than a decade ago a little application
called Scriptable Text Editor was supposed to show how it was to be
done. That bare bones text editor had its own text item delimiters.
Bill,
I think the issue of "words" can actually be complex. It partly
depends on what you would define as a "word".
I have worked with this issue in my AppleScript Studio application
"Word Counter".
http://www.supermagnus.com/mac/Word_Counter/index.html
(Read section on that web site titled "A note about how Word Counter works").
My program, which for the most part uses AppleScript's definition of
a word, doesn't always give the same results as other applications
such as Microsoft Word.
A few examples:
--------------
"when you count words -- it sometimes can vary"
-->Word Counter: 8 words
-->Microsoft Word: 9 words
--------------
"This is a $1,000,000 test of one,two,three."
-->Word Counter: 9 words
-->Microsoft Word: 7 words
--------------
It can also get complicated with hyphenated words. Are these single
words--or phrases that contain multiple words?
* e-mail
* mother-in-law
* non-breaking
URLs can also pose a challenge: "www.apple.com". One word or three?
Overall, my experience is that AppleScript does a very good job at
defining a word, but it will likely be important for you to test the
nuances of your own application/script.
David H.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden