Detailed Description of Validate SKRZ

This step checks the validity of a vehicle registration number (formerly known as SPZ in Czech Republic). If the registration number is determined to be invalid, the step attempts to identify possible typing errors and, if successful, returns the corrected number. While correcting, the step attempts to switch the following pairs of characters: 'O' <-> '0', 'S' <-> '5', 'Z' <-> '2' and 'I' <-> '1'.

The step does not contain any internal cleaning mechanism (removing invalid characters), and expects cleansed data on input. In this case, cleaning means removing special characters (pause, spaces, etc.) and character conversion to uppercase form.

First, the step tries to verify uncorrected (not repaired) data as a new RZ and then as an old SPZ. If no match is found, first step tries to find any corrections for the format of new RZ and then for the format of an old SPZ. Any RZ which is corrected is given the flag FLAG_FIXED.

The following rules are checked in the RZ:

  1. a minimum of 6, and a maxium of 7, characters
  2. characters are formed by Latin alphabet capitals and Arabic digits
  3. a matching with some of the possible forms of Slovak RZ or SPZ

If a match is found with some of the RZ or SPZ forms, then the step validates the production year acquired from the prodYear property with the specified format. If the number is in old format of vehicle number and the production year is after 1997, the step will set the BAD_DATE flag. This comparison does not have an influence on the validity of RZ, it only serves as supplemental information. If no production year information exists, the step will set the DATE_MISSING flag. If the property of production year is not used (not connected), the 'missing' flag will not be set and validation of the production year will not be performed.

If the vehicle registration number is recognized as valid, the original form (eventually the corrected form) is recorded to the output rzOut. For recording an invalid RZ to the output, it is necessary to specify the omitInvalidRZ parameter and set its value to false.


Top of page

Example: Example
<step id='alg' className='cz.adastra.cif.tasks.clean.ValidateSKRZAlgorithm'>
        <properties>
                <rz>rz</rz>
                <outRz>rz_out</outRz>
                <prodYear>year</prodYear>
                <districtLookupFileName>sk-districts.cif</districtLookupFileName>
                <omitInvalidRZ>true</omitInvalidRZ>
                <scorer explanationColumn='expl'>
                        <scoringEntries>
                                <scoringEntry key='RZ_NULL' score='1' explain='true' />
                                <scoringEntry key='RZ_UNKNOWN' score='2' explain='true' />
                                <scoringEntry key='RZ_BAD_FORMAT' score='4' explain='true' />
                                <scoringEntry key='RZ_SUSP' score='4' explain='true' />
                                <scoringEntry key='RZ_FIXED' score='8' explain='true' />
                                <scoringEntry key='RZ_BAD_YEAR' score='32' explain='true' />
                                <scoringEntry key='RZ_YEAR_MISSING' score='100' explain='true' />
                                <!-- compatibility flags - not used -->
                                <scoringEntry key='RZ_BAD_TYPE' score='100' explain='true' />
                                <scoringEntry key='RZ_TYPE_MISSING' score='100' explain='true' />
                        </scoringEntries>
                </scorer>
        </properties>
</step>

iWay Software