text3translate: translate words

Description Usage Arguments Details Value Examples

View source: R/rbsa5.code.r

Description

returns a character() deduced from words replacing some of the words by the translation proposed into translation. A component of words can comprise several common words.

Usage

1
2
3
 
  text3translate(words,translation,
                 left=TRUE,eline=TRUE) 

Arguments

words

A character() of words .

translation

A named character vector containing the translations through the names: names(translation)[i] becomes translation[i].

left

When TRUE non translated words are left.

eline

Indicates if resulting empty lines must be left.

Details

When a word has no translation, it is left as it is when left is TRUE, suppressed if not. Initial spacing is not respected, ending blanks are suppressed and no repeated blanks are separating the final words.

Value

The resulting character after translation.

Examples

1
2
3
4
5
6
 
  tra <- c(a="A",e="E",i="I",o="O",u="U") 
  text3translate(letters,tra); 
  text3translate(letters,tra,FALSE); 
  text3translate(letters,tra,FALSE,FALSE); 
  text3translate(rbsa0$text3$v,c(The="xxx",the="xxx")); 

rbsa documentation built on May 2, 2019, 6:07 p.m.