'Generate a text string.
Depending on the ``max_nb_chars, returns a string made of words, sentences, or paragraphs.
:example \'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.\'
Keyword arguments:
:param max_nb_chars: Maximum number of characters the text should contain (minimum 5)
:param ext_word_list: a list of words you would like to have instead of \'Lorem ipsum\'.
:rtype str'

@classmethod
def text(cls, max_nb_chars=200, ext_word_list=None):

    text = []
    if (max_nb_chars < 5):
        raise ValueError('text()    can    only    generate    text    of    at    least    5    characters')
    if (max_nb_chars < 25):
        while (not text):
            size = 0
            while (size < max_nb_chars):
                word = ((cls.word_connector if size else '') + cls.word(ext_word_list=ext_word_list))
                text.append(word)
                size += len(word)
            text.pop()
        text[0] = (text[0][0].upper() + text[0][1:])
        last_index = (len(text) - 1)
        text[last_index] += cls.sentence_punctuation
    elif (max_nb_chars < 100):
        while (not text):
            size = 0
            while (size < max_nb_chars):
                sentence = ((cls.word_connector if size else '') + cls.sentence(ext_word_list=ext_word_list))
                text.append(sentence)
                size += len(sentence)
            text.pop()
    else:
        while (not text):
            size = 0
            while (size < max_nb_chars):
                paragraph = (('\n' if size else '') + cls.paragraph(ext_word_list=ext_word_list))
                text.append(paragraph)
                size += len(paragraph)
            text.pop()
    return ''.join(text)
