Thanks for getting the book Joakim. I'm glad you like it.
Really good question about the PowerShell Spelling Corrector
My intention was to create a list of unique words that I could quickly look up. Knowing the number of occurrences of each word is not something that is needed for the spelling corrector application.You've hit on the next step!
That PowerShell function is easily re-purposed and changed to do what you are suggesting.
Now you have a function that can take the content of any string or text file and it will count the number of occurrences of each word.
Thanks again for the great question.