Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Good word counting algorithm?

Good word counting algorithm?
Thread Tools
GeeYouEye
Junior Member
Join Date: Mar 2003
Location: Walnut Creek, CA
Status: Offline
Reply With Quote
May 12, 2004, 01:19 PM
 
I was wondering: does anyone know a better word counting algorithm than counting spaces (or, in Cocoa [[theString componentsSeparatedByString:@" "] count])? Thanks.
I bring order to chaos. You are in chaos windows, you are the contradiction, a bug wishing to be an OS.
     
larkost
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
May 12, 2004, 02:15 PM
 
You seem to be working in Obj-C... is that a requirement? What are you actually looking at doing? Is this for english only? Does it need unicode support? Is this simple text, or are we looking at html/programming/etc...

What I am trying to get across is that you have not asked a solid question, so there is no way anyone could really approach answering it. You also do not indicate that you have researched this topic at all, as there are a whole lot of word parsing algorithms out there for different problem spaces.

executive summary: figure out your question first, then research it, then post.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
May 12, 2004, 03:36 PM
 
Originally posted by GeeYouEye:
I was wondering: does anyone know a better word counting algorithm than counting spaces (or, in Cocoa [[theString componentsSeparatedByString:@" "] count])? Thanks.
Counting spaces will be useless in most cases. There are too many word separators which do not incorporate spaces (punctuation, newlines, etc). Like the above poster said, you need to figure out what you want, first.
     
AirSluf
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
May 18, 2004, 09:37 PM
 
( Last edited by AirSluf; Nov 9, 2004 at 01:40 AM. )
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:19 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,