I’m trying to select the most frequently occurring key words on a table.
I need to search for the number of occurrences of a word in a list that DOES NOT include a given second, third, fourth, etc. word.
For example, I need to search for the number of times the word “lollypop” appears in a list that does not include the word “candy”.
This code will return the number of times the word “lollypop” appears:
rt = Parallelize@
Cases[MemoizeTable["Candy_table.txt"],
x_List /;
MemberQ[x,
s_String /;
StringMatchQ[s, ("*lollypop*"), IgnoreCase -> True]], {1}];
I tried adding StringFreeQ to exclude “candy”, and I tried adding Nor where one would add Or in the string search, but I wasn’t sure how to do that/where to put it/them..?
I need a "this" BUT NOT "that" code, basically.
Usage: