def _sentence(self, words):
db = self.database<EOL>seed = random.randint(<NUM_LIT:0>, db['<STR_LIT>'] - <NUM_LIT:3>)<EOL>seed_word, next_word = db['<STR_LIT>'][seed], db['<STR_LIT>'][seed + <NUM_LIT:1>]<EOL>w1, w2 = seed_word, next_word<EOL>sentence = []<EOL>for i in range(<NUM_LIT:0>, words - <NUM_LIT:1>):<EOL><INDENT>sentence.append(w1)<EOL>w1, w2 = w2, random.choice(db['<STR_LIT>'][(w1, w2)])<EOL><DEDENT>sentence.append(w2)<EOL>sentence = '<STR_LIT:U+0020>'.join(sentence)<EOL>sentence = sentence.capitalize()<EOL>sentence = sentence.replace('<STR_LIT:.>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:!>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:?>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT::>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:.>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:!>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:?>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT::>', '<STR_LIT>')<EOL>sentence = sentence.replace('<STR_LIT:">', '<STR_LIT>')<EOL>sentence = re.sub('<STR_LIT>', '<STR_LIT>', sentence)<EOL>sentence = re.sub('<STR_LIT>', '<STR_LIT:U+0020>', sentence)<EOL>sentence += '<STR_LIT:.>'<EOL>return sentence<EOL>
Generate a sentence