Your code fails for French text.
If you wanted to change it, to split "words" by blanks and punctuation characters, you would have
tr -s [:blank:][:punct:] "\n"
and then that piece would fit into the pipeline, the rest unscathed. This design is far easier to reason about than a dozen pages of Pascal.