Re: Approaches for this Matching Problem?
Re: Approaches for this Matching Problem?
- Subject: Re: Approaches for this Matching Problem?
- From: WT <email@hidden>
- Date: Mon, 22 Jun 2009 13:44:25 +0200
On Jun 22, 2009, at 10:10 AM, Steve Cronin wrote:
BUT in my case I don't care where, what word or how often - I just
want to know IF a tag occurs in thePhrase!!
thePhrase = 8 words
theTags = 150 words
It seems that you have two sets (in the mathematical sense) and all
you want to know is if their intersection is non-empty. Easiest
solution: create two NSSet objects and use Apple's optimized
implementation of set intersection:
BOOL tagAppearsInPhrase = [tagSet intersectsSet: phraseSet];
Anything you do otherwise will likely not be as fast.
Wagner
_______________________________________________
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