From 61fa1ad428e9f84e4e6cfb54056dfeaf2436c062 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Fri, 6 Mar 2020 10:13:18 +0100 Subject: [PATCH 1/2] Show actual alphabet path in error message --- util/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/text.py b/util/text.py index d3be7eb8..253d2291 100644 --- a/util/text.py +++ b/util/text.py @@ -33,9 +33,9 @@ class Alphabet(object): return self._str_to_label[string] except KeyError as e: raise KeyError( - 'ERROR: Your transcripts contain characters (e.g. \'{}\') which do not occur in data/alphabet.txt! Use ' \ + 'ERROR: Your transcripts contain characters (e.g. \'{}\') which do not occur in \'{}\'! 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.'.format(string) + 'then add all these to \'{}\'.'.format(self._config_file, string, self._config_file) ).with_traceback(e.__traceback__) def has_char(self, char): From 0f8291df71cf6b389406d129e3d56cbf9bab3f07 Mon Sep 17 00:00:00 2001 From: lissyx <1645737+lissyx@users.noreply.github.com> Date: Fri, 6 Mar 2020 10:15:18 +0100 Subject: [PATCH 2/2] Proper arguments ordering --- util/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/text.py b/util/text.py index 253d2291..910796f7 100644 --- a/util/text.py +++ b/util/text.py @@ -35,7 +35,7 @@ class Alphabet(object): raise KeyError( 'ERROR: Your transcripts contain characters (e.g. \'{}\') which do not occur in \'{}\'! Use ' \ 'util/check_characters.py to see what characters are in your [train,dev,test].csv transcripts, and ' \ - 'then add all these to \'{}\'.'.format(self._config_file, string, self._config_file) + 'then add all these to \'{}\'.'.format(string, self._config_file, self._config_file) ).with_traceback(e.__traceback__) def has_char(self, char):