Detailed Description of Intelligent Swap Name Surname

Swaps the first name and the last name in the input ("firstName" and "lastName") string. The swapping only occurs if it is applicable according to the contents of defined dictionaries (i.e., first name string is found only in the last names dictionary and vice versa - for detailed settings see the example). If it is not possible to determined which is the first name and which is the last name, the original order is preserved. Behavior of the step can be changed using the table of actions, which is defined in the element "actions" (see properties of the step).


Top of page

Example: Example
<step id='alg' className='cz.adastra.cif.tasks.clean.IntelligentSwapNameSurnameAlgorithm'>
        // in
        <binding name='firstName' column='src_first_name'/>
        <binding name='lastName'  column='src_last_name'/>
        // out
        <binding name='firstNameOut' column='std_first_name'/>
        <binding name='lastNameOut'  column='std_last_name'/>
        <properties>
                <scorer explanationColumn='expl'>
                        <scoringEntries>
                                <scoringEntry key='SNS_SWAP' score='20' explain='true' />
                                <scoringEntry key='SNS_UNDECIDABLE' score='10' explain='true' />
                        </scoringEntries>
                </scorer>
                <firstNameLookupFileName>first_names_cz.cif</firstNameLookupFileName>
                <lastNameLookupFileName>last_names_cz.cif</lastNameLookupFileName>
                <matchingValueGenerator doRemoveDia='true' doRemoveRepeatedChars='true'
                                        doSqueezeWS='true' doUpperCase='true'
                                        doRemoveSpecialChars='true'/>
                <actions>
                        // An example illustrating a situation where both input values (first name and last name) are found
                        // in both dictionaries. In this situation the step is not able to decide and therefore no
                        // swapping is performed and a scoring flag SNS_UNDECIDABLE is set.
                        <action FIsIn="fl" LIsIn="fl" swap="false" scoringEntry="SNS_UNDECIDABLE"/>
                        // An example illustrating a situation where the value provided in firstName is found exclusively
                        // in the last names dictionary and the value provided in lastName is found in both dictionaries
                        // (conforms to sample data: 'VITTEK' 'VLADIMÍR'). With the following setting, the values are swapped.
                        <action FIsIn="fl" LIsIn="f" swap="true" scoringEntry="SNS_SWAP"/>
                        // An example illustrating a situation where the value provided in firstName is found exclusively
                        // in the first names dictionary and the value provided in lastName is found in both dictionaries
                        // (conforms to sample data: 'VLADIMÍR' 'VITTEK'). With the following setting, no scoring entry is set
                        // and no swapping is performed.
                        <action FIsIn="f" LIsIn="fl" swap="false" scoringEntry=""/>
                </actions>
        </properties>
</step>

iWay Software