From f4748834d973a525024cac18fb58fe9934957170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Sat, 1 Jul 2017 13:17:26 +0200 Subject: [PATCH] Use spacy hash_string function instead of md5 --- spacy/pattern/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/pattern/parser.py b/spacy/pattern/parser.py index 4b6fbc8dd..122d2b8f3 100644 --- a/spacy/pattern/parser.py +++ b/spacy/pattern/parser.py @@ -1,9 +1,9 @@ # coding: utf-8 from spacy.compat import intern, queue +from spacy.strings import hash_string from operator import itemgetter import re -from hashlib import md5 import json from .pattern import DependencyPattern @@ -294,8 +294,8 @@ class Token(tuple): return tuple.__new__(cls, (lineno, intern(str(type)), value)) def hash(self): - string = str(self.value) - return md5(string.encode('utf-8')).hexdigest() + string = self.value + return hash_string(string) def __repr__(self): return 'Token(%r, %r, %r)' % (