Fuzzy phone number matching

Chris Lord chris at openedhand.com
Wed Jul 16 18:43:31 CEST 2008


On Wed, 2008-07-16 at 18:04 +0200, Joachim Breitner wrote:
> Hi,
> 
> Am Dienstag, den 15.07.2008, 23:20 +0200 schrieb Jay Vaughan:
> > > What would be a good way to tackle this issue? Anything else but tell
> > > our users always to write +49172..., even when dialing by hand?
> >
> > Match the phone numbers backwards from right to left instead of left  
> > to right, and throw away 'whitespace' which would be defined as  
> > 'anything that isn't a number'.
> 
> thx, it’s simlar to what I’m doing already in my openmoko-messages2
> patches. My question was rather: Is this the right way to fix it? There
> are a lot of places where the comparison of phone numbers happens, down
> into evolution-data-server, so I’m wondering if there is consensus that
> this is the right way.

Unfortuantely, this is one of the things I didn't get round to doing
while working on openmoko-messages2/phonekit/etc. It'd be good if there
was a small static library for handling phone-number normalisation, so
this code isn't reimplemented in different ways all over the place.

With regards to how this should be done with eds-dbus, there are a
number of ways to go about it... A feasible way would be to store the
normalised number primarily and the entered number as secondary/custom
field. When searching, search for the normalised number, then in the
case of multiple results, use some kind of heuristic to retrieve the
desired contact (or if you're lazy, just pick the first, the likelihood
of multiple matches is pretty low :))

All this code would go in the aforementioned static library, to be used
by any application that's attempting to handle storage/searching of
phone numbers.

--Chris






More information about the devel mailing list