Pardon the ambiguity in the title- I wasn't quite sure how to phrase my question.
Given a string:
blah = "There are three cats in the hat"
and the (I'm not quite sure which data structure to use for this) "userInfo":
cats -> ("tim", "1 infinite loop")
three -> ("sally", "123 fake st")
three -> ("tim", "1 infinite loop")
three cats -> ("john", "123 fake st")
four cats -> ("albert", "345 real road")
dogs -> ("tim", "1 infinite loop")
cats hat -> ("janet", NULL)
The proper output should be:
tim (since 'cats' exists)
sally (since 'three' exists)
tim (since 'three' exists)
john (since both 'three' and 'cats' exist)
janet (since both 'cats' and 'hat' exist somewhere in the string blah)
I want an efficient way of storing this data. There is a possibility for multiple 'three' strings that can be matched (i.e., 150 people will have that string.) Should I just have a list with all this data and duplicate the "keys"?