schlenker commited on
Commit
727a88b
·
1 Parent(s): 9c249dc

Include WN relations

Browse files
Files changed (1) hide show
  1. app.py +31 -16
app.py CHANGED
@@ -188,21 +188,24 @@ def get_available_cues(target):
188
  if st.session_state.actions[-1] == 'cue':
189
  guessed = False
190
  write_bot('What do you want to see?', remember=False, blink=False)
191
- # JS
192
- word_count = st.session_state.counters["word_count"]
193
- target = st.session_state.results["results"][word_count]
194
- if get_available_cues(target):
195
- avail_cues = get_available_cues(target)
196
- cues_buttons = []
197
- for cue_type, cues in avail_cues.items():
198
- st.button(cue_type)
199
-
200
- b1 = st.button("Next letter", key="1")
201
- b2 = st.button("Next word", key="2")
202
- b3 = st.button("All words", key="3")
203
- b4 = st.button("I remembered the word!", key="4", type='primary')
204
- b5 = st.button("Exit", key="5", type='primary')
205
  while guessed == False:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  if b1:
207
  st.session_state.counters["letter_count"] += 1
208
  word_count = st.session_state.counters["word_count"]
@@ -214,8 +217,20 @@ if st.session_state.actions[-1] == 'cue':
214
  letter_count = st.session_state.counters["letter_count"]
215
  st.session_state.counters["word_count"] += 1
216
  word_count = st.session_state.counters["word_count"]
217
- write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}', remember=False)
218
-
 
 
 
 
 
 
 
 
 
 
 
 
219
  elif b3:
220
  write_bot(f"Here are all my guesses about your word: {st.session_state.results['results_print']}")
221
 
 
188
  if st.session_state.actions[-1] == 'cue':
189
  guessed = False
190
  write_bot('What do you want to see?', remember=False, blink=False)
191
+
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  while guessed == False:
193
+ b1 = st.button("Next letter", key="1")
194
+ b2 = st.button("Next word", key="2")
195
+
196
+ # JS
197
+ word_count = st.session_state.counters["word_count"]
198
+ target = st.session_state.results["results"][word_count]
199
+ if get_available_cues(target):
200
+ avail_cues = get_available_cues(target)
201
+ cues_buttons = []
202
+ for cue_type, cues in avail_cues.items():
203
+ st.button(cue_type)
204
+
205
+ b3 = st.button("All words", key="3")
206
+ b4 = st.button("I remembered the word!", key="4", type='primary')
207
+ b5 = st.button("Exit", key="5", type='primary')
208
+
209
  if b1:
210
  st.session_state.counters["letter_count"] += 1
211
  word_count = st.session_state.counters["word_count"]
 
217
  letter_count = st.session_state.counters["letter_count"]
218
  st.session_state.counters["word_count"] += 1
219
  word_count = st.session_state.counters["word_count"]
220
+ write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}', remember=False)
221
+
222
+ elif st.button('Synonyms'):
223
+ write_bot(f'Here are synonyms for the current word: {avail_cues["Synonyms"]}', remember=False)
224
+
225
+ elif st.button('Hypernyms'):
226
+ write_bot(f'Here are hypernyms for the current word: {avail_cues["Hypernyms"]}', remember=False)
227
+
228
+ elif st.button('Hyponyms'):
229
+ write_bot(f'Here are hyponyms for the current word: {avail_cues["Hyponyms"]}', remember=False)
230
+
231
+ elif st.button('Examples'):
232
+ write_bot(f'Here are example contexts for the current word: {avail_cues["Examples"]}', remember=False)
233
+
234
  elif b3:
235
  write_bot(f"Here are all my guesses about your word: {st.session_state.results['results_print']}")
236