Another approach you could try is to use the PARSE STRING tool to split the string up into a list of words using spaces as delimiters. You can then use the FIND List tool to search the list of words. You would also need to account for removing punctuation from the sub-strings. Depending on the length of the resulting list, as well as the number of words you are looking for, it may also be worth removing duplicates..
This is where at all starts to get complicated. What are you going to do if someone replaces odd characters with special characters, or simply mis-spells the word(s) in question?
A third (possible) solution is if you can find any form of online "text sanitation" service with a REST API. I don't know if such services exist (I'd be surprised if they didn't) you could perhaps run the text of each message through this? Depending on volume, it may cause performance issues, but might be worth investigating.
FWIW, I think you are going to find yourself going down a rather deep rabbit hole trying to make this effective without compromising desired functionality (The Scunthorpe Problem, mentioned by Aaron, is the tip of a rather large iceberg here!) You are also setting yourself up for criticism if your solution gets it wrong - which is why I repeat my advice to record and act upon undesirable language accordingly.
If you do decide to go down this route, however, as Ryan says, it's going to involve Handlers.
------------------------------
Paul Simpson
Senior Technical Instructor
------------------------------
Original Message:
Sent: 12-07-2021 09:40
From: AARON LAEL
Subject: Can swear words be filtered out from web chats between agent and User
If you implement something like this, ensure that you implement it with some solid regex rather than just simple string matching, lest you run afoul of the The Scunthorpe Problem.
------------------------------
Aaron Lael
State of Utah - comments on this forum reflect my own personal opinions\observations and are separate from any entity I am otherwise involved in.
Original Message:
Sent: 12-06-2021 20:26
From: Ella Ramsay
Subject: Can swear words be filtered out from web chats between agent and User
Just wondering, how would you go about looking for particular strings, if you did go down this path?
------------------------------
Ella Ramsay
MYOB
Original Message:
Sent: 08-13-2020 11:19
From: Paul Simpson
Subject: Can swear words be filtered out from web chats between agent and User
Theoretically, you could look for particular strings, but I'm not sure the effort would be worth it. The problem is twofold: Firstly, you need to define what, exactly, constitutes a vulgar/swear word (not as easy to pin down as you might think!); Secondly, you have the high likelihood that the word will be (deliberately) mis-spelled to bypass filters. As a result, you will end up with a LONG filter list, which may then impact performance.
My recommendation would be to record the chats. If an agent is using what you consider to be inappropriate language, then you have a case for user training. If it's from a customer, then you need to figure out how you will handle that.
------------------------------
Paul Simpson
Senior Technical Instructor
Original Message:
Sent: 08-13-2020 09:20
From: Theolan Govender
Subject: Can swear words be filtered out from web chats between agent and User
Hi
I would like to filter/ blank out any vulgar/swear words that are picked up on Interaction Connect web chat, between an agent and User
#Implementation
------------------------------
Theolan Govender
------------------------------