Jaminy / Email-Mining

BSD 2-Clause "Simplified" License
1 stars 4 forks source link

Telify plugin source code #12

Closed Jaminy closed 8 years ago

Jaminy commented 8 years ago

For scanning telephone number in the message, should it scan for numbers in the message or the message starts with tel. ?

irl commented 8 years ago

Scan the body of the message for things that look like phone numbers. Phone numbers are unlikely to be in the headers, I'm not aware of any standards for adding phone numbers there.

Jaminy commented 8 years ago

What if there are numbers which are not phone numbers?Wouldn't be added as phone number?

irl commented 8 years ago

Some phone numbers will be easy to recognise because they'll be a + followed by more than 7 or so numbers. Some will be harder, but it's a good bet that with less than 7 numbers it's probably not a phone number.

You can validate further by using the phonenumbers library. Start by doing .parse() and then you can use the phonenumbers.is_valid_number() function to check if it's a valid number.