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.
This commit is contained in:
Daylen Yang 2016-05-16 14:38:20 -07:00
parent 17137f5c0c
commit 1692c2df3c
1 changed files with 1 additions and 1 deletions

View File

@ -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]