title: how to generate string of letters based on some parameters
body: <p>I have a set of sentences with a different number of words in each sentence. I need to replace each word with a string of letters, but the string of letters needs to be based on specific criteria. For example, the letter 't' can be replaced only by the letters 'i', 'l', 'f'; the letter 'e' can be replaced only by 'o' or 'c', and so on, for each letter of the alphabet. Also, spaces between words need to be kept intact, as well as full stops, apostrophes and other symbols of punctuation. Following an example:
  ORIGINAL SENTENCE: He loves dog.
  SENTENCE WITH STRING OF LETTERS: Fc tcwoz bcy. </p>
  
  <p>Is there a way to automatise this procedure in R? Thank you.</p>
  
  <p>ADDED: I need to do this replacement for about 400 sentences. The sentences are stored in a variable of a data frame (data$sentences).</p>