Rev 13477 | Rev 13715 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 13477 | Rev 13704 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | textarea="data" |
2 | textarea="data" |
3 | 3 | ||
4 | : |
4 | :Classify all words of a sentence according to an attribute (for example their nature). |
5 |
|
5 | This exercise differs from other classification exercises in the way the data is entered, |
6 |
|
6 | the data being a sentence and not a list of words. |
7 | <p class="wims_credits"> |
7 | <p class="wims_credits"> |
8 | Author of the model: Bernadette Perrin-Riou <bpr@math.u-psud.fr> |
8 | Author of the model: Bernadette Perrin-Riou <bpr@math.u-psud.fr> |
9 | </p> |
9 | </p> |
10 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
10 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
11 | 11 | ||
12 | Remove the above header if you destroy the model tags! (The lines starting |
12 | Remove the above header if you destroy the model tags! (The lines starting |
13 | with a ':'.) Otherwise the exercise might not be taken back by Createxo. |
13 | with a ':'.) Otherwise the exercise might not be taken back by Createxo. |
14 | 14 | ||
15 | :%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%% |
15 | :%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%% |
16 | :\title{ |
16 | :\title{Categorize the words of a sentence} |
17 | :\author{Bernadette, Perrin-Riou} |
17 | :\author{Bernadette, Perrin-Riou} |
18 | :\email{} |
18 | :\email{} |
19 | :\credits{} |
19 | :\credits{} |
20 | 20 | ||
21 | :Instructions |
21 | :Instructions |
22 | \text{ |
22 | \text{instruction=Classify words of the sentence according to their nature or properties} |
23 | 23 | ||
24 | :File name |
24 | :File name |
25 |
|
25 | Fill only if you want to transfer the source of this exercise |
26 |
|
26 | to a Modtool account and use a data file (in an OEF module) of the type |
27 | du type |
- | |
28 | <pre> |
27 | <pre> |
29 | V,N,Art,Adj,Prep |
28 | V,N,Art,Adj,Prep |
30 |
|
29 | Verb, name, article, adjective, preposition |
31 | : |
30 | :The|Art,little|Adj,cat|N,drinks|V,milk.|N |
32 | : |
31 | :The|Art,cat|N,drinks|V,milk|N,in|Prep,a|Art,bowl.|N |
33 | </pre> |
32 | </pre> |
34 |
|
33 | In this case, the main data will not be taken into account. |
35 |
|
34 | Otherwise, fill in the main data. |
36 | 35 | ||
37 | \text{file=} |
36 | \text{file=} |
38 | 37 | ||
39 | :Nature |
38 | :Nature of objects |
40 | \text{ |
39 | \text{nom_nature=verb, name, article, adjective, preposition} |
41 | 40 | ||
42 | :Nature |
41 | :Nature of words (code) |
43 |
|
42 | This code will be used in the main data. |
44 | \text{Nature=V,N,Art,Adj,Prep} |
43 | \text{Nature=V,N,Art,Adj,Prep} |
45 | 44 | ||
46 | :Main data |
45 | :Main data |
47 |
|
46 | One sentence per line: The words (or groups of words) in the sentence are separated by commas. |
- | 47 | After each word, separated from the word by the vertical bar, |
|
48 |
|
48 | is written the nature or attribute of the word as it was written |
49 |
|
49 | in the field <span class="tt">Nature of words (code)</span>. |
50 |
|
50 | If the word (or group of words) is not followed by a vertical bar |
51 |
|
51 | and an attribute, it is not proposed in the list of words to be placed, |
52 |
|
52 | but is written in the introductory sentence. |
53 | 53 | ||
54 | \text{ |
54 | \text{data=The|Art,little|Adj,cat|N,drinks|V,milk.|N |
55 |
|
55 | The|Art,cat|N,drinks|V,milk|N,in|Prep,a|Art,bowl.|N} |
56 | Le,chat|N,boit|V,du,lait|N,dans|Prep,un,bol|N} |
- | |
57 | 56 | ||
58 | :Embraced random items |
57 | :Embraced random items |
59 | $embraced_randitem |
58 | $embraced_randitem |
60 | \text{accolade=item(1,1 yes, |
59 | \text{accolade=item(1,1 yes, |
61 | 2 no)} |
60 | 2 no)} |
62 | 61 | ||
63 | :%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%% |
62 | :%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%% |
64 | \css{<style |
63 | \css{<style> |
65 | .question {background-color: |
64 | .question {background-color: #FFC;margin: 2% 2%;padding: 1%;} |
66 | .reponse {background-color: |
65 | .reponse {background-color: #FC9;color: black;margin: 2% 2%;padding: 0;} |
67 | .oefstatement{} |
- | |
68 | ol li {list-style: upper-alpha; |
66 | ol li {list-style: upper-alpha;} |
69 |
|
67 | </style>} |
70 |
|
68 | ##if a file name exist, use the file, otherwise use data |
71 | \if{\file notsametext}{ |
69 | \if{\file notsametext}{ |
72 | \text{data=wims(randrecord \file)} |
70 | \text{data=wims(randrecord \file)} |
73 | \text{Nature=wims(record 0 of \file)} |
71 | \text{Nature=wims(record 0 of \file)} |
74 | \text{nom_nature=row(2,\Nature)} |
72 | \text{nom_nature=row(2,\Nature)} |
75 | \text{Nature=row(1,\Nature)} |
73 | \text{Nature=row(1,\Nature)} |
76 |
|
74 | }{ |
77 | \text{data=randomrow(\data)} |
75 | \text{data=randomrow(\data)} |
78 |
|
76 | } |
79 | \text{accolade=wims(word 1 of \accolade)} |
77 | \text{accolade=wims(word 1 of \accolade)} |
80 | 78 | ||
81 | \text{data=\accolade=1 ? wims(embraced randitem \data)} |
79 | \text{data=\accolade=1 ? wims(embraced randitem \data)} |
82 | \integer{cnt=items(\data)} |
80 | \integer{cnt=items(\data)} |
83 | \integer{Nat_cnt=items(\Nature)} |
81 | \integer{Nat_cnt=items(\Nature)} |
Line 115... | Line 113... | ||
115 | } |
113 | } |
116 | \integer{question_cnt=items(\question)} |
114 | \integer{question_cnt=items(\question)} |
117 | \steps{\Step} |
115 | \steps{\Step} |
118 | 116 | ||
119 | \statement{\instruction |
117 | \statement{\instruction |
120 | <div class="question">\phrase |
118 | <div class="question">\phrase</div> |
121 | <table class="wimsnoborder"> |
119 | <table class="wimsnoborder"> |
122 | \for{ s = 1 to \question_cnt}{ |
120 | \for{ s = 1 to \question_cnt}{ |
123 | <tr><th>\nom_question[\s]</th><td>\embed{\Step[\s],80 x 30 x \cnt}</td></tr> |
121 | <tr><th>\nom_question[\s]</th><td>\embed{\Step[\s],80 x 30 x \cnt}</td></tr> |
124 | } |
122 | } |
125 | </table> |
123 | </table> |