Reltio Connect

 View Only
Expand all | Collapse all

Getting Character of Word using String Replacement Cleanser

  • 1.  Getting Character of Word using String Replacement Cleanser

    Posted 07-30-2024 09:57

    Hello all!

    Trying to use the String Replacement Cleanser to get the first letter of a word, so it can be used in a match. 

    How would I set up the .txt for the cleanser to allow for this. 

    I am assuming it would be: 

    \b\b=>^\b(\w)

    Just wanted to confirm before using it. 



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------


  • 2.  RE: Getting Character of Word using String Replacement Cleanser

    Reltio Employee
    Posted 07-31-2024 10:26

    Hi Ujwal,

    You could also try the Initial Cleanser that does the similar one

    https://docs.reltio.com/en/model/cleanse-data/cleanse-and-standardize-data-overview/out-of-the-box-cleanse-functions/initials-cleanser



    ------------------------------
    Vignesh Chandran
    Advisory Services Manager
    Reltio
    ------------------------------



  • 3.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 07-31-2024 16:48

    Hello! 

    I think we want to have it done via match rule and not L3 configuration change. 



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------



  • 4.  RE: Getting Character of Word using String Replacement Cleanser

    Reltio Employee
    Posted 07-31-2024 11:35

    Hi Ujwal,

    Here is our documentation explaining the S3 file cleanser https://docs.reltio.com/en/model/cleanse-data/cleanse-and-standardize-data-overview/out-of-the-box-cleanse-functions/s3-file-cleanser

    Let me know if this is not what you are looking for. We can discuss it further

    Thanks,



    ------------------------------
    Saurabh Agarwal
    ------------------------------



  • 5.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 07-31-2024 16:50

    Thanks for the link!

    Do you know if using: 

    \b\b=>^\b(\w)

    Would work for our purposes.

     Just want to check before making a ticket to add it to the S3.



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------



  • 6.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 08-05-2024 12:44

    Any idea on this? 

    Thanks!!



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------



  • 7.  RE: Getting Character of Word using String Replacement Cleanser

    Reltio Employee
    Posted 08-06-2024 01:17

    Hi Ujwal,

    If your requirement is only to get the first alphabet of a word then you should use the Initials Cleanser. Vignesh has shared documentation link explaining the initials cleanser.

    I am not sure I understand what you meant by doing it via match rule and not L3 change. Please can you explain why you cannot use the Initials cleanser to get the first char?

    Thanks, 



    ------------------------------
    Saurabh Agarwal
    ------------------------------



  • 8.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 08-06-2024 08:53

    Hello!

    We would prefer keeping this via match rule then doing a L3 change. We are just testing and would prefer not to make a larger change like that. 

    We saw there was another post similar to this and they were able to use the cleanser: 

    How to match initials | Reltio Connect

    I just wanted to confirm what the Regex logic would be when using it via the .txt 

    Thanks!!



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------



  • 9.  RE: Getting Character of Word using String Replacement Cleanser

    Reltio Employee
    Posted 08-14-2024 11:18

    If you only need the first letter of the value (and not the first letter of every word), you might want to try using regex with a CustomComparator and/or CustomMatchToken class.

    The below regex worked for me.

    ^.{0,1}


    ------------------------------
    Bryant Barrenechea
    Solution Architect | Professional Services
    ------------------------------



  • 10.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 08-14-2024 12:39

    Oh great! 

    That should work for our purposes. 

    How did you set it up when creating the match rule itself? 

    Trying it on our side and it isn't working for some reason. 



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------



  • 11.  RE: Getting Character of Word using String Replacement Cleanser
    Best Answer

    Reltio Employee
    Posted 08-14-2024 13:27

    Try this cURL

    curl --location 'https://{{env}}.reltio.com/reltio/api/{{tenantID}}/entities/_verifyMatches?documentsFromDatabase=false&rules=configuration%2FentityTypes%2FIndividual%2FmatchGroups%2FFirstLetterTest&hashedTokens=false' \
    --header 'Authorization: Bearer XXXXXXXXXXXXXX' \
    --header 'Content-Type: application/json' \
    --data '{
        "first": {
            "type": "configuration/entityTypes/Individual",
            "attributes": {
                "MiddleName": [
                    {
                        "value": "Apples"
                    }
                ]
            }
        },
        "second": {
            "type": "configuration/entityTypes/Individual",
            "attributes": {
                "MiddleName": [
                    {
                        "value": "Aaron"
                    }
                ]
            }
        },
        "matchGroups": [
            {
                "uri": "configuration/entityTypes/Individual/matchGroups/FirstLetterTest",
                "label": "First Letter Test",
                "type": "suspect",
                "useOvOnly": "true",
                "rule": {
                    "matchTokenClasses": {
                        "mapping": [
                            {
                                "attribute": "configuration/entityTypes/Individual/attributes/MiddleName",
                                "parameters": [
                                    {
                                        "parameter": "groups",
                                        "values": [
                                            {
                                                "className": "com.reltio.match.token.ExactMatchToken",
                                                "pattern": "^.{0,1}"
                                            }
                                        ]
                                    }
                                ],
                                "class": "com.reltio.match.token.CustomMatchToken"
                            }
                        ]
                    },
                    "comparatorClasses": {
                        "mapping": [
                            {
                                "attribute": "configuration/entityTypes/Individual/attributes/MiddleName",
                                "parameters": [
                                    {
                                        "parameter": "groups",
                                        "values": [
                                            {
                                                "pattern": "^.{0,1}",
                                                "className": "com.reltio.match.comparator.ExactMatchToken"
                                            }
                                        ]
                                    }
                                ],
                                "class": "com.reltio.match.comparator.CustomComparator"
                            }
                        ]
                    },
                    "and": {
                        "exact": [
                            "configuration/entityTypes/Individual/attributes/MiddleName"
                        ]
                    }
                },
                "matchServiceClass": "com.reltio.businesslogic.match.providers.internal.InternalMatchService",
                "scoreStandalone": 0,
                "scoreIncremental": 0
            }
        ]
    }'



    ------------------------------
    Bryant Barrenechea
    Solution Architect | Professional Services
    ------------------------------



  • 12.  RE: Getting Character of Word using String Replacement Cleanser

    Posted 08-20-2024 12:56

    That worked as intended. Thanks!



    ------------------------------
    ujwal upadhyay
    fultonbank
    ------------------------------