Alright, I have this code here:
def andSearch(inverseIndex, query):
pepp = set()
for y in [inverseIndex[x] for x in query]:
if pepp == set():
pepp.update(y)
else:
pepp & y
return pepp
I am trying to Input a dictionary like for example this:
L = {'Cats':{1},'Dogs':{2},'Cat':{0,4},'Dog':{0,4},'Pigs':{3},'Animal':{4}}
And as output I want to have a set that shows dictionary values if the values connect and contain ALL of the input Queries, like this:
query = [ 'Dog', 'Cat','Animal'] ----> {4}
query = [ 'Dog', 'Cat'] ---> {0,4}
query = ['Dog', 'Dogs'] ---- {} (or set())
query = [] -----> {}
But the problem is when I try to run the module then I get this strange output:
>>> andSearch(L,Query)
Ellipsis
What could cause that? It is the same no matter what the input is, and it does not give me a error or nothing, can anyone of you smart guys and girls help me out?