Create level-appropriate example sentences for a word list
Generate a level-appropriate vocabulary example sentence table from a 20-word list. Check target word presence and order with a Python script.
Relying solely on bilingual dictionary definitions makes it difficult to understand how words function in natural sentence structures. While asking language models to write example sentences provides quick context, unrestricted generation often omits target words, substitutes complex inflections, or inserts advanced academic vocabulary that distracts from the core learning objective.
Feed a curated list of 20 intermediate vocabulary words to the model, constrain surrounding vocabulary to beginner levels, and verify the resulting table with a Python validation script. This validation process shares the same verification approach used in glossary consistency check.
[1] Prepare the target vocabulary list in a plain text file. Here are 20 intermediate headwords that learners frequently need to practice.
1. anticipate2. collaborate3. durable4. evaluate5. feasible6. hesitate7. incentive8. mandatory9. negotiate10. obsolete11. plausible12. redundant13. scrutiny14. tentative15. undermine16. versatile17. withstand18. yield19. compensate20. deteriorate[2] Construct the prompt template. Apply the core principles from the Google Prompting Strategies Guide: provide clear and specific instructions, and specify the output structure. Constrain surrounding vocabulary to elementary levels (CEFR A2-B1) and require a strict Markdown table output.
Create a vocabulary learning table for the following 20 English words. [Word List]{word_list} [Rules]1. Include all 20 words in the exact numbered order without skipping any word.2. Difficulty level: Except for the target word, use only simple, everyday vocabulary (CEFR A2-B1 level) and clear sentence structures. Avoid obscure idioms or complex jargon so the learner can easily grasp the usage.3. Word presence: Each example sentence must clearly contain the target word (base form or natural inflected form).4. Output format: Output strictly as a Markdown table. Do not include any introductory remarks, explanations, or conclusions.5. Columns: | No | Word | Definition | Example Sentence | Simple Meaning Note |[3] Populate the template with the word list and execute it using Gemini.
$ agy -p "$(cat run/en.1.prompt.txt)" --model gemini-3.8-flash --effort high --output-format text > run/en.1.out.txt$ cat run/en.1.out.txt| No | Word | Definition | Example Sentence | Simple Meaning Note ||---|---|---|---|---|| 1 | anticipate | to expect or look forward to something before it happens | We anticipate that many people will come to the party tonight. | expect / guess in advance || 2 | collaborate | to work together with someone to achieve a goal | Two teams will collaborate to finish the science project on time. | work together || 3 | durable | able to last a long time without breaking | These shoes are durable, so you can wear them every day. | strong and long-lasting |…| 19 | compensate | to pay someone for their work or for a loss | The store will compensate you for the broken item with a new one. | pay back / make up for || 20 | deteriorate | to become worse over time | If you leave the fruit in the sun, it will deteriorate quickly. | get worse / break down |The output yields all 20 words organized into five structured columns. Surrounding words such as science project, shoes, and broken item remain within everyday conversational range.
[4] Write a verification script to audit the output table. The script verifies that the row count matches words.txt, headwords appear in sequential order without duplicates, and each example sentence contains the target word or one of its listed forms (-s, -es, -d/-ed, -ing, -ies/-ied, and the irregular withstood; any other form counts as missing). It cannot tell whether a sentence is natural, uses the intended meaning, or is at the right vocabulary level.
#!/usr/bin/env python3"""usage: check.py words.txt out.txt [ko|en]Per row: word column equals the word list (same order, no duplicates), and the example sentencecontains the word or one of its listed forms (-s, -es, -d/-ed, -ing, -ies/-ied, irregulars)."""import sys, re MSG = { "ko": ("행 수 불일치: 기대 {a}행, 실제 {b}행", "누락 {i}: {w}", "단어 불일치 {i}: 기대 {w}, 실제 {a}", "중복 단어 {i}: {w}", "예문 단어 누락 {i}: {w} not in {e!r}", "{n}개 행 검증, 오류 {k}건"), "en": ("Row count mismatch: expected {a}, got {b}", "Missing {i}: {w}", "Word mismatch {i}: expected {w}, got {a}", "Duplicate word {i}: {w}", "Target word missing {i}: {w} not in {e!r}", "Verified {n} rows, {k} errors"),}IRREGULAR = {"withstand": ["withstood"]} def forms(w): f = {w, w + "s", w + "es"} f |= {w + "d", w[:-1] + "ing"} if w.endswith("e") else {w + "ed", w + "ing"} if w.endswith("y") and w[-2] not in "aeiou": f |= {w[:-1] + "ies", w[:-1] + "ied"} return f | set(IRREGULAR.get(w, [])) if len(sys.argv) < 3: sys.exit(__doc__)t = MSG[sys.argv[3] if len(sys.argv) > 3 else "en"]words = [re.sub(r'^\d+\.\s*', '', l).strip().lower() for l in open(sys.argv[1], encoding='utf-8') if l.strip()]lines = [l.strip() for l in open(sys.argv[2], encoding='utf-8') if l.strip().startswith('|')]rows = [[c.strip() for c in l.strip('|').split('|')] for l in lines if not set(l) <= set('|-: ')]header, rows = rows[0], rows[1:] w_col = next(i for i, c in enumerate(header) if '단어' in c.lower() or 'word' in c.lower())e_col = next(i for i, c in enumerate(header) if '예문' in c.lower() or 'example' in c.lower()) errs = []if len(rows) != len(words): errs.append(t[0].format(a=len(words), b=len(rows))) seen = set()for idx, exp in enumerate(words): if idx >= len(rows): errs.append(t[1].format(i=idx + 1, w=exp)) continue row = rows[idx] act = (re.search(r'[A-Za-z]+', row[w_col]) or [''])[0].lower() if act != exp: errs.append(t[2].format(i=idx + 1, w=exp, a=act)) if act in seen: errs.append(t[3].format(i=idx + 1, w=act)) seen.add(act) ex = row[e_col] pat = r'\b(?:' + '|'.join(re.escape(f) for f in sorted(forms(exp))) + r')\b' if not re.search(pat, ex, re.I): errs.append(t[4].format(i=idx + 1, w=exp, e=ex)) print(t[5].format(n=len(rows), k=len(errs)))for e in errs: print(" ", e)sys.exit(1 if errs else 0)[5] Run the verification script against en.1.out.txt.
$ python3 run/check.py run/words.txt run/en.1.out.txt enVerified 20 rows, 0 errorsAll 20 words are in the required order and each example contains the target word or an allowed form, so the exit code is 0. The second run, en.2.out.txt, gave the same result (2 of 2 passed).
[6] The gaps in the script were tested with 4 hand-made inputs (not model output). bad.1.en.out.txt changes the row 5 example so it no longer contains feasible, and replaces the row 14 word with collaborate; the Korean-edition files bad.2.out.txt (row 20 deleted) and bad.3.out.txt (anticipate altered to the truncated anticipat) were also run. All 3 exited with code 1. A fourth input, ok.withstood.out.txt, uses the correct irregular form withstood and passed. The output for bad.1.en.out.txt:
$ python3 run/check.py run/words.txt run/bad.1.en.out.txt enVerified 20 rows, 3 errors Target word missing 5: feasible not in 'It is possible to finish this small task before lunch.' Word mismatch 14: expected tentative, got collaborate Duplicate word 14: collaborate[7] Review observed drift and usage boundaries.
In these two English runs (en.1.out.txt and en.2.out.txt), all 20 target words appeared in the table. The examples for entry 16 (versatile) differed: run 1 used a multi-purpose tool ("This tool is versatile because you can use it to cut, screw, and measure."), run 2 used cooking ("Eggs are a versatile food because you can cook them in many ways."). The two Korean runs both used eggs.
Polysemous words went one way. For entry 18 (yield), both English runs gave crop-and-produce examples ("yield sweet tomatoes" and "yield a healthy crop of vegetables") rather than traffic yielding or financial returns. Two runs do not show a general tendency. Writing the target meaning in the word list (such as 18. yield (give way)) is one option, but it was not tested here.
Do not use generated examples as-is for high-stakes test preparation (such as SAT or TOEFL reading items) or specialized legal terminology without cross-checking official past exams or corpus resources.