Detailed Description of Validate Phone Number

This step verifies the validity of a phone number. The phone number format is specified using parsing rules. For more accurate verification, a dictionary of international area codes is used. (IDC - International Destination Code - the dictionary specified in idcLookupFileName) Also, a dictionary of local providers (e.g., Czech Republic) can be used when specified using provLookupFileName).

This step uses a parser to examine the input string. For more details about it please see the description of Generic Parser.

This step is capable of processing more phone extension numbers so that these are grouped together and separated by the given character (the extSeparator parameter).

Besides standard components there are the following predefined ones available. These components are verified against corresponding dictionaries.

In order to recognize components correctly, the number parts must be divided by a separator. For example to recognize a number with the pattern {AREACODE}{PHONE8} (where {AREACODE} is a component consisting of 1 or 2 digits and {PHONE8} is a component consisting of 8 digits) the two parts of the number must be divided by separator, for example, in the telephone number '12 12345678' where space is the separator.


Top of page

Example: Validate Phone Number Example
<step id='alg' className='cz.adastra.cif.tasks.clean.ValidatePhoneNumberAlgorithm'>
        <binding name='in' column='src_phone_number' />
        <binding name='outPhoneNumber' column='std_phone_number' />
        <binding name='outPhoneNumberOrig' column='pur_orig_phone_number' />
        <binding name='outRuleName' column='rule_name' />
        <binding name='outExt' column='std_ext_line' />
        <binding name='outExtOrig' column='pur_orig_ext_line' />
        <binding name='outProv' column='std_prov' />
        <binding name='outProvOrig' column='pur_orig_prov' />
        <binding name='outIdc' column='std_idc' />
        <binding name='outIdcOrig' column='pur_orig_idc' />
        <properties>
                <patternGroups>
                        <patternGroup>
                                <patterns>
                                        <pattern definition='+{IDC!} {PHONE} ext. {EXT}' name='idc! phone ext. ext3' />
                                        <pattern definition='{PHONE}' name='phone' />
                                        <pattern definition='{PHONE} ext. {EXT}' name='phone ext. ext3' />
                                        <pattern definition='{PROV!} {PHONE}' name='prov! phone' />
                                        <pattern definition='{EXT} {EXT}' name='ext ext' />
                                        <pattern definition='+{IDC} {PHONE}' name='+idc phone' />
                                        <pattern definition='{IDC} {PHONE}' name='idc phone' />
                                </patterns>
                        </patternGroup>
                </patternGroups>
                <scorer explanationColumn="expl">
                        <scoringEntries>
                                <scoringEntry key="PN_NULL" score="1000" explain="true" />
                                <scoringEntry key="PN_MORE_PATTERNS" score="1000" explain="true" />
                                <scoringEntry key="PN_PROV" score="1000" explain="true" />
                                <scoringEntry key="PN_IDC" score="1000" explain="true" />
                                <scoringEntry key="PN_NO_PATTERN" score="100" explain="true" />
                                <scoringEntry key="PN_PART_PATTERN" score="100" explain="true" />
                        </scoringEntries>
                </scorer>
                <numberSeparator>-</numberSeparator>
                <numberPartLength>2</numberPartLength>
                <idcLookupFileName>data/dictionaries/idc_lookup.dict.cif</idcLookupFileName>
                <provLookupFileName>data/dictionaries/prov_lookup.dict.cif</provLookupFileName>
        </properties>
</step>

iWay Software