Spaces:
Runtime error
Runtime error
Update game1.py
Browse files
game1.py
CHANGED
@@ -26,25 +26,13 @@ def read1(lang, num_selected_former):
|
|
26 |
min_len = 4
|
27 |
else:
|
28 |
min_len = 2
|
29 |
-
|
30 |
-
|
31 |
-
while len(tokens) <= min_len or '\\' in text['text'] or '//' in text['text']:
|
32 |
index_selected = random.randint(0,len(content)/2-1)
|
33 |
text = eval(content[int(index_selected*2)])
|
34 |
res_tmp = [(i, 0) for i in text['text'].split(' ')]
|
35 |
res = {"original": text['text'], "interpretation": res_tmp}
|
36 |
-
|
37 |
-
|
38 |
-
# res = []
|
39 |
-
# res.append(("P", "+"))
|
40 |
-
# res.append(("/", None))
|
41 |
-
# res.append(("N", "-"))
|
42 |
-
# res.append(("Review:", None))
|
43 |
-
# for i in text['text'].split(' '):
|
44 |
-
# res.append((i, None))
|
45 |
-
# res_empty = None
|
46 |
-
# checkbox_update = gr.CheckboxGroup.update(choices=tokens, value=None)
|
47 |
-
|
48 |
return res, lang, index_selected
|
49 |
|
50 |
def read1_written(lang):
|
|
|
26 |
min_len = 4
|
27 |
else:
|
28 |
min_len = 2
|
29 |
+
|
30 |
+
while len(text['text'].split(' ')) <= min_len or '\\' in text['text'] or '//' in text['text']:
|
|
|
31 |
index_selected = random.randint(0,len(content)/2-1)
|
32 |
text = eval(content[int(index_selected*2)])
|
33 |
res_tmp = [(i, 0) for i in text['text'].split(' ')]
|
34 |
res = {"original": text['text'], "interpretation": res_tmp}
|
35 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
return res, lang, index_selected
|
37 |
|
38 |
def read1_written(lang):
|