tit:text
type:$type_both
syntax:!text `operation' `parameter'
mean:This is intended to be a very powerful text manipulation tool,\
allowing very sophisticated processing of long text strings with high speed. <br/>\
Many of the `operations' accept masks. A mask is a string composed of `0's and `1's. \
For operations which accept a mask, only characters at positions whose corresponding\
character in the mask is not a `0' are processed. (In this sense positions\
corresponding to `
0's are `masked'.) Empty mask is considered\
as of being entirely composed of `1's. <br/>\
A mask which is too short repeats itself, unless it terminates with a `+',\
in which case it fills the rest with `1's, or with a `-', in which case\
it fills the rest with `0's. <br/>\
For the time being, implemented `operations' are as follows.\
<ul>\
<li><span class="tt">!text common `text1' and `text2' [mask `maskstring']</span> <br/>\
Extracts characters in `text1' one by one, for those identical\
to the corresponding characters in `text2' and whose\
positions are not masked by `maskstring'.\
</li><li><span class="tt">!text compare `text1' and `text2'\
</span> <br/>\
Compares the strings `text1' and `text2' character by character, \
and returns a mask string with `0's onpositions where the corresponding characters in `text1'\
and `text2' are equal, and `1's otherwise.\
</li
><li
><span
class="tt">!text
copy `text
' [mask `maskstring']</span
> <br
/>\
Returns non-masked characters in `text'.\
</li><li><span class="tt">!text count `charlist' in `text' [mask `maskstring']</span> <br/>\
Returns the number of characters in `text' whose positions\
are not masked by `maskstring', and who appear in `charlist'.\
</li><li><span class="tt">!text diff `text1' from `text2' [mask `maskstring']</span> <br/>\
Extracts characters in `text1' one by one, for those different to the corresponding \
characters in `text2' and whose positions are not masked by `maskstring'. <br/>\
(Synonyme of diff: differ).\
</li><li><span class="tt">!text expand `text' using `maskstring'\
</span> <br/>\
Produces a string, where positions corresponding to `0's in\
`maskstring' are filled by ` ' (the space character),\
and where positions corresponding to `1's in `maskstring' are filled by characters of \
`text'. The characters in `text' are used one by one, and the\
resulting string stops when all the characters in `text' are exhausted \
(or when the string reaches the length limit).\
</li><li><span class="tt">!text insert `text1' into `text2' [mask `maskstring']</span> <br/>\
Returns `text2' with non-masked characters replaced by characters `text1'. \
Characters in `text1' are used one by one (without taking into account the masking), and\
the replacement stops when there is no character left in `text1'.\
</li><li><span class="tt">!text interact `text1' and `text2' table `itab' [mask `maskstring']</span> <br/>\
Returns a new text which is result of interactions of characters\
in corresponding positions in `text1
' and `text2'. The rule of the interaction is
defined in\
`itab
'. <br/> `itab' contains n
+1 lines
, each of n characters
.\
The first line defines the characters corresponding to
each position\
in the following n lines which defines the multiplication table.\
<br/>\
The multiplication table needs not to be symmetric. In this case, the rows correspond \
to characters in `text1', and the columns correspond to characters in `text2'.\
<br/>\
If `text1' or `text2' contains a character not in the first line of `itab', \
the interaction at the corresponding position is considered as empty. Also, masked\
positions are ignored.<br/>\
If `text1' and `text2' have different lengths, the longer is cut to fit the shorter.\
</li><li><span class="tt">!text mark `charlist' in `text'</span> <br/>\
Returns a mask string with `1's on positions where the corresponding character in `text' \
appears in `charlist', and with `0's on other positions.\
</li><li><span class="tt">!text max `text1' and `text2' [mask `maskstring']</span> <br/>\
Returns a string which at
each position is the character with highest\
ASCII code between corresponding characters in `text1' and `text2'. \
The length of the result is that of the longest of the two. Masked positions are skipped.\
</li
><li
><span
class="tt">!text
min `text1
' and `text2' [mask `maskstring
']</span> <br/>\
Returns a string which at each position is the character with lowest\
ASCII code between corresponding characters in `text1' and `text2'. \
The length of the result is that of the\
shortest of the two. Masked positions are skipped.\
</li><li><span class="tt">!text occur `charlist' in `text' [mask `maskstring']</span> <br/>\
Returns characters in `charlist' which occur in unmasked positions in `text'. <br/>\
(Synonymes of occur: appear, occurrence).\
</li><li><span class="tt">!text remove `charlist' in `text' [mask `maskstring']</span> <br/>\
Returns `text' in which masked characters and characters\
appearing in `charlist' are removed. <br/>(Synonymes of remove: drop, delete).\
</li><li><span class="tt">!text reorder `text' by `orderlist'</span> <br/>\
Returns a reordered `text' using the order
list `orderlist
'. Reordering is cyclic \
if `orderlist' is shorter than `text'. <br/>\
`orderlist' must be a
list of n positive integers
, which\
is a permutation of the set {1,...,n}. If `orderlist' contains\
items other than integers within the bound, empty string is returned.\
However, unicity check is not performed on items of `orderlist'.\
</li><li><span class="tt">!text repeat `text' to `len'</span> <br/>\
Repeat the string `text' cyclicly, up to length `len'.\
</li><li><span class="tt">!text reverse `text'</span> <br/>\
Reverse the order of `text', with the last character coming first, etc.\
</li><li><span class="tt">!text select `charlist' in `text' [mask `maskstring']</span> <br/>\
Returns `text' in which masked characters and characters not appearing in \
`charlist' are removed. <br/> (Synonymes of select: pick, pickup).\
</li></ul>