I have two sets:
a = set(['this', 'is', 'an', 'apple!'])
b = set(['apple', 'orange'])
I want to find if there are any (b) in (a) including substrings. normally I would do:
c = a.intersection(b)
However, in this example it would return an empty set as 'apple' != 'apple!'
Assuming I cannot remove characters from (a) and hopefully without creating loops, is there a way for me to find a match?
Edit: I would like for it to return a match from (b) e.g. I would like to know if 'apple' is in set (a), I do not want it to return 'apple!'