3 ms·
This times a million. Phone numbers in particular can be a horrid mess to deal with. Some decent libraries have come out to normalize them, but in general it r
by danielrhodes 13y ago
This times a million.
Phone numbers in particular can be a horrid mess to deal with. Some decent libraries have come out to normalize them, but in general it remains difficult.
For example:
013811234
+88-1-3811234
3811234
0118813811234
008813811234
are all be the same number.
To hash them, you could naively just strip off the area codes and country codes, but that is only if you can know ahead of time they are indeed area or country codes. Some countries have 7 digit numbers, others have 9, some have 6, or even 5 digits. Sometimes you don't even know the country to apply these rules to.
- svasan 13y agoJust a thought - Why not reverse the phone number string and if there is a match in the first N digits of all the above phone numbers, then classify these as the same phone number? N would vary from country to country, no doubt. The intermediate characters like {,, +, -, .,} could also be stripped out from the phone number string to make the original problem less complex.