mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
Load token_match regex with .match, not .search
This commit is contained in:
parent
9a478b6db8
commit
b21481eeca
|
@ -407,7 +407,7 @@ cdef class Tokenizer:
|
||||||
if data.get('infix_finditer'):
|
if data.get('infix_finditer'):
|
||||||
self.infix_finditer = re.compile(data['infix_finditer']).finditer
|
self.infix_finditer = re.compile(data['infix_finditer']).finditer
|
||||||
if data.get('token_match'):
|
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():
|
for string, substrings in data.get('rules', {}).items():
|
||||||
self.add_special_case(string, substrings)
|
self.add_special_case(string, substrings)
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in New Issue
Block a user