def hash_vector(self, v, querying=False):
if scipy.sparse.issparse(v):<EOL><INDENT>if self.components_csr == None:<EOL><INDENT>self.components_csr = scipy.sparse.csr_matrix(self.components)<EOL><DEDENT>if not scipy.sparse.isspmatrix_csr(v):<EOL><INDENT>v = scipy.sparse.csr_matrix(v)<EOL><DEDENT>projection = self.components_csr.dot(v).toarray()<EOL><DEDENT>else:<EOL><INDENT>projection = numpy.dot(self.components, v)<EOL><DEDENT>return ['<STR_LIT>'.join(['<STR_LIT:1>' if x > <NUM_LIT:0.0> else '<STR_LIT:0>' for x in projection])]<EOL>
Hashes the vector and returns the binary bucket key as string.