Advice on how to mutate books

I want to make a program to mutate books by replacing words with
synonyms. I have a few ideas about how to do this but they’re the ideas
of a nub. Anyone want to put me on the right path? Vague answers are
fine because I enjoy the challenge. However this nub wants to learn how
to code clean, what would be the simplest or kewl way to do this.