dlpx-core: LastName
Based > Extensible Algorithm Framework
The Last Name algorithm is an instance of the Name Algorithm Framework. The algorithm requires String type input values.
The expected format for the valid input contains at least one word, which consists of at least one non-whitespace character. If the input value does not match the expected format, the value will not be masked. I.e. if input contains null or empty string or white spaces only then the algorithm returns the unmasked input value.
No non-conformant data errors are thrown by this algorithm.
Single-word input is not checked for configured particles. Single character is considered an abbreviation, i.e. it will be masked to a single character, whether it is followed by a dot (.) or not. Words separated by a hyphen (-) are considered as a single word (even if divided from the hyphen by spaces).
This algorithm uses the Name framework and is configured to mask only based on the first word. Certain punctuation marks, such as periods (.), are removed and do not affect the masked value; this behavior is not related to the removal or preservation of particles.
The default Last Name instance is configured with a particleToRemove file. After configured particles are removed from the input, a single word is masked and returned; additional words are dropped. Leading and trailing white spaces are not preserved.
For example:
Input | Masked Output |
---|---|
null | null |
"" (empty string) | "" |
" " (white spaces only) | " " |
? (single non alphanumeric character) | K |
?> | Michael |
M | S |
M. | S. |
Ann- Marie | Boris |
von (particle) | wilke |
Frout | Smith |
von Frout | Smith |
von Frout Weissman | Smith |