code: def add_dictionary(self, dictionary):
          
  
          if self.word_vectors is None:
              raise Exception('Model must be fit before adding a dictionary')
  
          if len(dictionary) > self.word_vectors.shape[0]:
              raise Exception('Dictionary length must be smaller '
                              'or equal to the number of word vectors')
  
          self.dictionary = dictionary
          if hasattr(self.dictionary, 'iteritems'):
              # Python 2 compat
              items_iterator = self.dictionary.iteritems()
          else:
              items_iterator = self.dictionary.items()
  
          self.inverse_dictionary = {v: k for k, v in items_iterator}
docs: Supply a word-id dictionary to allow similarity queries.