From e7e22d8be65265573edad3b8fcaca80e77c9038d Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 27 Feb 2017 11:34:48 +0100 Subject: [PATCH] Move import within get_exceptions() function, to speed import --- spacy/fr/tokenizer_exceptions.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spacy/fr/tokenizer_exceptions.py b/spacy/fr/tokenizer_exceptions.py index 8f8dcf0b0..e959d05f4 100644 --- a/spacy/fr/tokenizer_exceptions.py +++ b/spacy/fr/tokenizer_exceptions.py @@ -8,7 +8,6 @@ from ..language_data.tokenizer_exceptions import _URL_PATTERN from ..language_data.punctuation import ALPHA_LOWER from .punctuation import ELISION, HYPHENS -from ._tokenizer_exceptions_list import BASE_EXCEPTIONS from ..symbols import * @@ -18,13 +17,9 @@ import re def get_exceptions(): + from ._tokenizer_exceptions_list import 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): if len(text) == 0: