Description
I love the world and the things in it.
I love the way cheetah runs.
I am a man of honor.
I will be a rich guy.
I am a teenager so I am a rebel.
I am an iconoclast and a fighter
I believe in education.
I love everything.
I watch a movie every day.
I hate pollution.
I love the work of god.
I love the beauty of this world.
I adore the way people try solve hard things.
I am nothing but a blade of grass.
I will unleash a lot of prophecies and will bring down hordes of legions unto this earth to destroy you.
I love doing things in a peculiar way.
I love and hate probability. It is so stupid and fun at the same time.
I love the way software programs work.
I love my room.
Goal
I will type in a word and the program should tell me what the next possible word could be.
For example, if I type “I”, the program should tell me that the next possible words could be: 1) love 2) am 3) will 4) adore 5) hate (probabistically in this order). We will call the order of words as ranking.
Subsequently, if I type “I love”, the program should tell me that the next word could be: 1) the 2) my 3) and 4) doing.
If I type in the word “I love the”, your program should tell me that the next word could be (in ranking): 1) way 2) my 3) work 4) beauty.
Limit yourself to the combinations of 4 words only.
Your program should also print a random sentence.
For example, I will give a word (say “I”). Your program should automatically print a sentence having three words.