mirror of https://github.com/explosion/spaCy.git
Move import within get_exceptions() function, to speed import
This commit is contained in:
parent
0aaa546435
commit
e7e22d8be6
|
@ -8,7 +8,6 @@ from ..language_data.tokenizer_exceptions import _URL_PATTERN
|
||||||
from ..language_data.punctuation import ALPHA_LOWER
|
from ..language_data.punctuation import ALPHA_LOWER
|
||||||
|
|
||||||
from .punctuation import ELISION, HYPHENS
|
from .punctuation import ELISION, HYPHENS
|
||||||
from ._tokenizer_exceptions_list import BASE_EXCEPTIONS
|
|
||||||
|
|
||||||
from ..symbols import *
|
from ..symbols import *
|
||||||
|
|
||||||
|
@ -18,13 +17,9 @@ import re
|
||||||
|
|
||||||
|
|
||||||
def get_exceptions():
|
def get_exceptions():
|
||||||
|
from ._tokenizer_exceptions_list import BASE_EXCEPTIONS
|
||||||
return BASE_EXCEPTIONS
|
return BASE_EXCEPTIONS
|
||||||
|
|
||||||
# with io.open(os.path.join(os.path.dirname(__file__), 'resources/tokenizer_exceptions'),
|
|
||||||
# 'rt', encoding='utf8') as f:
|
|
||||||
# for line in f:
|
|
||||||
# yield line.strip('\n')
|
|
||||||
|
|
||||||
|
|
||||||
def upper_first_letter(text):
|
def upper_first_letter(text):
|
||||||
if len(text) == 0:
|
if len(text) == 0:
|
||||||
|
|
Loading…
Reference in New Issue