From a91278cb32085d8b44e674a372d2f7005ad1b889 Mon Sep 17 00:00:00 2001 From: ines Date: Tue, 9 May 2017 00:00:00 +0200 Subject: [PATCH] Rename _URL_PATTERN to URL_PATTERN --- spacy/lang/fr/tokenizer_exceptions.py | 2 +- spacy/lang/hu/tokenizer_exceptions.py | 2 +- spacy/lang/tokenizer_exceptions.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/lang/fr/tokenizer_exceptions.py b/spacy/lang/fr/tokenizer_exceptions.py index 2f6f71127..5d8c37878 100644 --- a/spacy/lang/fr/tokenizer_exceptions.py +++ b/spacy/lang/fr/tokenizer_exceptions.py @@ -144,7 +144,7 @@ _regular_exp += ["^{prefix}[{hyphen}][{alpha}][{alpha}{elision}{other_hyphen}\-] _regular_exp += ["^{prefix}[{elision}][{alpha}][{alpha}{elision}{hyphen}\-]*$".format( prefix=p, elision=HYPHENS, hyphen=_other_hyphens, alpha=ALPHA_LOWER) for p in _elision_prefix] -_regular_exp.append(_URL_PATTERN) +_regular_exp.append(URL_PATTERN) TOKENIZER_EXCEPTIONS = dict(_exc) diff --git a/spacy/lang/hu/tokenizer_exceptions.py b/spacy/lang/hu/tokenizer_exceptions.py index 043839923..dd8fdab6c 100644 --- a/spacy/lang/hu/tokenizer_exceptions.py +++ b/spacy/lang/hu/tokenizer_exceptions.py @@ -96,4 +96,4 @@ _nums = "(({ne})|({t})|({on})|({c}))({s})?".format( TOKENIZER_EXCEPTIONS = dict(_exc) -TOKEN_MATCH = re.compile("^({u})|({n})$".format(u=_URL_PATTERN, n=_nums)).match +TOKEN_MATCH = re.compile("^({u})|({n})$".format(u=URL_PATTERN, n=_nums)).match diff --git a/spacy/lang/tokenizer_exceptions.py b/spacy/lang/tokenizer_exceptions.py index 4c6d0fad2..f9b6530ec 100644 --- a/spacy/lang/tokenizer_exceptions.py +++ b/spacy/lang/tokenizer_exceptions.py @@ -10,7 +10,7 @@ from ..symbols import ORTH, POS, LEMMA, SPACE, PUNCT # URL validation regex courtesy of: https://mathiasbynens.be/demo/url-regex # A few minor mods to this regex to account for use cases represented in test_urls -_URL_PATTERN = ( +URL_PATTERN = ( r"^" # in order to support the prefix tokenization (see prefix test cases in test_urls). r"(?=[\w])" @@ -53,7 +53,7 @@ _URL_PATTERN = ( r"$" ).strip() -TOKEN_MATCH = regex.compile(_URL_PATTERN, regex.UNICODE).match +TOKEN_MATCH = regex.compile(URL_PATTERN, regex.UNICODE).match