A4#56
Conversation
|
Hey, your code has a clear structure, and I liked that you separated the different steps into functions. The dictionary model itself looks good to me, the character model uses string contexts and the word model uses tuples, so that part seems to follow the assignment well. 😊 The main issue I noticed while testing is that the program sometimes does not stop generating text. I think this is because in generate_chars() and generate_words() you define max_chars/max_words and also count the generated output, but the loops still use while True. So the limits are never actually used. I would change the loops to something like while count < max_chars or while count < max_words. I also noticed this with k == 0. If you want to allow k == 0, it definitely needs a working limit, otherwise it just keeps randomly choosing characters or words from the input. Another tiny thing I noticed is replacing \n with spaces in character mode could make the whitespace handling more consistent (since you handle it with split() in word mode). Also, the README is nice, but I would maybe add a few examples of how to run the program. Overall, I think the model-building part is good, but the missing stopping condition is the main thing that currently keeps the program from working reliably. Nice work 👍 |
Ready to review