Exchange of words

Top  Previous  Next

Examples > Exchange of words


By this simple example of the exchange of two words some essentials about writing and using of a TETRA project are explained.


Problem definition:


When writing a text it sometimes happens, that inadvertently two expressions are exchanged by mistake. That may be similar names of two persons: Marcuse and Mabuse or two foreign words: ontological and ontic, or the names of two chemical substances N,N-Di-(2-hydroxyethyl)-N',N'-dimethyl-3,7-diaminophenothiazoniumjodid and N,N'-Di-(2-hydroxyethyl)-N,N'-dimethyl-3,7-diaminophenothiazoniumjodid. This exchange by mistake shall be reversed.


Common method of correction:


If you want to correct these mistakes by the method of searching and replacing the words inside of a normal text processing software, you had at first to replace one of the two expressions by a third (e.g.Mabuse by Labuse), then the other expression by the first (Marcuse by Mabuse) and finally the third by the second (Labuse by Marcuse).


TETRA program:


Inside of the TextTransformer an exchange is possible in one run. However you have to write a little program (only one rule). This is worth the cost quickly, if you have to correct several texts. Also you can exchange not only one pair of words but as many pairs as you want. 

TETRA only needs one run for all the exchanges, because every time an arbitrary word of the list is found it will be replaced directly by its counterpart. So the text must be processed only once from left to right.


Two versions of the project are presented:


a) A version with only one production and

b) A version with a simplified production and some additional tokens

This page belongs to the TextTransformer Documentation

Home  Content  German