Julia-gro A4#59
Conversation
|
The code works in my tests and the output matches the assignment requirements. It supports character-based and word-based generation, reads from a file or stdin, and the seed option makes the output reproducible. I like that your implementation is very compact and easy to follow. I also really liked the algorithm section in your README, because it summarizes the main steps in words and makes it easy to follow what happens when reading through the code. One edge case to consider is the fixed limit of 2000 generated units. I understand that this prevents infinite loops, which is useful. However, the meaning of 2000 units is quite different in character mode and word mode. in character mode it means about 2000 characters, while in word mode it can mean up to 2000 words. For very short cyclic inputs, this could also create a very long output from a very small training text. Maybe it would be worth considering whether the limit should depend on the input length or the selected mode. Overall, this is a clean and well-working solution. (Y) |
ready for review :)