Skip to main content

The Wowool Phones Package

Project description

Normalizing phone numbers

The phones app enriches phone number annotations by:

  • Normalizing local phone numbers by resolving land lines depending on city or countries it has encountered in the document
  • Collecting all phone numbers present in the document

The application performs a resolution lookup each time a PhoneNr entity is found. You can find this in the contact-info domain or you can make your own custom domain with this entity.

Options

PhonesOptions

interface PhonesOptions {
    countries?: string[];
    distance?: string[];
}

with:

Property Description
countries Country names to try to resolve a local phone number
distance Maximum distance between a location and the phone number to be resolved

Results

PhonesResults

type PhonesResults = PhoneResult[];

PhoneResult

interface PhoneResult {
    phone_nr: string;
    country_code: string;
    country: string;
    location?: string;
}

with:

Property Description
phone_nr Normalized phone number
country_code Country phone code of the phone number, e.g. +32
country Country code of the phone number, e.g. 'Belgium'
location Precise location, if available

Examples

Normalizing phone numbers

The phones app enriches phone number annotations by:

  • Normalizing local phone numbers by resolving land lines depending on city or countries it has encountered in the document
  • Collecting all phone numbers present in the document

The application performs a resolution lookup each time a PhoneNr entity is found. You can find this in the contact-info domain or you can make your own custom domain with this entity.

Options

PhonesOptions

interface PhonesOptions {
    countries?: string[];
    distance?: string[];
}

with:

Property Description
countries Country names to try to resolve a local phone number
distance Maximum distance between a location and the phone number to be resolved

Results

PhonesResults

type PhonesResults = PhoneResult[];

PhoneResult

interface PhoneResult {
    phone_nr: string;
    country_code: string;
    country: string;
    location?: string;
}

with:

Property Description
phone_nr Normalized phone number
country_code Country phone code of the phone number, e.g. +32
country Country code of the phone number, e.g. 'Belgium'
location Precise location, if available

API

Examples

You will need to install the english language module to run the sample. pip install wowool-english

Extracting and normalizing phone numbers

The script extracts and normalizes a Belgian phone number from the text, identifies its country and location, and prints this structured information.

from wowool.sdk import Pipeline
from wowool.phones.app_id import APP_ID

text = "I live in Antwerp and my phone number is 03/230 30 46."
pipeline = Pipeline(
    [
        "english",
        "contact-info",
        "phones.app",
    ]
)
document = pipeline(text)
print(document.results(APP_ID))

results:

[
    {
        "phone_nr": "+3232303046",
        "country_code": 32,
        "country": "Belgium",
        "location": "Antwerp"
    }
]

License

In both cases you will need to acquirer a license file at https://www.wowool.com

Non-Commercial

This library is licensed under the GNU AGPLv3 for non-commercial use.  
For commercial use, a separate license must be purchased.  

Commercial license Terms

1. Grants the right to use this library in proprietary software.  
2. Requires a valid license key  
3. Redistribution in SaaS requires a commercial license.  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wowool_phones-2.1.2.dev1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file wowool_phones-2.1.2.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for wowool_phones-2.1.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 9319b08215274432a5293626e0f0ba2e0c1079ab5c43b0356c52170c5c8e1a99
MD5 50217a0204220c4980f9dfa5d6e92ebc
BLAKE2b-256 c6a545f85f5f643f9765f3fe308c6041b5bedd577d4a33de7cd29d4b8ff12543

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page