Word count and nextWordFromIndex:forward: - not good?
Word count and nextWordFromIndex:forward: - not good?
- Subject: Word count and nextWordFromIndex:forward: - not good?
- From: Keith Blount <email@hidden>
- Date: Sat, 6 Aug 2005 02:27:04 -0700 (PDT)
Hello,
I have a word count feature in my text editing app
which is based on parsing whitespace. This works well,
but it has been brought to my attention that this will
not work for languages like Japanese. Although I
probably won't be localising any time soon, I don't
want to limit my app to certain languages.
NSAttributedString's -nextWordFromIndex:forward:
method looks like the perfect solution for this.
However, the docs seem to suggest that this method
should *not* be used for word counts:
"This method is intended for moving the insertion
point during editing, not for linguistic analysis or
parsing of text."
On the other hand, I found a previous post on this
list asking about word counts, and Douglas Davidson,
the Apple text system guru, suggesting this method for
precisely this purpose.
Does anybody have a solution/answer to this? Is it
okay to use -nextWordFromIndex:forward: for a word
count (and a live word count at that)? If not, what
problems does this cause? And also if not, does
anybody have a word count solution that isn't limited
to certain languages (which would presumably need to
come from Appkit language analysis methods...).
Many thanks for any advice,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden