Feature: Random Text Generation with AI / API #66#76
Merged
FOSSCLUB-LBSITW merged 2 commits intoMar 13, 2026
Merged
Conversation
Owner
|
hey!there is some merge conflict here. Please resolve it as soon as possible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Brief description of what this PR does.
Adds a template-based random text generator using a local word bank of 200+
common English words organized by category (nouns, verbs, adjectives, adverbs,
connectors, prepositions, determiners). Sixteen sentence templates produce
grammatically sensible but completely unpredictable text, eliminating the
memorization problem with static sentences.
Users can switch between "Random Generated" and "Classic Static" modes
via a new dropdown in the settings panel.
🔗 Related Issue
Closes: #66
Combinatorial Analysis
Per-sentence combinations:
16 × 73 × 53 × 41 × 26 × 23 × 20 × 15= ~232 billion unique sentences
For a "Long Text" (7-10 sentences), the combinations are astronomically large —
memorization is effectively impossible.
Changes Made
New Components
WORD_BANK(dict)SENTENCE_TEMPLATES(list){placeholders}generate_sentence()generate_text(mode)STATIC_TEXT_POOLSTEXT_POOLS— the original static texts preservedTEXT_SOURCE_OPTIONS["Random Generated", "Classic Static"]self.text_source_varself.text_source_menuCTkOptionMenuin settings frame (row 1)self.get_test_text()Modified Components
self.settings_framebegin_test()self.get_test_text()instead of directly accessing poolstart_test()self.text_source_menuduring testcheck_result()self.text_source_menuon completion750×720→780×750(fits extra settings row)680×120→700×130(slightly larger for longer generated text)660→680(proportional)No Changes To
calculate_current_wpm()— unchangedupdate_live_wpm()— unchangedupdate_timer()— unchangedtoggle_pause()— unchangedhandle_typing()— unchangedupdate_sentence_display()— unchangedupdate_streaks()— unchangedload_data()/save_data()— unchangedstreak_data.jsonschema — unchangedbeep()wrapper — unchangedDURATION_OPTIONS— unchangedTEXT_LENGTH_OPTIONS— unchanged📷 Screenshots (if applicable)
✅ Checklist