Subversion Repositories wimsdev

Rev

Rev 4158 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if $wims_read_parm!=slib_header
2
 !goto proc
3
!endif
4
slib_title=For marking words with mistake
5
slib_parms=1\
6
,the input text (embedding delimiter: `??false_word|bon??' no coma or semi-column between the ??)
7
slib_author=Bernadette PERRIN-RIOU
8
slib_out= a matrix :\
9
   position of the false_word in the sentence ; Text output with comas beetween words;\
10
list of good answers;number of words in the sentence
11
 
12
slib_comment=<b>Preliminary version subject to further change, user with care!</b>\
13
the two first lines can be use directly as the answer with type=mark.
14
slib_example= The ball is ??rond|round?? and ??gren|green??.\
15
??They bal|The ball?? is ??raid|red?? and green.\
16
??The ball?? is ??raid|red?? and green.
17
!exit
18
 
19
:proc
20
 
21
slib_texte=!lines2words $wims_read_parm
22
slib_texte= !embraced randitem $slib_texte
23
slib_texte=!rows2lines $slib_texte
24
slib_texte=!replace internal $\
25
$ by &#59; in $slib_texte
26
slib_texte=!replace internal ?? by ; in $slib_texte
27
 
28
slib_cntrow=!rowcnt $slib_texte
29
slib_TEXTE=
30
slib_rep=
31
slib_cnt=0
32
slib_JUSTE=
33
slib_texte=!replace internal , by &#44; in $slib_texte
34
!for slib_i= 1 to $slib_cntrow
35
  slib_H = !row $slib_i of $slib_texte
36
  slib_cnt_w=!wordcnt $slib_H
37
  slib_k=$[$slib_i%2]
38
  !if $slib_k = 0
39
    slib_faux=!replace internal | by , in $slib_H
40
    !distribute items $slib_faux into slib_H,slib_juste
41
    !if $slib_juste=
42
      slib_JUSTE = !append item slib_ZZZZZ to $slib_JUSTE
43
    !else
44
      slib_JUSTE = !append item $slib_juste to $slib_JUSTE
45
    !endif
46
  !endif
47
  slib_cnt_w=!wordcnt $slib_H
48
  !if $slib_k = 0
49
    slib_rep1 = !values $slib_cnt + x for x=1 to $slib_cnt_w
50
    slib_rep  = !append item $slib_rep1 to $slib_rep
51
  !endif
52
  slib_cnt= $[$slib_cnt+$slib_cnt_w]
53
  slib_HH = !words2items $slib_H
54
  slib_TEXTE = !append item $slib_HH to $slib_TEXTE
55
!next slib_i
56
slib_rep=!nonempty items $slib_rep
57
 
58
slib_TEXTE = !nonempty items $slib_TEXTE
59
slib_JUSTE = !replace internal slib_ZZZZZ by in $slib_JUSTE
60
 
61
slib_out= $slib_rep;$slib_TEXTE;$slib_JUSTE;$slib_cnt
62