From b21481eeca5c55db1cc996a2d69ac3a1ef0f3fbf Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 21 Feb 2019 09:09:03 +0100 Subject: [PATCH] Load token_match regex with .match, not .search --- spacy/tokenizer.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokenizer.pyx b/spacy/tokenizer.pyx index 7fcff8d30..15a5f7274 100644 --- a/spacy/tokenizer.pyx +++ b/spacy/tokenizer.pyx @@ -407,7 +407,7 @@ cdef class Tokenizer: if data.get('infix_finditer'): self.infix_finditer = re.compile(data['infix_finditer']).finditer if data.get('token_match'): - self.token_match = re.compile(data['token_match']).search + self.token_match = re.compile(data['token_match']).match for string, substrings in data.get('rules', {}).items(): self.add_special_case(string, substrings) return self