The Full Name framework has the logic to recognize parts of the input related to the First and Last names, as well as treating the particles (which are imported from the chained Last Name algorithm instance). Last Name also has a logic of limiting the number of masked First names (removing the rest), as well as smart trimming of the result (masked) output to the required length.
After distinguishing parts of the input string: Full Name algorithm feeds the single words from the first name part (which also includes middle names, treated same as first names) to the instance of the First Name algorithm and the whole last name part to the instance of the Last Name algorithm. Then it combines the masking results, according the embedded logic and the configuration.
If input string contains only single word: This word is considered as a first name or last name (depending on the Consider Single Word Input as Last Name flag) and forwarded for masking to corresponding chained algorithm instance. Single word input is always masked, even if contains configured particle.
Main features of the Full Name Framework:
Deterministic output: The masked result for each input is consistent when using the same algorithm key, same configuration and same chained algorithm instances.
Not unique: The masked result might be the same for different inputs.
Garbage in, garbage out: The algorithm returns the unmasked input / null / empty string if input is one of the following: null, empty string “”, white spaces only “ ”, single not alphanumeric symbol (for example “!”).
Single word input: Considered either as a Last Name (default) or as a First Name (even if configured in one of the particles files).
When particle is configured in both particles files: The remove action takes precedence.
Multiple first names: Masks only first N names (1-4, as configured, default = 2), the rest are ignored.
Full Name Convention: If configured last name separator is detected or configured convention is “last-first-middle” than detects an input as last-first-middle, otherwise first-middle-last (default). Heading/Trailing white spaces are not preserved.
Smart trim: If trimming of the masked value is required it's done in a way to keep the realistically looking full name as long as possible. For instance: first we trim the heading/trailing preserved particles. If not enough - abbreviating the masked first/middle names (one by one, starting the last one). If still no enough - removing the particles prior to the last name, etc.
Below is an example of smart trim. Let's suppose the masked result (prior to checking of the maxLength) is: “President George Herbert Walker Van Bush Jr.”
The requirement for chained instances for First Name and Last Name masking is an existing extensible algorithm instance, masking the String type. Although it can be any String type extensible algorithm instance, it is recommended using the instances based on the Name framework.