diff options
Diffstat (limited to 'text_recognizer/data/sentence_generator.py')
-rw-r--r-- | text_recognizer/data/sentence_generator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/text_recognizer/data/sentence_generator.py b/text_recognizer/data/sentence_generator.py index afcdbe9..8567e6d 100644 --- a/text_recognizer/data/sentence_generator.py +++ b/text_recognizer/data/sentence_generator.py @@ -28,7 +28,7 @@ class SentenceGenerator: r"""Generates a word or sentences from the Brown corpus. Sample a string from the Brown corpus of length at least one word and at most - max_length, padding to max_length with the '_' characters if sentence is + max_length, padding to max_length with the '_' characters if sentence is shorter. Args: @@ -39,8 +39,11 @@ class SentenceGenerator: str: A sentence from the Brown corpus. Raises: - ValueError: If max_length was not specified at initialization and not + ValueError: If max_length was not specified at initialization and not given as an argument. + + RuntimeError: If a valid string was not generated. + """ if max_length is None: max_length = self.max_length |