Professional Documents
Culture Documents
if p1==p2:
andlist.append(p1)
list1.pop(0)
list2.pop(0)
elif p1<p2:
list1.pop(0)
else:
list2.pop(0)
return andlist
if p1==p2:
orlist.append(p1)
list1.pop(0)
list2.pop(0)
elif p1<p2:
orlist.append(p1)
list1.pop(0)
else:
orlist.append(p2)
list2.pop(0)
if len(list1)!=0:
orlist.extend(list1)
else:
orlist.extend(list2)
return orlist
for w in query:
if w!='and' and w!='or' and w!='not':
term.append(w)
else:
logic.append(w)
print("Hasil Pencarian:")
if len(q)==0:
print("Dokumen tidak ada!")
else:
for loc in q:
print("- "+self.doctitle.get(loc))