Description Usage Arguments Details Value See Also Examples
from a text, gives it back after replacing some words (in fact sequences of characters) by others. The translation can be conditionned by the surrounding characters of the sequence.
1 2 3 4 5 |
text |
A character vector containing the text (a component, a line). |
translate |
A two-columns character matrix with, row by row, a word to translate and its translations. The second column can comprise "" not the first. |
lowering |
Must a lowering being applied before the selection of the words to translate? |
b.accepted |
A character providing the surrounding characters before the words to determine the acceptance of the translation. |
a.accepted |
A character providing the surrounding characters after the words to determine the acceptance of the translation. |
b.rejected |
A character providing the surrounding characters before the words to determine the rejection of the translation. |
a.rejected |
A character providing the surrounding characters after the words to determine the rejection of the translation. |
b.line |
Must words at the beginning of a line be translated? |
e.line |
Must words at the end of a line be translated? |
The words to translate cannot be extended upon two successive lines.
The translations are done sequentially along the rows of translate
so modifying their order can produce different results.
For obvious reason, b.accepted and b.rejected cannot be
non NULL simultaneously; the same for a.accepted and
a.rejected.
Resulting empty lines are not removed neither already present empty lines.
The translated text
1 2 3 4 5 6 |
let <- c("a","e","i","o","u","y");
tra <- matrix(c(let,tolower(let)),ncol=2);
text3replace(letters,tra);
text3replace(c("Il etait une fois","un petit et rouge chaperon"),tra);
text3replace(c("Il etait une fois","un petit et rouge chaperon"),tra,b.accepted=" ");
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.