Merge pull request #1873 from mozilla/error-message

Prettier error message to the terminal when alphabets are mis-matched.
This commit is contained in:
Josh Meyer 2019-02-13 00:03:04 +01:00 committed by GitHub
commit c8b1e71fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,14 +31,7 @@ class Alphabet(object):
return self._str_to_label[string]
except KeyError as e:
raise KeyError(
'''
ERROR: You have characters in your transcripts
which do not occur in your data/alphabet.txt
file. Please verify that your alphabet.txt
contains all neccessary characters. Use
util/check_characters.py to see what characters are in
your train / dev / test transcripts.
'''
'''ERROR: Your transcripts contain characters which do not occur in data/alphabet.txt! Use util/check_characters.py to see what characters are in your {train,dev,test}.csv transcripts, and then add all these to data/alphabet.txt.'''
).with_traceback(e.__traceback__)
sys.exit()