I have a dictionary similar to this:
countries = ["usa", "france", "japan", "china", "germany"]
fruits = ["mango", "apple", "passion-fruit", "durion", "bananna"]
cf_dict = {k:v for k,v in zip(["countries", "fruits"], [countries, fruits])}
and I also have a list of strings similar to this:
docs = ["mango is a fruit that is very different from Apple","I like to travel, last year I was in Germany but I like France.it was lovely"]
I would like to inspect the docs
and see if each string contains any
of the keywords in any of the lists(the values of cf_dict are lists) in cf_dict, and if they are present then return the corresponding key
(based on values) for that string(strings in docs) as output.
so for instance, if I inspect the list docs
the output will be [fruits
, countries
]
something similar to this answer but this checks only one list, however, I would like to check multiple lists.