mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Move update_exc to global language data utils
This commit is contained in:
parent
f324311249
commit
6a60a61086
|
@ -6,8 +6,8 @@ from os import path
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from . import language_data
|
from . import language_data
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -10,8 +10,8 @@ from ..lemmatizer import Lemmatizer
|
||||||
from ..vocab import Vocab
|
from ..vocab import Vocab
|
||||||
from ..tokenizer import Tokenizer
|
from ..tokenizer import Tokenizer
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -6,8 +6,8 @@ from os import path
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
from . import language_data
|
from . import language_data
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -6,8 +6,8 @@ from os import path
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
from . import language_data
|
from . import language_data
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -6,8 +6,8 @@ from os import path
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
from . import language_data
|
from . import language_data
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -6,8 +6,8 @@ from os import path
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
from . import language_data
|
from . import language_data
|
||||||
from ..attrs import LANG
|
from ..attrs import LANG
|
||||||
from ..util import update_exc
|
|
||||||
|
|
||||||
|
from ..language_data import update_exc
|
||||||
from ..language_data import EMOTICONS
|
from ..language_data import EMOTICONS
|
||||||
from .language_data import ORTH_ONLY
|
from .language_data import ORTH_ONLY
|
||||||
from .language_data import strings_to_exc
|
from .language_data import strings_to_exc
|
||||||
|
|
|
@ -108,12 +108,6 @@ def compile_infix_regex(entries):
|
||||||
return re.compile(expression)
|
return re.compile(expression)
|
||||||
|
|
||||||
|
|
||||||
def update_exc(exc, additions):
|
|
||||||
overlap = set(exc.keys()).intersection(set(additions))
|
|
||||||
assert not overlap, overlap
|
|
||||||
exc.update(additions)
|
|
||||||
|
|
||||||
|
|
||||||
def normalize_slice(length, start, stop, step=None):
|
def normalize_slice(length, start, stop, step=None):
|
||||||
if not (step is None or step == 1):
|
if not (step is None or step == 1):
|
||||||
raise ValueError("Stepped slices not supported in Span objects."
|
raise ValueError("Stepped slices not supported in Span objects."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user