Rev 5766 | Rev 11210 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5766 | Rev 5921 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !! +exec+ +var+ +string+ |
1 | !! +exec+ +var+ +string+ |
2 | $lst_tit text $lst_titend$type_both |
2 | $lst_tit text $lst_titend$type_both |
3 | $(lst_syntax)text $emph operation $emphend $emph parameter $emphend</ |
3 | $(lst_syntax)text $emph operation $emphend $emph parameter $emphend</span> |
4 | $lst_mean This is intended to be a very powerful text manipulation tool, |
4 | $lst_mean This is intended to be a very powerful text manipulation tool, |
5 | allowing very sophisticated processing of long text strings with high speed. <br/> |
5 | allowing very sophisticated processing of long text strings with high speed. <br/> |
6 | Many of the $emph operations$emphend accept masks. A mask is a string |
6 | Many of the $emph operations$emphend accept masks. A mask is a string |
7 | composed of '0's and '1's. For operations |
7 | composed of '0's and '1's. For operations |
8 | which accept a mask, only characters at positions whose corresponding |
8 | which accept a mask, only characters at positions whose corresponding |
Line 12... | Line 12... | ||
12 | A mask which is too short repeats itself, unless it terminates with a '+', |
12 | A mask which is too short repeats itself, unless it terminates with a '+', |
13 | in which case it fills the rest with '1's, or with a '-', in which case |
13 | in which case it fills the rest with '1's, or with a '-', in which case |
14 | it fills the rest with '0's. <br/> |
14 | it fills the rest with '0's. <br/> |
15 | For the time being, implemented $emph operations $emphend are as follows. |
15 | For the time being, implemented $emph operations $emphend are as follows. |
16 | <ul> |
16 | <ul> |
17 | <li><tt>!text common $emph text1$emphend and $emph text2$emphend |
17 | <li><span class="tt">!text common $emph text1$emphend and $emph text2$emphend |
18 | [mask $emph maskstring$emphend]</ |
18 | [mask $emph maskstring$emphend]</span> <br/> |
19 | Extracts characters in $emph text1$emphend one by one, for those identical |
19 | Extracts characters in $emph text1$emphend one by one, for those identical |
20 | to the corresponding characters in $emph text2$emphend and whose |
20 | to the corresponding characters in $emph text2$emphend and whose |
21 | positions are not masked by $emph maskstring$emphend. |
21 | positions are not masked by $emph maskstring$emphend. |
22 | <li><tt>!text compare $emph text1$emphend and $emph text2$emphend |
22 | <li><span class="tt">!text compare $emph text1$emphend and $emph text2$emphend |
23 | </ |
23 | </span> <br/> |
24 | Compares the strings $emph text1 $emphend and $emph text2 |
24 | Compares the strings $emph text1 $emphend and $emph text2 |
25 | $emphend character by character, and returns a mask string with '0's on |
25 | $emphend character by character, and returns a mask string with '0's on |
26 | positions where the corresponding characters in $emph text1 $emphend |
26 | positions where the corresponding characters in $emph text1 $emphend |
27 | and $emph text2$emphend are equal, and '1's otherwise. |
27 | and $emph text2$emphend are equal, and '1's otherwise. |
28 | <li><tt>!text copy $emph text$emphend |
28 | <li><span class="tt">!text copy $emph text$emphend |
29 | [mask $emph maskstring$emphend]</ |
29 | [mask $emph maskstring$emphend]</span> <br/> |
30 | Returns non-masked characters in $emph text$emphend. |
30 | Returns non-masked characters in $emph text$emphend. |
31 | <li><tt>!text count $emph charlist$emphend in $emph text$emphend |
31 | <li><span class="tt">!text count $emph charlist$emphend in $emph text$emphend |
32 | [mask $emph maskstring$emphend]</ |
32 | [mask $emph maskstring$emphend]</span> <br/> |
33 | Returns the number of characters in $emph text$emphend whose positions |
33 | Returns the number of characters in $emph text$emphend whose positions |
34 | are not masked by $emph maskstring$emphend, and who appear in $emph |
34 | are not masked by $emph maskstring$emphend, and who appear in $emph |
35 | charlist$emphend. |
35 | charlist$emphend. |
36 | <li><tt>!text diff $emph text1$emphend from $emph text2$emphend |
36 | <li><span class="tt">!text diff $emph text1$emphend from $emph text2$emphend |
37 | [mask $emph maskstring$emphend]</ |
37 | [mask $emph maskstring$emphend]</span> <br/> |
38 | Extracts characters in $emph text1$emphend one by one, for those different |
38 | Extracts characters in $emph text1$emphend one by one, for those different |
39 | to the corresponding characters in $emph text2$emphend and whose |
39 | to the corresponding characters in $emph text2$emphend and whose |
40 | positions are not masked by $emph maskstring$emphend. <br/> |
40 | positions are not masked by $emph maskstring$emphend. <br/> |
41 | (Synonyme of diff: differ). |
41 | (Synonyme of diff: differ). |
42 | <li><tt>!text expand $emph text$emphend using $emph maskstring$emphend |
42 | <li><span class="tt">!text expand $emph text$emphend using $emph maskstring$emphend |
43 | </ |
43 | </span> <br/> |
44 | Produces a string, where positions corresponding to '0's in |
44 | Produces a string, where positions corresponding to '0's in |
45 | $emph maskstring$emphend are filled by ' ' (the space character), |
45 | $emph maskstring$emphend are filled by ' ' (the space character), |
46 | and where positions corresponding to '1's in $emph maskstring |
46 | and where positions corresponding to '1's in $emph maskstring |
47 | $emphend are filled by characters of $emph text$emphend. The |
47 | $emphend are filled by characters of $emph text$emphend. The |
48 | characters in $emph text$emphend are used one by one, and the |
48 | characters in $emph text$emphend are used one by one, and the |
49 | resulting string stops when all the characters in $emph text |
49 | resulting string stops when all the characters in $emph text |
50 | $emphend are exhausted (or when the string reaches the length limit). |
50 | $emphend are exhausted (or when the string reaches the length limit). |
51 | <li><tt>!text insert $emph text1$emphend into $emph text2$emphend |
51 | <li><span class="tt">!text insert $emph text1$emphend into $emph text2$emphend |
52 | [mask $emph maskstring$emphend]</ |
52 | [mask $emph maskstring$emphend]</span> <br/> |
53 | Returns $emph text2$emphend with non-masked characters replaced by |
53 | Returns $emph text2$emphend with non-masked characters replaced by |
54 | characters $emph text1$emphend. Characters in $emph text1 $emphend |
54 | characters $emph text1$emphend. Characters in $emph text1 $emphend |
55 | are used one by one (without taking into account the masking), and |
55 | are used one by one (without taking into account the masking), and |
56 | the replacement stops when there is no character left in |
56 | the replacement stops when there is no character left in |
57 | $emph text1$emphend. |
57 | $emph text1$emphend. |
58 | <li><tt>!text interact $emph text1$emphend and $emph text2$emphend |
58 | <li><span class="tt">!text interact $emph text1$emphend and $emph text2$emphend |
59 | table $emph itab$emphend [mask $emph maskstring$emphend]</ |
59 | table $emph itab$emphend [mask $emph maskstring$emphend]</span> <br/> |
60 | Returns a new text which is result of interactions of characters |
60 | Returns a new text which is result of interactions of characters |
61 | in corresponding positions in $emph text1$emphend and |
61 | in corresponding positions in $emph text1$emphend and |
62 | $emph text2$emphend. The rule of the interaction is defined in |
62 | $emph text2$emphend. The rule of the interaction is defined in |
63 | $emph itab$emphend. <br/> |
63 | $emph itab$emphend. <br/> |
64 | $emph itab$emphend contains n+1 lines, each of n characters. |
64 | $emph itab$emphend contains n+1 lines, each of n characters. |
Line 74... | Line 74... | ||
74 | the corresponding position is considered as empty. Also, masked |
74 | the corresponding position is considered as empty. Also, masked |
75 | positions are ignored. |
75 | positions are ignored. |
76 | <br/> |
76 | <br/> |
77 | If $emph text1$emphend and $emph text2$emphend have different |
77 | If $emph text1$emphend and $emph text2$emphend have different |
78 | lengths, the longer is cut to fit the shorter. |
78 | lengths, the longer is cut to fit the shorter. |
79 | <li><tt>!text mark $emph charlist$emphend in $emph text$emphend |
79 | <li><span class="tt">!text mark $emph charlist$emphend in $emph text$emphend |
80 | </ |
80 | </span> <br/> |
81 | Returns a mask string with '1's on positions where the |
81 | Returns a mask string with '1's on positions where the |
82 | corresponding character in $emph text$emphend appears in |
82 | corresponding character in $emph text$emphend appears in |
83 | $emph charlist$emphend, and with '0's on other positions. |
83 | $emph charlist$emphend, and with '0's on other positions. |
84 | <li><tt>!text max $emph text1$emphend and $emph text2$emphend |
84 | <li><span class="tt">!text max $emph text1$emphend and $emph text2$emphend |
85 | [mask $emph maskstring$emphend]</ |
85 | [mask $emph maskstring$emphend]</span> <br/> |
86 | Returns a string which at each position is the character with highest |
86 | Returns a string which at each position is the character with highest |
87 | ASCII code between corresponding characters in $emph text1$emphend |
87 | ASCII code between corresponding characters in $emph text1$emphend |
88 | and $emph text2$emphend. The length of the result is that of the |
88 | and $emph text2$emphend. The length of the result is that of the |
89 | longest of the two. Masked positions are skipped. |
89 | longest of the two. Masked positions are skipped. |
90 | <li><tt>!text min $emph text1$emphend and $emph text2$emphend |
90 | <li><span class="tt">!text min $emph text1$emphend and $emph text2$emphend |
91 | [mask $emph maskstring$emphend]</ |
91 | [mask $emph maskstring$emphend]</span> <br/> |
92 | Returns a string which at each position is the character with lowest |
92 | Returns a string which at each position is the character with lowest |
93 | ASCII code between corresponding characters in $emph text1$emphend |
93 | ASCII code between corresponding characters in $emph text1$emphend |
94 | and $emph text2$emphend. The length of the result is that of the |
94 | and $emph text2$emphend. The length of the result is that of the |
95 | shortest of the two. Masked positions are skipped. |
95 | shortest of the two. Masked positions are skipped. |
96 | <li><tt>!text occur $emph charlist$emphend in $emph text$emphend |
96 | <li><span class="tt">!text occur $emph charlist$emphend in $emph text$emphend |
97 | [mask $emph maskstring$emphend]</ |
97 | [mask $emph maskstring$emphend]</span> <br/> |
98 | Returns characters in $emph charlist$emphend which occur in |
98 | Returns characters in $emph charlist$emphend which occur in |
99 | unmasked positions in $emph text$emphend. <br/> |
99 | unmasked positions in $emph text$emphend. <br/> |
100 | (Synonymes of occur: appear, occurrence). |
100 | (Synonymes of occur: appear, occurrence). |
101 | <li><tt>!text remove $emph charlist$emphend in $emph text$emphend |
101 | <li><span class="tt">!text remove $emph charlist$emphend in $emph text$emphend |
102 | [mask $emph maskstring$emphend]</ |
102 | [mask $emph maskstring$emphend]</span> <br/> |
103 | Returns $emph text$emphend in which masked characters and characters |
103 | Returns $emph text$emphend in which masked characters and characters |
104 | appearing in $emph charlist$emphend are removed. <br/> |
104 | appearing in $emph charlist$emphend are removed. <br/> |
105 | (Synonymes of remove: drop, delete). |
105 | (Synonymes of remove: drop, delete). |
106 | <li><tt>!text reorder $emph text$emphend by $emph orderlist$emphend |
106 | <li><span class="tt">!text reorder $emph text$emphend by $emph orderlist$emphend |
107 | </ |
107 | </span> <br/> |
108 | Returns a reordered $emph text$emphend using the order list |
108 | Returns a reordered $emph text$emphend using the order list |
109 | $emph orderlist$emphend. Reordering is cyclic if $emph orderlist$emphend |
109 | $emph orderlist$emphend. Reordering is cyclic if $emph orderlist$emphend |
110 | is shorter than $emph text$emphend. <br/> |
110 | is shorter than $emph text$emphend. <br/> |
111 | $emph orderlist$emphend must be a list of n positive integers, which |
111 | $emph orderlist$emphend must be a list of n positive integers, which |
112 | is a permutation of the set {1,...,n}. If $emph orderlist$emphend contains |
112 | is a permutation of the set {1,...,n}. If $emph orderlist$emphend contains |
113 | items other than integers within the bound, empty string is returned. |
113 | items other than integers within the bound, empty string is returned. |
114 | However, unicity check is not performed on items of $emph |
114 | However, unicity check is not performed on items of $emph |
115 | orderlist$emphend. |
115 | orderlist$emphend. |
116 | <li><tt>!text repeat $emph text$emphend to $emph len$emphend |
116 | <li><span class="tt">!text repeat $emph text$emphend to $emph len$emphend |
117 | </ |
117 | </span> <br/> |
118 | Repeat the string $emph text$emphend cyclicly, up to length |
118 | Repeat the string $emph text$emphend cyclicly, up to length |
119 | $emph len$emphend. |
119 | $emph len$emphend. |
120 | <li><tt>! |
120 | <li><span class="tt">!text reverse $emph text$emphend</span> <br/> |
121 | Reverse the order of $emph text$emphend, with the last character coming |
121 | Reverse the order of $emph text$emphend, with the last character coming |
122 | first, etc. |
122 | first, etc. |
123 | <li><tt>!text select $emph charlist$emphend in $emph text$emphend |
123 | <li><span class="tt">!text select $emph charlist$emphend in $emph text$emphend |
124 | [mask $emph maskstring$emphend]</ |
124 | [mask $emph maskstring$emphend]</span> <br/> |
125 | Returns $emph text$emphend in which masked characters and characters |
125 | Returns $emph text$emphend in which masked characters and characters |
126 | not appearing in $emph charlist$emphend are removed. <br/> |
126 | not appearing in $emph charlist$emphend are removed. <br/> |
127 | (Synonymes of select: pick, pickup). |
127 | (Synonymes of select: pick, pickup). |
128 | </ul> |
128 | </ul> |
129 | 129 |