I'm looking to add a filter to a function where the app requests the user to input text. This filter bans specific words or combinations of words, and I figured the easiest way to do it was through a .csv.
The image is the block I have attempting to filter the words, and as you can imagine, it's not working.
The .csv is set up like it should be, being like this:
word1,
word2,
word3,
Any help is appreciated!
--
I think you should use "In the list? thing USEROUTPUT List BLACKLIST"
The block is in the list blocks.
--
If your blacklist is constant, you should avoid constantly unpacking that csv
by doing it just once in the initialization of another global, blacklist.
containment test, where you would test for the current word being in
the user text.
@Vipul, your solution works only if the user input was only one word.
If a complete sentence were input, it would need to be broken down
to individual words, and the individual words feed to the is in list blacklist
block one at a time.
--
댓글 없음:
댓글 쓰기