awacke1 commited on
Commit
b304107
Β·
verified Β·
1 Parent(s): f5c1090

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +208 -1
app.py CHANGED
@@ -171,4 +171,211 @@ rhyming_words = [
171
 
172
  st.header("🎭 Top 20 Rhyming Word Pairs")
173
  for pair in rhyming_words[:20]:
174
- st.write(f"{pair[0]} - {pair[1]}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  st.header("🎭 Top 20 Rhyming Word Pairs")
173
  for pair in rhyming_words[:20]:
174
+ st.write(f"{pair[0]} - {pair[1]}")
175
+
176
+
177
+
178
+
179
+ import streamlit as st
180
+ import random
181
+ import string
182
+
183
+ st.title("Baby Gecko Learns Poetry Word Game")
184
+
185
+ # Feature 12: πŸ“š Procedural Rhymes
186
+ st.header("πŸ“š Procedural Rhymes")
187
+
188
+ rhyming_sounds = {
189
+ "ay": ["day", "play", "say", "way"],
190
+ "ee": ["see", "tree", "free", "me"],
191
+ "igh": ["high", "sky", "fly", "why"],
192
+ "ow": ["now", "cow", "how", "bow"],
193
+ "oo": ["too", "zoo", "blue", "true"],
194
+ "uck": ["luck", "duck", "truck", "stuck"],
195
+ "at": ["cat", "hat", "rat", "bat"],
196
+ "op": ["top", "pop", "hop", "stop"],
197
+ "ug": ["hug", "bug", "rug", "mug"],
198
+ "ink": ["think", "pink", "sink", "link"],
199
+ "ing": ["sing", "ring", "king", "wing"],
200
+ "ell": ["tell", "bell", "well", "sell"],
201
+ "ake": ["make", "cake", "lake", "shake"],
202
+ "ore": ["more", "store", "score", "bore"],
203
+ "ight": ["night", "light", "right", "sight"]
204
+ }
205
+
206
+ top_5_sounds = ["ay", "ee", "igh", "ow", "oo"]
207
+
208
+ st.subheader("Top 5 Rhyming Sound Endings")
209
+ for sound in top_5_sounds:
210
+ examples = ", ".join(rhyming_sounds[sound][:2])
211
+ st.write(f"Sound: {sound} | Examples: {examples}")
212
+
213
+ st.subheader("Procedural Rhyme Generator")
214
+ selected_sound = st.selectbox("Select a rhyming sound ending:", list(rhyming_sounds.keys()))
215
+ num_lines = st.number_input("Enter the number of lines for the rhyme:", min_value=1, max_value=10, value=4, step=1)
216
+
217
+ if st.button("Generate Rhyme"):
218
+ rhyme_lines = []
219
+ for _ in range(num_lines):
220
+ rhyme_word = random.choice(rhyming_sounds[selected_sound])
221
+ rhyme_lines.append(rhyme_word)
222
+
223
+ st.subheader("Generated Rhyme")
224
+ st.write("\n".join(rhyme_lines))
225
+
226
+ st.subheader("Reference Rhyming Word Sounds")
227
+ for sound, words in rhyming_sounds.items():
228
+ examples = ", ".join(words[:2])
229
+ st.write(f"Sound: {sound} | Examples: {examples}")
230
+
231
+
232
+ import streamlit as st
233
+ import random
234
+ import string
235
+
236
+ st.title("Baby Gecko Learns Poetry Word Game")
237
+
238
+ # Feature 12: πŸ“š Procedural Rhymes
239
+ st.header("πŸ“š Procedural Rhymes")
240
+
241
+ rhyming_sounds = {
242
+ "ay": ["day", "play", "say", "way"],
243
+ "ee": ["see", "tree", "free", "me"],
244
+ "igh": ["high", "sky", "fly", "why"],
245
+ "ow": ["now", "cow", "how", "bow"],
246
+ "oo": ["too", "zoo", "blue", "true"],
247
+ "uck": ["luck", "duck", "truck", "stuck"],
248
+ "at": ["cat", "hat", "rat", "bat"],
249
+ "op": ["top", "pop", "hop", "stop"],
250
+ "ug": ["hug", "bug", "rug", "mug"],
251
+ "ink": ["think", "pink", "sink", "link"],
252
+ "ing": ["sing", "ring", "king", "wing"],
253
+ "ell": ["tell", "bell", "well", "sell"],
254
+ "ake": ["make", "cake", "lake", "shake"],
255
+ "ore": ["more", "store", "score", "bore"],
256
+ "ight": ["night", "light", "right", "sight"]
257
+ }
258
+
259
+ top_5_sounds = ["ay", "ee", "igh", "ow", "oo"]
260
+
261
+ st.subheader("Top 5 Rhyming Sound Endings")
262
+ for sound in top_5_sounds:
263
+ examples = ", ".join(rhyming_sounds[sound][:2])
264
+ st.write(f"Sound: {sound} | Examples: {examples}")
265
+
266
+ st.subheader("Procedural Rhyme Generator")
267
+ selected_sound = st.selectbox("Select a rhyming sound ending:", list(rhyming_sounds.keys()))
268
+ num_lines = st.number_input("Enter the number of lines for the rhyme:", min_value=1, max_value=10, value=4, step=1)
269
+
270
+ if st.button("Generate Rhyme"):
271
+ rhyme_lines = []
272
+ for _ in range(num_lines):
273
+ rhyme_word = random.choice(rhyming_sounds[selected_sound])
274
+ rhyme_lines.append(rhyme_word)
275
+
276
+ st.subheader("Generated Rhyme")
277
+ st.write("\n".join(rhyme_lines))
278
+
279
+ st.subheader("Reference Rhyming Word Sounds")
280
+ for sound, words in rhyming_sounds.items():
281
+ examples = ", ".join(words[:2])
282
+ st.write(f"Sound: {sound} | Examples: {examples}")
283
+
284
+ # Feature 13: πŸ“œ Sentence Structures
285
+ st.header("πŸ“œ Sentence Structures")
286
+
287
+ sentence_structures = [
288
+ "The [adjective] [noun] [verb] [adverb].",
289
+ "[Noun] [verb] [preposition] the [adjective] [noun].",
290
+ "[Adverb], the [noun] [verb] [preposition] the [noun].",
291
+ "In the [noun], [noun] [verb] [adverb]."
292
+ ]
293
+
294
+ st.subheader("Example Sentence Structures")
295
+ for structure in sentence_structures:
296
+ st.write(structure)
297
+
298
+ st.subheader("Procedural Poetry Generator")
299
+ selected_structure = st.selectbox("Select a sentence structure:", sentence_structures)
300
+
301
+ if st.button("Generate Poetry"):
302
+ poetry_lines = []
303
+ for _ in range(4):
304
+ line = selected_structure
305
+ line = line.replace("[adjective]", random.choice(["happy", "shiny", "graceful", "gentle"]))
306
+ line = line.replace("[noun]", random.choice(["gecko", "butterfly", "rainbow", "breeze"]))
307
+ line = line.replace("[verb]", random.choice(["dances", "sings", "glides", "whispers"]))
308
+ line = line.replace("[adverb]", random.choice(["joyfully", "softly", "elegantly", "quietly"]))
309
+ line = line.replace("[preposition]", random.choice(["on", "under", "above", "through"]))
310
+ poetry_lines.append(line)
311
+
312
+ st.subheader("Generated Poetry")
313
+ st.write("\n".join(poetry_lines))
314
+
315
+ # Feature 14: πŸ“š Rhyming Word Lists for Graphic Novels
316
+ st.header("πŸ“š Rhyming Word Lists for Graphic Novels")
317
+
318
+ graphic_novel_rhymes = {
319
+ "Adventure": ["quest", "best", "test", "west"],
320
+ "Mystery": ["clue", "true", "new", "who"],
321
+ "Fantasy": ["dream", "gleam", "scheme", "supreme"],
322
+ "Science Fiction": ["space", "race", "place", "chase"],
323
+ "Romance": ["heart", "start", "art", "part"]
324
+ }
325
+
326
+ st.subheader("Rhyming Word Lists")
327
+ for genre, words in graphic_novel_rhymes.items():
328
+ st.write(f"{genre}: {', '.join(words)}")
329
+
330
+ import streamlit as st
331
+ import random
332
+ import string
333
+
334
+ st.title("Baby Gecko Learns Poetry Word Game")
335
+
336
+ # ... (previous code remains the same) ...
337
+
338
+ # Feature 15: πŸ“š Story Generator
339
+ st.header("πŸ“š Story Generator")
340
+
341
+ story_parts = {
342
+ "beginning": [
343
+ "In the realm of [noun], where [adjective] [noun_plural] roam, a [adjective] [noun] embarks on an epic journey.",
344
+ "Amidst the [adjective] [noun], a [noun] of unparalleled [noun] emerges, seeking to [verb] the world.",
345
+ "In a world fraught with [noun], a [adjective] [noun] arises, determined to [verb] the forces of [noun]."
346
+ ],
347
+ "middle": [
348
+ "Endowed with [adjective] [noun], the [noun] [verb_past] through the [adjective] [noun], encountering [noun_plural] and [noun_plural].",
349
+ "With [noun] as their guide, the [noun] [verb_past] the [adjective] [noun], unraveling the secrets of [noun].",
350
+ "Confronted by the [adjective] [noun], the [noun] must [verb] their [noun] and [verb] the [adjective] [noun]."
351
+ ],
352
+ "end": [
353
+ "In a climactic battle of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], emerging [adjective] and [adjective].",
354
+ "With the power of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], ushering in an era of [noun] and [noun].",
355
+ "Forever changed by their [adjective] journey, the [noun] [verb_past] home, their [noun] forever etched in the annals of [noun]."
356
+ ]
357
+ }
358
+
359
+ vocabulary = {
360
+ "noun": ["quintessence", "paradigm", "phenomenon", "cognizance", "providence", "iniquity", "juxtaposition", "obfuscation", "rescission", "volition"],
361
+ "noun_plural": ["axioms", "dichotomies", "ephemera", "hermeneutics", "ontologies", "paradoxes", "semiotics", "tautologies", "vicissitudes", "zeitgeists"],
362
+ "adjective": ["abstruse", "Byzantine", "chimerical", "draconian", "ephemeral", "inexorable", "labyrinthine", "mercurial", "quixotic", "turgid"],
363
+ "verb": ["amalgamate", "bifurcate", "coalesce", "deconstruct", "extrapolate", "juxtapose", "metamorphose", "obfuscate", "reify", "transmogrify"],
364
+ "verb_past": ["amalgamated", "bifurcated", "coalesced", "deconstructed", "extrapolated", "juxtaposed", "metamorphosed", "obfuscated", "reified", "transmogrified"]
365
+ }
366
+
367
+ story_structure = ["beginning", "middle", "end"]
368
+
369
+ if st.button("Generate Story"):
370
+ story_paragraphs = []
371
+ for part in story_structure:
372
+ paragraph = []
373
+ for _ in range(3):
374
+ sentence = random.choice(story_parts[part])
375
+ for word_type in ["noun", "noun_plural", "adjective", "verb", "verb_past"]:
376
+ sentence = sentence.replace(f"[{word_type}]", random.choice(vocabulary[word_type]))
377
+ paragraph.append(sentence)
378
+ story_paragraphs.append(" ".join(paragraph))
379
+
380
+ st.subheader("Generated Story")
381
+ st.write("\n\n".join(story_paragraphs))