diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-03 00:31:00 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-03 00:31:00 +0200 |
commit | 3a21c29e2eff4378c63717f8920ca3ccbfef013c (patch) | |
tree | ba46504d7baa8d4fb5bfd473acf99a7a184b330c /text_recognizer/data/sentence_generator.py | |
parent | 75eb34020620584247313926527019471411f6af (diff) |
Lint files
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 |