title: Match and replace misspelled words in a string in R
body: <p>I have a list of phrases, in which I want to replace certain words with a similar word, in case it is misspelled.</p>
  
  <pre><code>library(stringr)
  a4 &lt;- "I would like a cheseburger and friees please"
  badwords.corpus &lt;- c("cheseburger", "friees")
  goodwords.corpus &lt;- c("cheeseburger", "fries")
  
  vect.corpus &lt;- goodwords.corpus
  names(vect.corpus) &lt;- badwords.corpus
  
  str_replace_all(a4, vect.corpus)
  # [1] "I would like a cheeseburger and fries please"
  </code></pre>
  
  <p>everything works perfectly, until it finds a similar string, and replaces it with another word</p>
  
  <p>if I have a pattern like the following:</p>
  
  <p><code>"plea"</code>, the correct one is <code>"please"</code>, but when I execute it removes it and replaces it with <code>"pleased"</code>.</p>
  
  <p>What I am looking for is that if a string is already correct, it is no longer modified, in case it finds a similar pattern.</p>