mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
20 lines
576 B
Python
20 lines
576 B
Python
|
from ..char_classes import LIST_ELLIPSES, LIST_ICONS, HYPHENS
|
||
|
from ..char_classes import CONCAT_QUOTES, ALPHA_LOWER, ALPHA_UPPER, ALPHA, PUNCT
|
||
|
|
||
|
_infixes = (
|
||
|
LIST_ELLIPSES
|
||
|
+ LIST_ICONS
|
||
|
+ [
|
||
|
r"(?<=[0-9])[+\-\*^](?=[0-9-])",
|
||
|
r"(?<=[{al}{q}])\.(?=[{au}{q}])".format(
|
||
|
al=ALPHA_LOWER, au=ALPHA_UPPER, q=CONCAT_QUOTES
|
||
|
),
|
||
|
r"(?<=[{a}]),(?=[{a}])".format(a=ALPHA),
|
||
|
r"(?<=[{a}0-9])(?:{h})(?=[{a}])".format(a=ALPHA, h=HYPHENS),
|
||
|
r"(?<=[{a}0-9])[:<>=/](?=[{a}])".format(a=ALPHA),
|
||
|
]
|
||
|
)
|
||
|
|
||
|
|
||
|
TOKENIZER_INFIXES = _infixes
|