Spaces:
Runtime error
Runtime error
anonymousauthors
commited on
Commit
β’
b00878a
1
Parent(s):
3e701f9
Upload 3 files
Browse files
pages/0_π_Dictionary_(Search).py
CHANGED
@@ -87,8 +87,11 @@ if title in datas:
|
|
87 |
|
88 |
def present_sl_task(secret_language_by_task, task):
|
89 |
all_sl = sorted(secret_language_by_task[task])
|
|
|
90 |
for i in range(len(all_sl)):
|
91 |
-
all_sl[i]
|
|
|
|
|
92 |
st.markdown(
|
93 |
f':red[{len(all_sl)}] secret languages of :blue[{title}] on {task.replace("paraphrase", "Paraphrase")}',
|
94 |
unsafe_allow_html=True)
|
|
|
87 |
|
88 |
def present_sl_task(secret_language_by_task, task):
|
89 |
all_sl = sorted(secret_language_by_task[task])
|
90 |
+
new_all_sl = []
|
91 |
for i in range(len(all_sl)):
|
92 |
+
if all_sl[i] != '':
|
93 |
+
new_all_sl.append(all_sl[i].replace("\n", "/n").strip())
|
94 |
+
all_sl = sorted(new_all_sl)
|
95 |
st.markdown(
|
96 |
f':red[{len(all_sl)}] secret languages of :blue[{title}] on {task.replace("paraphrase", "Paraphrase")}',
|
97 |
unsafe_allow_html=True)
|
pages/1_π_Dictionary_(Browse).py
CHANGED
@@ -102,9 +102,11 @@ all_word_button = {}
|
|
102 |
# st.session_state.click_word = key
|
103 |
# switch_page("dictionary (search)")
|
104 |
for k in st.session_state.keys():
|
105 |
-
if
|
106 |
-
|
107 |
-
|
|
|
|
|
108 |
|
109 |
# all_condition = False
|
110 |
word_buttons = None
|
@@ -134,7 +136,7 @@ for k in buttons:
|
|
134 |
# st.markdown(file_name, unsafe_allow_html=True)
|
135 |
# st.markdown(_data.keys(), unsafe_allow_html=True)
|
136 |
|
137 |
-
all_key = list(set(all_key))
|
138 |
# st.markdown(','.join(all_key))
|
139 |
for key in all_key:
|
140 |
# if len(key) and key[0] != '"':
|
@@ -147,6 +149,7 @@ for k in buttons:
|
|
147 |
# all_word_button[key] = button(f'{key}', key=key)
|
148 |
|
149 |
|
|
|
150 |
# for _button in word_buttons:
|
151 |
# if _button:
|
152 |
# # st.session_state.click_word = key
|
|
|
102 |
# st.session_state.click_word = key
|
103 |
# switch_page("dictionary (search)")
|
104 |
for k in st.session_state.keys():
|
105 |
+
if st.session_state[k]:
|
106 |
+
if 'button_' in k:
|
107 |
+
st.session_state.click_word = k.split('button_')[-1]
|
108 |
+
# st.markdown(k)
|
109 |
+
switch_page("dictionary (search)")
|
110 |
|
111 |
# all_condition = False
|
112 |
word_buttons = None
|
|
|
136 |
# st.markdown(file_name, unsafe_allow_html=True)
|
137 |
# st.markdown(_data.keys(), unsafe_allow_html=True)
|
138 |
|
139 |
+
all_key = sorted(list(set(all_key)))
|
140 |
# st.markdown(','.join(all_key))
|
141 |
for key in all_key:
|
142 |
# if len(key) and key[0] != '"':
|
|
|
149 |
# all_word_button[key] = button(f'{key}', key=key)
|
150 |
|
151 |
|
152 |
+
|
153 |
# for _button in word_buttons:
|
154 |
# if _button:
|
155 |
# # st.session_state.click_word = key
|