Re: Approaches for this Matching Problem?
Re: Approaches for this Matching Problem?
- Subject: Re: Approaches for this Matching Problem?
- From: Jerry Krinock <email@hidden>
- Date: Sun, 21 Jun 2009 21:02:51 -0700
Given the numbers in your post, "3-5", "250" and "several", I'd say
you should just split the phrase into words, write an outer loop
for(words in phraseWords), an inner loop for(tag in tags), and inside
it all compare using -isEqualToString, breaking when found. "Just do
it."
You won't even know that this happened unless you log the
millseconds. I'd bet that the amount of time you spend writing this
code is going to exceed the the CPU minutes consumed by 10,000 users
doing 100 searches per day over the 5-year life your app.
Only thing that might require a little digging -- I believe that there
is probably a "correct" way to split a phrase into a set or array of
words which will work for non-Western languages. -[NSString
componentsJoinedByString:@" "] would be a cheesy solution.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden