mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Merge pull request #1 from daylen/fixed_get_lang_class_parse
Fix get_lang_class parsing
This commit is contained in:
commit
bffbe9b9d0
|
@ -23,7 +23,7 @@ def set_lang_class(name, cls):
|
||||||
|
|
||||||
|
|
||||||
def get_lang_class(name):
|
def get_lang_class(name):
|
||||||
lang = re.split('[^a-zA-Z0-9_]', name, 1)[0]
|
lang = re.split('_', name, 1)[0]
|
||||||
if lang not in LANGUAGES:
|
if lang not in LANGUAGES:
|
||||||
raise RuntimeError('Language not supported: %s' % lang)
|
raise RuntimeError('Language not supported: %s' % lang)
|
||||||
return LANGUAGES[lang]
|
return LANGUAGES[lang]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user