Subversion Repositories wimsdev

Rev

Rev 397 | Rev 4158 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
397 bpr 1
!if $wims_read_parm!=slib_header
2
 !goto proc
3
!endif
894 bpr 4
slib_title=For marking  some words with given explanation
5
slib_parms=1\
6
the input text (embedding delimiter: `??')
397 bpr 7
slib_author=Bernadette PERRIN-RIOU
8
slib_out= position of words embedded in text by  ?? ?? (without the joker)\
9
amongst all the groups of the form ?? ?? (one line by embedding);\
10
[position in the text of the ?? ??];\
11
Text output with comas ;\
12
list of explanations (one by groups of words);\
13
number of words
14
slib_comment=for use in answer with type=mark ; \
15
one line by answer (see markword if all the words must be treated in one question).\
16
only the words with ??etc ?? or ??@_etc ?? are taken in account
17
slib_example= Je??@_??mange??_|article+nom??une??@_??pomme que j'ai??@_??cueillie sur un??_|article + nom??arbre
18
!exit
19
 
20
:proc
21
 
22
slib_texte=!lines2words $wims_read_parm
23
slib_texte=!singlespace $slib_texte
24
slib_texte= !embraced randitem $slib_texte
25
slib_texte=!rows2lines $slib_texte
26
slib_texte=!replace internal $\
27
$ by &#59; in $slib_texte
28
slib_texte=!replace internal ?? by ; in $slib_texte
29
 
30
slib_cntrow=!rowcnt $slib_texte
31
slib_TEXTE=
32
slib_rep=
33
slib_mark=
34
slib_cnt=0
35
slib_cnt_mark=0
36
slib_JUSTE=
37
slib_texte=!replace internal , by , in $slib_texte
38
slib_texte=!replace internal ( by ( in $slib_texte
39
slib_texte=!replace internal ) by ) in $slib_texte
40
!for slib_i= 1 to $slib_cntrow
41
  slib_H = !row $slib_i of $slib_texte
42
  slib_k=$[$slib_i%2]
43
  !if $slib_k = 0
894 bpr 44
   slib_H=!replace internal $ $ by     in $slib_H
45
  !endif
46
  slib_cnt_w=!wordcnt $slib_H
47
  !if $slib_k = 0
397 bpr 48
    slib_faux=!replace internal | by , in $slib_H
49
    !distribute items $slib_faux into slib_H,slib_juste
50
    !if $slib_juste=
51
      slib_JUSTE = !append item slib_ZZZZZ to $slib_JUSTE
52
    !else
53
      slib_JUSTE = !append item $slib_juste to $slib_JUSTE
54
    !endif
55
  !endif
56
  slib_cnt_w=!wordcnt $slib_H
57
  !if $slib_k = 0
58
    slib_rep1 = !values $slib_cnt + x for x=1 to $slib_cnt_w
59
    slib_mark  = !append line $slib_rep1 to $slib_mark
60
    !if @_ notin $slib_H
61
     slib_rep1 = !values $slib_cnt_mark + x for x=1 to $slib_cnt_w
62
     slib_rep  = !append line $slib_rep1 to $slib_rep
63
    !endif
64
    slib_cnt_mark=$[$slib_cnt_mark + $slib_cnt_w]
65
    slib_HH = !words2items $slib_H
66
    slib_cnt= $[$slib_cnt+1]
67
  !else
68
    slib_HH = $slib_H
69
    slib_cnt= $[$slib_cnt+1]
70
  !endif
71
 
72
  slib_TEXTE = !append item $slib_HH to $slib_TEXTE
73
!next slib_i
74
slib_rep=!nonempty items $slib_rep
75
slib_mark=!nonempty lines $slib_mark
76
 
77
slib_TEXTE = !replace internal @_ by in $slib_TEXTE
78
slib_JUSTE = !replace internal slib_ZZZZZ by in $slib_JUSTE
79
 
80
slib_out= $slib_rep;[$slib_mark];$slib_TEXTE;$slib_JUSTE;$slib_cnt