Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class ABC(object):
  2.  
  3. def __init__(self, query = None, cands = None):
  4. if query != None and cands != None:
  5. self.query = query
  6. self.cands = cands
  7. self.getIDF()
  8.  
  9.  
  10. def getIDF(self):
  11. self.i_dict = {}
  12. for term in query:
  13. count = 0
  14. for cand in cands:
  15. if term in cand:
  16. count += 1
  17. self.i_dict[term] = count
  18.  
  19. NameError: name 'query' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement