String Cleanser
Reltio provides options to configure the string cleanser.
Cleanser Name - StringFunctionCleanser
Description - This cleanser alters the given text based on the specified options. It also adds an attribute with the ReltioCleanser
crosswalk, based on the output mapping. Following are the specific cleanse functions under this category:
- String value casing - Upper, lower, and title
- String value trimming - leading/trailing spaces
- String value padding - padding of characters set to the input attribute value
- String value scrubbing - removal of any characterBy themselves, the following characters cannot be used for scrubbing:
-
Open square bracket - [
-
Closed square bracket - ]
Escape - \
-
Double quotation - "
You can, however, use them along with the escape character, as shown below:
-
\\[
\\]
\\\\
- \"Note: The caret (^) symbol must be escaped only if it is used as the first character in a pattern. For example: \^.
-
Cleanse Attribute Name | Mandatory | Description |
---|---|---|
InputText | No | |
CleanseAttribute1 | No | |
CleanseAttribute2 | No |
OutputText
attribute.Cleanse Attribute Name | Mandatory | Description |
---|---|---|
InputText | No | |
CleanseAttribute1 | No | |
CleanseAttribute2 | No |
Key | Allowed Values | Description |
---|---|---|
casing | Upper/Lower/Title | Optional. If no value is mentioned it does nothing. Default: Nothing. |
trim | Boolean (true/false) | Default: false. |
padding.position | left/right/center | Default: left. |
padding.length | Number | Default: 0. |
padding.padChar | Any character | Default: Space( ). |
scrub | Supported escape sequences:
| Example: !@#$%\b. |
Options | Cleanse Input | Cleanse Output |
---|---|---|
{"casing" : "Upper"} |
|
|
{"scrub" : "!@#$"} |
|
|
L3 Configuration - Map the StringFunctionCleanser
for any entity in your L3 configuration. The configuration looks as shown below:
{
"uri": "configuration/entityTypes/HCP1",
"cleanseConfig": {
"infos": [
{
"uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser",
"useInCleansing": true,
"sequence": [
{
"chain": [
{
"cleanseFunction": "StringFunctionCleanser",
"resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
"proceedOnSuccess": true,
"proceedOnFailure": true,
"mapping": {
"inputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Name",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "InputText"
}
],
"outputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Name",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "OutputText"
}
]
},
"params": {
"trim": true
}
}
]
}
]
},
{
"uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser2",
"useInCleansing": true,
"sequence": [
{
"chain": [
{
"cleanseFunction": "StringFunctionCleanser",
"resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
"proceedOnSuccess": true,
"proceedOnFailure": true,
"mapping": {
"inputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Country",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "InputText"
}
],
"outputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Country",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "OutputText"
}
]
},
"params": {
"casing": "Upper"
}
}
]
}
]
},
{
"uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser3",
"useInCleansing": true,
"sequence": [
{
"chain": [
{
"cleanseFunction": "StringFunctionCleanser",
"resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
"proceedOnSuccess": true,
"proceedOnFailure": true,
"mapping": {
"inputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Description",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "InputText"
}
],
"outputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Description",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "OutputText"
}
]
},
"params": {
"scrub": "!@#$&*()<>/^"
}
}
]
}
]
},
{
"uri": "configuration/entityTypes/HCP1/cleanse/infos/StringFunctionCleanser4",
"useInCleansing": true,
"sequence": [
{
"chain": [
{
"cleanseFunction": "StringFunctionCleanser",
"resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
"proceedOnSuccess": true,
"proceedOnFailure": true,
"mapping": {
"inputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Salary",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "InputText"
}
],
"outputMapping": [
{
"attribute": "configuration/entityTypes/HCP1/attributes/Salary",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "OutputText"
}
]
},
"params": {
"padding": {
"position": "left",
"length": 20,
"padChar": "*"
}
}
}
]
}
]
}
]
},
"attributes": [
{
"uri": "configuration/entityTypes/HCP1/attributes/Name",
"label": "Name",
"name": "Name",
"description": "",
"type": "String",
"hidden": false,
"important": false
},
{
"uri": "configuration/entityTypes/HCP1/attributes/Country",
"label": "Country",
"name": "Country",
"description": "",
"type": "String",
"hidden": false,
"important": false
},
{
"uri": "configuration/entityTypes/HCP1/attributes/Description",
"label": "Description",
"name": "Description",
"description": "",
"type": "String",
"hidden": false,
"important": false
},
{
"uri": "configuration/entityTypes/HCP1/attributes/Salary",
"label": "Salary",
"name": "Salary",
"description": "",
"type": "String",
"hidden": false,
"important": false
}
]
}
Example
Options | Input Text | Output Text |
---|---|---|
| Text Cleanser Example | TEXT CLEANSER EXAMPLE |
| text cleanser example | Text Cleanser Example |
| "Pad Me" | "*********Pad Me" |
| "Pad Me" | "Pad Me*********" |
| "Pad Me" | "****Pad Me*****" |
| "Scrub !this #text: /Four #4 score$ and* @seven #7 years ago!." | Scrub this text: Four 4 score and seven 7 years ago. |