title: Create dictionary and replace by it latin words in R
body: <p>I have  dataset with latin words</p>
  
  <pre><code>text&lt;-c("TESS",
  "MAG")
  </code></pre>
  
  <p>I want to set transliteration from latin-cyrillic</p>
  
  <pre><code>library(stringi)
  d=stri_trans_general(mydat$text, "latin-cyrillic")
  </code></pre>
  
  <p>But I want to manually create the translit dictionary.
  For example:</p>
  
  <pre><code>dictionary&lt;-c("Tess"="ТЕСС"
  "MAG"="МАГ"
  .......
  ......
  )
  </code></pre>
  
  <p>when dictionary is created,
  in mydat$text,all latin words must be replaced by cyrillic words, which i set.
  something like this</p>
  
  <pre><code>d=dictionary(mydat$text)
  </code></pre>
  
  <p>How perform such replacing?</p>
  
  <h1>input</h1>
  
  <pre><code>text&lt;-c("TESS",
  "MAG")
  </code></pre>
  
  <h1>file with translit</h1>
  
  <pre><code>dict=path.csv
  </code></pre>
  
  <p>it containt</p>
  
  <pre><code>dict=
  
  structure(list(old = structure(c(2L, 1L), .Label = c("mag", "tess"
  ), class = "factor"), new = structure(c(2L, 1L), .Label = c("маг", 
  "тесс"), class = "factor")), .Names = c("old", "new"), class = "data.frame", row.names = c(NA, 
  -2L))
  </code></pre>
  
  <p><strong>#output</strong></p>
  
  <pre><code>text&lt;-c("ТЕСС",
  "МАГ")
  </code></pre>
  
  <p>that's all</p>