well this breaks the example both in terms of example input and expected output.
It breaks the example input as I understood it - a word in words list is concatenated to previous word, i.e. my understandig was the input would be
It breaks the expected output as I understood it - a word in list is preceded by dot and space, i.e. making a complete sentence.
All that said - define explicit rules how the input string will look like and what the expected output should be and then a more complex parser should be created
It breaks the example input as I understood it - a word in words list is concatenated to previous word, i.e. my understandig was the input would be
When parents goWhat do they listen toWhyHow
It breaks the expected output as I understood it - a word in list is preceded by dot and space, i.e. making a complete sentence.
When parents go. What do they listen to. Why. How
All that said - define explicit rules how the input string will look like and what the expected output should be and then a more complex parser should be created
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs