From 1692c2df3c744c6cfd79d78777ab6d9d421d06cd Mon Sep 17 00:00:00 2001 From: Daylen Yang Date: Mon, 16 May 2016 14:38:20 -0700 Subject: [PATCH] Fix get_lang_class parsing We want the get_lang_class to return "en" for both "en" and "en_glove_cc_300_1m_vectors". Changed the split rule to "_" so that this happens. --- spacy/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/util.py b/spacy/util.py index 8032cf6fd..57503d191 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -23,7 +23,7 @@ def set_lang_class(name, cls): 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: raise RuntimeError('Language not supported: %s' % lang) return LANGUAGES[lang]