Looking for multiple expressions within strings

Hi,

I’m trying to process sentences on the right, into the output strings, as seen in the attached image.
If a string doesn’t contain a word to look for, the original string is placed as an output.
The search also needs to be insensitive to case.

Note: There are many words to look for so each shouldn’t be it’s own node.

I thought perhaps a Rule Engine, or Rule Engine (Dictionary) but have not had any luck with either.

Thanks for any help.

example

Hi @hhaw , there are a few ways to do this. Here’s one way I did it. I added an additional sentence “Treehouse” to show that my workflow would not match it with Tree.

Here are the results:
image

I used SQL to do the match as I understand that you may have quite a list of words, and a JOIN probably works best, and since we’re not joining on exact whole match, but rather matching on particular word/phrase, I used a DB Join. In this case, I used a virtual H2 (it loads into memory, you don’t need to set up any H2 DB).

The workflow looks like this:
image

Here’s the workflow:
Looking for multiple expressions within strings.knwf (26.2 KB)

4 Likes

Wow, this is a great solution, thanks!

No problem @hhaw , happy to help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.