This simple generator emits short sentences based on the given text corpus using a Markov chain. To put it simply, it works kinda like word suggestions that you have while typing messages in your smartphone. It analyzes which word is followed by which in the given corpus and how often. And then, for any given word it tries to predict what the next one might be. Here you create an instance of TextGenerator passing an array of strings to it - it represents your text corpus which will be used to "train" the generator. The more strings/sentences you pass, the more diverse results you get, so you'd better pass like hundreds of them, or even more! If you have your texts in an external file, you can pass the path to it as an argument for TextGenerator's constructor.