• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A rant and a question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A rant and a question...


  • Subject: Re: A rant and a question...
  • From: Mike Blaguszewski <email@hidden>
  • Date: Tue, 25 Jul 2006 12:46:14 -0400

On Jul 25, 2006, at 11:46 AM, Brad Bumgarner wrote:

I probably just need to step back and take a different approach.

I don't know how you're doing it now, but how about thinking about it in terms of where the split point between first and last names is. Then generate queries with each split point and OR them all together. Oh, and for every query also include a version with First and Last reversed if you want to handle reverse-entered names. For example:


(First = "" AND Last = "Betty Jo Bealoski") OR
(First = "Betty" AND Last = "Jo Bealoski") OR
(First = "Betty Jo" AND Last = "Bealoski") OR
(First = "Betty Jo Bealoski" Last = ") OR
(First = "Jo Bealoski" AND Last = "Betty") OR
...

This sort of query maps easily to a nested ABSearchElement. It's a fully general algorithm, so it should work just as well for "Juana Inés de La Cruz." If you want to handle middle names then have two split points and throw out the middle, but since the Address Book GUI can't input middle names, you may not to need to.

Oh, and an implementation note: create an NSArray of tokens right away. If you try to run the algorithm using string indices you'll go crazy.

--
Mike Blaguszewski / Cocoa Hacker / Ambrosia Software, Inc.



_______________________________________________
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


  • Follow-Ups:
    • Re: A rant and a question...
      • From: Brad Bumgarner <email@hidden>
References: 
 >A rant and a question... (From: Brad Bumgarner <email@hidden>)
 >Re: A rant and a question... (From: "I. Savant" <email@hidden>)
 >Re: A rant and a question... (From: Brad Bumgarner <email@hidden>)

  • Prev by Date: Re: problem releasing QCRenderer
  • Next by Date: Re: Edit NSTokenField's token?
  • Previous by thread: Re: A rant and a question...
  • Next by thread: Re: A rant and a question...
  • Index(es):
    • Date
    • Thread