From cd3304f3ca7c3035563d9333cb9b76e53b70701f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 30 Sep 2021 23:03:48 +0200 Subject: Lint sentence_generator --- text_recognizer/data/sentence_generator.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'text_recognizer/data/sentence_generator.py') diff --git a/text_recognizer/data/sentence_generator.py b/text_recognizer/data/sentence_generator.py index f09703b..afcdbe9 100644 --- a/text_recognizer/data/sentence_generator.py +++ b/text_recognizer/data/sentence_generator.py @@ -25,20 +25,22 @@ class SentenceGenerator: self.max_length = max_length def generate(self, max_length: Optional[int] = None) -> str: - """Generates a word or sentences from the Brown corpus. + 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 shorter. + 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 + shorter. Args: - max_length (Optional[int]): The maximum number of characters in the sentence. Defaults to None. + max_length (Optional[int]): The maximum number of characters in the sentence. + Defaults to None. Returns: str: A sentence from the Brown corpus. Raises: - ValueError: If max_length was not specified at initialization and not given as an argument. - + ValueError: If max_length was not specified at initialization and not + given as an argument. """ if max_length is None: max_length = self.max_length -- cgit v1.2.3-70-g09d2