Skip to content


Based on 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 consist of any symbol(s), but the single non-alphanumeric character. Any single non-alphanumeric character would be ignored, replaced with empty string "". If the input value does not match the expected format, the value will not be masked.
For example
- single punctuation mark is considered as non-conformant data and is not masked (empty string is returned instead).
- if input contains null or empty string or white spaces only then the algorithm returns unmasked input value.

Word containing any multiple characters (even non-alphanumeric) is considered as a valid input and is masked.
No non-conformant data errors are thrown by that algorithm.

Input containing multiple words is masked to a single word (after configured particles are removed from the input). Single word input is not checked for configured particles. Single character (if alphanumeric only) is considered abbreviation. Whether it is followed by the dot (.) ot not.
Words separated by hyphen (-) are considered as a single word (even if divided from hyphen by spaces).

The default Last Name instance is configurable with particleToRemove file. The whole input would be masked to a single output word. Leading and trailing white spaces are not preserved.

For exmaple:

Input Masked Output
null null
"" (empty string) ""
"     " (white spaces only) "     "
single non alphanumeric character (like '&' or '?') null
M. S.
?> Michael
Ann- Marie Boris
von (particle) Wilke
Lister Weissman Vonk
Frout Smith
von Frout Smith

Particles treatment:

Input Masked Output configuration
dela Cruz dela Lordello particle "dela" is configured to be preserved
dela Cruz Lordello particle "dela" is configured to be removed
dela Cruz Lordello particle "dela" is configured in both - toPreserve and toRemove lists
dela Cruz Santos particle "dela" isn't listed in any particles list