Exemplo n.º 1
0
def hash_pa_agents(agent_tuples):
    logger.info("Adding hashes to %d pa agent refs." % len(agent_tuples))
    hashed_tuples = []
    for ref in agent_tuples:
        h = make_hash(':'.join([str(r) for r in ref[:-1]]), 16)
        hashed_tuples.append(ref + (h, ))
    return hashed_tuples
Exemplo n.º 2
0
 def _get_text_hash(self):
     ev = self.result.evidence[0]
     simple_text = self.__text_patt.sub('', ev.text)
     if 'coords' in ev.annotations.keys():
         simple_text += str(ev.annotations['coords'])
     return make_hash(simple_text.lower(), 16)
Exemplo n.º 3
0
def hash_pa_agents(agent_tuples):
    hashed_tuples = []
    for ref in agent_tuples:
        h = make_hash(':'.join([str(r) for r in ref[:-1]]), 16)
        hashed_tuples.append(ref + (h, ))
    return hashed_tuples