How do I find and remove repeated words from sentences in PowerPoint?
As a grammar check I want to find double words which are typed by mistake. For example:
Stackoverflow is a a greate site
In this example, one “a” would be removed.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My friend, you are embarking on a dangerous mission if you are trying to re-invent automatic grammar checking. Natural language is filled with exceptions guaranteed to evade whatever small set of rules you think will do the job.
Anyhow, below is a lucidly naive stab at it. Now, this code works for the example you gave. It will remove that extra “a”. But please be aware that not every repeated word should be removed if you care about preserving grammar, syntax and semantics. Automatically removing repeated “that”s will work wonders on this:
but it will alter the writer’s intent on this by taking the grammar down to a very informal level:
and removing repeats will ruin absolutely everything here:
not to mention this:
Be prepared for disaster! But anyway, the code works for your example (and more) and provides a framework for you to build upon and to fine-tune such that it works in the majority of cases relevant to you.