#!/usr/bin/env python3
"""Week 13 Generator - High-Frequency & Irregular Words

Phonics: Irregular/sight words — memorization strategies, chunking
Spelling: 12 high-frequency words that appear often in reading
Grammar: Prepositions (in, on, at, under, over, between)
"""

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from monday import generate_monday
from tuesday import generate_tuesday
from wednesday import generate_wednesday
from thursday import generate_thursday
from friday import generate_friday
from teacher_guide import generate_teacher_guide
from validate import validate_week

WEEK = os.path.expanduser("~/Home_School/2nd_Grade/English_Language_Arts/Week_13")

# =====================================================================
# WORD LIST - 12 words, all 6+ letters, High-Frequency & Irregular
# =====================================================================
WORDS = [
    ("people", "irregular plural", "a group of more than one person"),
    ("little", "double_consonant", "small in size or amount"),
    ("enough", "irregular - ough", "as much or as many as needed"),
    ("friend", "irregular - ie (e sound)", "a person you like and spend time with"),
    ("mother", "digraph_th", "a female parent"),
    ("father", "digraph_th", "a male parent"),
    ("children", "irregular - ildren", "young human beings, not yet adults"),
    ("together", "digraph_th", "in the same place at the same time"),
    ("because", "irregular - ecause", "for the reason that; showing why"),
    ("believe", "ie_rule", "to accept something as true"),
    ("receive", "ie_rule", "to get or be given something"),
    ("through", "irregular - ough", "moving from one side to the other"),
]

WORD_NAMES = [w[0] for w in WORDS]
PHONICS_LABEL = "Irregular_Words"

# =====================================================================
# SHARED CONTENT DATA
# =====================================================================
LEARNING_TEXT = (
    "Some words appear so often in reading that we call them <strong>high-frequency words</strong>.<br>"
    "These words don't always follow the phonics rules we've learned &mdash; they need to be memorized by sight!<br>"
    "Tip: Break long words into <strong>chunks</strong> to help remember them."
)

GRAMMAR_NOTE = (
    "Grammar: <strong>Prepositions</strong> show where something is or where it goes. "
    "Words like <em>in, on, at, under, over, between</em> tell us about position and direction. "
    "Example: The cat is <strong>under</strong> the table."
)

GRAMMAR_DEEP = (
    "Prepositions tell us WHERE something is or WHERE it's going.<br><br>"
    "Common prepositions:<br><br>"
    "&bull; <strong>in</strong> &mdash; inside something &mdash; The book is <em>in</em> the bag.<br>"
    "&bull; <strong>on</strong> &mdash; touching the surface &mdash; The cat is <em>on</em> the chair.<br>"
    "&bull; <strong>at</strong> &mdash; a specific place &mdash; We met <em>at</em> the park.<br>"
    "&bull; <strong>under</strong> &mdash; below something &mdash; The dog is <em>under</em> the table.<br>"
    "&bull; <strong>over</strong> &mdash; above something &mdash; The bird flew <em>over</em> the tree.<br>"
    "&bull; <strong>between</strong> &mdash; in the middle of two things &mdash; The ball is <em>between</em> the trees.<br><br>"
    "Rule: The preposition comes BEFORE the noun to show position!"
)

VOWEL_EXAMPLES_MONDAY = [
    '<strong>people</strong> &mdash; irregular plural (not &quot;persons&quot;)',
    '<strong>little</strong> &mdash; break it: <em>lit-tle</em>',
    '<strong>enough</strong> &mdash; break it: <em>e-nough</em>',
    '<strong>friend</strong> &mdash; &quot;ie&quot; says &quot;e&quot; sound',
    '<strong>mother</strong> &mdash; break it: <em>moth-er</em>',
    '<strong>father</strong> &mdash; break it: <em>fath-er</em>',
    '<strong>children</strong> &mdash; irregular plural (not &quot;childs&quot;)',
    '<strong>together</strong> &mdash; break it: <em>to-geth-er</em>',
    '<strong>because</strong> &mdash; break it: <em>be-cause</em>',
    '<strong>believe</strong> &mdash; &quot;i&quot; before &quot;e&quot;',
    '<strong>receive</strong> &mdash; &quot;i&quot; before &quot;e&quot;',
    '<strong>through</strong> &mdash; &quot;ough&quot; says &quot;oo&quot;',
]

VOWEL_EXAMPLES_TUE = VOWEL_EXAMPLES_MONDAY

SORT_LABELS = ["plural", "ittle", "ough", "ie (i before e)", "ie (other)", "other/ather", "ildren", "ogeth", "ecause"]
SORT_TITLE = "Irregular Word Chunk Sort"

LEARNING_SKILLS_WED = [
    "<strong>Reading</strong> &mdash; understand vocabulary in context",
    "<strong>Synonyms &amp; Antonyms</strong> &mdash; words with similar and opposite meanings",
    "<strong>Word Webs</strong> &mdash; connecting related vocabulary",
]

REMINDER_TEXT = (
    "Irregular Word Tips:<br><br>"
    "1. These words don't always follow the rules &mdash; we memorize them by sight!<br>"
    "2. Break long words into <strong>chunks</strong> to remember them.<br>"
    "3. <strong>people</strong> &mdash; not &quot;persons&quot;<br>"
    "4. <strong>little</strong> &mdash; &quot;lit&quot; + &quot;tle&quot;<br>"
    "5. <strong>enough</strong> &mdash; &quot;e&quot; + &quot;nough&quot;<br>"
    "6. <strong>friend</strong> &mdash; &quot;ie&quot; says &quot;e&quot; sound<br>"
    "7. <strong>mother</strong> &mdash; &quot;moth&quot; + &quot;er&quot;<br>"
    "8. <strong>father</strong> &mdash; &quot;fath&quot; + &quot;er&quot;<br>"
    "9. <strong>children</strong> &mdash; plural of &quot;child&quot;<br>"
    "10. <strong>together</strong> &mdash; &quot;to&quot; + &quot;geth&quot; + &quot;er&quot;<br>"
    "11. <strong>because</strong> &mdash; &quot;be&quot; + &quot;cause&quot;<br>"
    "12. <strong>believe</strong> &mdash; &quot;i&quot; before &quot;e&quot;<br>"
    "13. <strong>receive</strong> &mdash; &quot;i&quot; before &quot;e&quot;<br>"
    "14. <strong>through</strong> &mdash; &quot;ough&quot; says &quot;oo&quot;<br><br>"
    "Remember: break them into chunks and practice reading them every day!"
)

# =====================================================================
# MONDAY DATA - Family adventure theme
# =====================================================================
MONDAY_STORY = (
    'So many <strong>people</strong> came to our <strong>little</strong> garden party on Saturday. '
    'My <strong>mother</strong> baked cookies and my <strong>father</strong> set up the tables. '
    'The <strong>children</strong> played <strong>together</strong> near the fountain. '
    'We had <strong>enough</strong> food for everyone. '
    'My best <strong>friend</strong> Sam arrived just <strong>because</strong> he wanted to say hello. '
    'We <strong>believe</strong> it was the best party ever. '
    'Sam said he would <strong>receive</strong> a prize for the biggest smile. '
    'We walked <strong>through</strong> the park on our way home.'
)

MONDAY_GRAMMAR_PRACTICE = [
    "the cat sat under the table",
    "the book is on the shelf",
    "the bird flew over the tree",
]

MONDAY_FILL_DATA = [
    ("My ____ made a delicious cake for the party.", "mother"),
    ("We had ____ food for everyone at the picnic.", "enough"),
    ("The ____ played in the park all afternoon.", "children"),
    ("My best ____ came to visit me today.", "friend"),
]

MONDAY_OPPOSITE_WORDS = ["little", "together"]
MONDAY_SENTENCE_WORDS = WORD_NAMES[:4]

# =====================================================================
# TUESDAY DATA - Community helpers theme
# =====================================================================
TUESDAY_LEARNING = (
    "Today we practice our High-Frequency Irregular Words. Read each word slowly "
    "and use chunking to help you remember the spelling."
)

TUESDAY_READING = (
    'The <strong>little</strong> library had many <strong>people</strong> on Monday morning. '
    'Mrs. Lee was the librarian. She was like a <strong>mother</strong> to the town. '
    'Her <strong>father</strong> helped build the library <strong>because</strong> he loved books. '
    'The <strong>children</strong> read <strong>together</strong> in the corner. '
    'There was <strong>enough</strong> room for every <strong>friend</strong> who visited. '
    'The mayor came to <strong>receive</strong> an award for the town. '
    'He <strong>believed</strong> reading was the most important thing. '
    'They walked <strong>through</strong> the book fair and smiled. '
    'Everyone left happy <strong>together</strong>!'
)

TUESDAY_COMP_QUESTIONS = [
    "Why did the mayor receive an award?",
    "Who helped build the library?",
    "What did the children do in the corner?",
]

TUESDAY_REMEMBER_1 = (
    "Remember This!",
    '<table style="width:100%;border-collapse:separate;border-spacing:4px;font-size:11px;"><tr>'
    '<td style="vertical-align;top;width:50%;">'
    'Chunking Strategy:<br>'
    '- <strong>peo-ple</strong> &mdash; two parts<br>'
    '- <strong>lit-tle</strong> &mdash; two parts<br>'
    '- <strong>e-nough</strong> &mdash; two parts<br>'
    '- <strong>friend</strong> &mdash; one chunk<br>'
    '</td>'
    '<td style="vertical-align;top;width:50%;">'
    '- <strong>moth-er</strong> &mdash; two parts<br>'
    '- <strong>fath-er</strong> &mdash; two parts<br>'
    '- <strong>chil-dren</strong> &mdash; two parts<br>'
    '- <strong>to-geth-er</strong> &mdash; three parts<br><br>'
    '<strong>Try This:</strong> How many chunks in &quot;because&quot;? ___'
    '</td>'
    '</tr></table>'
)

TUESDAY_REMEMBER_2 = (
    "Remember This!",
    '<table style="width:100%;border-collapse:separate;border-spacing:4px;font-size:11px;"><tr>'
    '<td style="vertical-align;top;width:50%;">'
    'Prepositions show WHERE something is:<br><br>'
    '<strong>in</strong> the box<br>'
    '<strong>on</strong> the table<br>'
    '<strong>under</strong> the bed<br>'
    '</td>'
    '<td style="vertical-align;top;width:50%;">'
    '<strong>at</strong> the park<br>'
    '<strong>over</strong> the hill<br>'
    '<strong>between</strong> the trees<br><br>'
    '<strong>Try This:</strong> The cat is ___ the couch. ___'
    '</td>'
    '</tr></table>'
)

TUESDAY_SWAP_DATA = [
    ("The little library was full of people.", ("little", "mother"), ("people", "children")),
    ("We walked through the park together.", ("through", "because"), ("together", "believe")),
    ("My father said we should receive a prize.", ("father", "friend"), ("receive", "enough")),
]

TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence about family.", "mother"),
    ("Write a sentence about sharing.", "together"),
    ("Write a sentence using an irregular word.", "because"),
]

# =====================================================================
# WEDNESDAY DATA - School adventure theme
# =====================================================================
WEDNESDAY_LEARNING = (
    "Today we use our Irregular Words in reading, writing, and thinking. "
    "Each activity helps you understand how these words work in different contexts."
)

WEDNESDAY_READING = (
    'On the first day of school, the <strong>little</strong> classroom had many <strong>people</strong>. '
    'Mrs. Green welcomed the <strong>children</strong> with a big smile. '
    'She was like a <strong>mother</strong> to all of us. '
    'My <strong>father</strong> walked me <strong>through</strong> the school doors. '
    'My <strong>friend</strong> Leo sat <strong>together</strong> with me at our desk. '
    'There was <strong>enough</strong> paper for every student. '
    'We <strong>believe</strong> learning is the best adventure. '
    'Mrs. Green said, &quot;You will <strong>receive</strong> a book report each week. '
    'And <strong>because</strong> you are all so special, you will love it!&quot;'
)

WEDNESDAY_VOCAB_Q = (
    "In the sentence 'Mrs. Green was like a mother to all of us,' what does it mean?<br><br>"
    "A) She was their actual mom<br>"
    "B) She cared for them like a mom would<br>"
    "C) She was a very old teacher<br>"
    "D) She cooked for them every day"
)

WEDNESDAY_SYN_ANT = ["little", "enough", "together", "believe", "friend", "children"]

WEDNESDAY_SORT_DATA = [
    "The little classroom was full of people on the first day",
    "My father walked me through the school doors",
]

WEDNESDAY_CORRECT = [
    "the children played together in the park.",
    "my mother baked a cake because it was my birthday.",
    "we believe we will receive a prize.",
]

WEDNESDAY_FILL = [
    ("The ____ walked me to the bus stop.", "father"),
    ("We played ____ in the playground.", "together"),
    ("My ____ Leo sat next to me at lunch.", "friend"),
]

WEDNESDAY_CONTEXT = (
    'Read this sentence: "There was enough food for everyone at the party."<br><br>'
    "What does <strong>enough</strong> mean?<br>"
    "A) Too little food<br>"
    "B) As much as needed<br>"
    "C) Way too much food<br>"
    "D) No food at all"
)

WEDNESDAY_DICTATION = ["people", "little", "enough", "friend", "mother", "father"]

# =====================================================================
# THURSDAY DATA - Neighborhood adventure theme
# =====================================================================
THURSDAY_LEARNING = (
    "Today we use our Irregular Words in stories and writing. "
    "Use each word correctly in your sentences and stories."
)

THURSDAY_STORY = (
    'Our <strong>little</strong> neighborhood had many <strong>people</strong> who became <strong>friend</strong>. '
    'My <strong>mother</strong> and <strong>father</strong> hosted a block party <strong>because</strong> they wanted everyone to <strong>believe</strong> we were a family. '
    'The <strong>children</strong> played <strong>through</strong> the afternoon <strong>together</strong>. '
    'There was <strong>enough</strong> lemonade and cookies for all. '
    'At the end of the day, every child would <strong>receive</strong> a small prize. '
    'We built the best neighborhood ever!'
)

THURSDAY_COMP_QUESTIONS = [
    "Why did the parents host a block party?",
    "What did the children play through?",
    "What would every child receive at the end?",
]

THURSDAY_SORT_DATA = [
    "The little neighborhood had many friendly people",
    "My mother and father hosted a block party together",
]

THURSDAY_DETECTIVE = [
    "peple", "litle", "enof", "freend", "mohter", "faher",
    "chldren", "togehter", "beccause", "beleve", "receve", "thru"
]

THURSDAY_SWAP_DATA = [
    ("The little classroom was full of people.", ("little", "enough"), ("people", "children")),
    ("My mother baked cookies because she loved us.", ("mother", "father"), ("because", "believe")),
]

THURSDAY_PARA_PROMPTS = [
    "Write a paragraph about your family.",
    "Write a paragraph about a day with your friend.",
]

# =====================================================================
# FRIDAY DATA - Review and celebration
# =====================================================================
FRIDAY_REVIEW_STORY = (
    'On Friday, our whole class celebrated spelling week. '
    'The <strong>little</strong> classroom had many <strong>people</strong>. '
    'My <strong>mother</strong> brought cookies and my <strong>father</strong> helped decorate. '
    'The <strong>children</strong> read their spelling words <strong>together</strong>. '
    'There was <strong>enough</strong> candy for every student. '
    'My best <strong>friend</strong> sat next to me during the test. '
    'We <strong>believe</strong> we all did our best. '
    'Each child would <strong>receive</strong> a sticker at the end. '
    'And <strong>because</strong> we worked so hard, Mr. Jones gave us extra recess. '
    'We walked <strong>through</strong> the playground and laughed <strong>together</strong>!'
)

FRIDAY_STORY_QUESTIONS = [
    "Who brought cookies and who helped decorate?",
    "Why did Mr. Jones give extra recess?",
    "What would each child receive?",
]

FRIDAY_OPPOSITE_WORDS = ["little", "together", "enough"]
FRIDAY_BUILDER_WORDS = ["people", "friend", "children", "together"]
FRIDAY_JOURNAL_WORDS = ["because", "believe", "receive", "through"]

# =====================================================================
# TEACHER GUIDE DATA
# =====================================================================
TEACHER_MONDAY_PHONICS_EXPLANATION = (
    "HIGH-FREQUENCY IRREGULAR WORDS are words that appear very often in reading but don't follow "
    "standard phonics rules. Students learn these by sight using <strong>chunking strategies</strong>.<br><br>"
    "&bull; <strong>people</strong> &mdash; chunk: &quot;peo-ple&quot; &mdash; irregular plural<br>"
    "&bull; <strong>little</strong> &mdash; chunk: &quot;lit-tle&quot; &mdash; &quot;ittle&quot; pattern<br>"
    "&bull; <strong>enough</strong> &mdash; chunk: &quot;e-nough&quot; &mdash; &quot;ough&quot; says &quot;uff&quot;<br>"
    "&bull; <strong>friend</strong> &mdash; one chunk &mdash; &quot;ie&quot; says &quot;e&quot; sound<br>"
    "&bull; <strong>mother</strong> &mdash; chunk: &quot;moth-er&quot; &mdash; &quot;other&quot; pattern<br>"
    "&bull; <strong>father</strong> &mdash; chunk: &quot;fath-er&quot; &mdash; &quot;ather&quot; pattern<br>"
    "&bull; <strong>children</strong> &mdash; chunk: &quot;chil-dren&quot; &mdash; irregular plural<br>"
    "&bull; <strong>together</strong> &mdash; chunk: &quot;to-geth-er&quot; &mdash; 3 chunks<br>"
    "&bull; <strong>because</strong> &mdash; chunk: &quot;be-cause&quot; &mdash; &quot;ecause&quot; pattern<br>"
    "&bull; <strong>believe</strong> &mdash; chunk: &quot;be-lieve&quot; &mdash; &quot;i&quot; before &quot;e&quot;<br>"
    "&bull; <strong>receive</strong> &mdash; chunk: &quot;re-ceive&quot; &mdash; &quot;i&quot; before &quot;e&quot;<br>"
    "&bull; <strong>through</strong> &mdash; one chunk &mdash; &quot;ough&quot; says &quot;oo&quot;<br><br>"
    "Important: Teach students to break these into chunks and read them aloud repeatedly."
)

TEACHER_MONDAY_GRAMMAR_FOCUS = "Prepositions -- Words That Show Position"

TEACHER_MONDAY_GRAMMAR_EXPLANATION = (
    "Prepositions tell us WHERE something is or WHERE it's going.<br><br>"
    "Common prepositions: <strong>in, on, at, under, over, between</strong><br><br>"
    "Examples: The cat is <strong>under</strong> the table. "
    "The bird flew <strong>over</strong> the tree.<br><br>"
    "Rule: Preposition + noun shows position or direction."
)

TEACHER_MONDAY_SORT_LABELS = ["plural", "ittle", "ough", "ie (i before e)", "ie (other)", "other/ather", "ildren", "ogeth", "ecause"]

TEACHER_MONDAY_SORT_ANSWERS = [
    ["people", "children"],
    ["little"],
    ["enough", "through"],
    ["believe", "receive"],
    ["friend"],
    ["mother", "father"],
    ["together"],
    ["because"],
]

TEACHER_MONDAY_FILL_ANSWERS = ["mother", "enough", "children", "friend"]

TEACHER_MONDAY_OPPOSITE_ANSWERS = [
    ("little", "big"),
    ("together", "apart"),
]

TEACHER_MONDAY_SENTENCE_WORDS = ["people", "little", "enough", "friend"]

# Tuesday
TEACHER_TUESDAY_PHONICS_EXPLANATION = (
    "Students continue building fluency with High-Frequency Irregular Words. "
    "Today's focus shifts from identification to APPLICATION &mdash; finding irregular words "
    "in context (reading passage), discriminating them from regular words (Pattern Hunt), "
    "and using them in original sentences (Builder)."
)

TEACHER_TUESDAY_SCRAMBLE_ANSWERS = [
    ("eoplep", "people"),
    ("tillet", "little"),
    ("euhgno", "enough"),
    ("fnried", "friend"),
    ("mohter", "mother"),
    ("faher", "father"),
    ("chilredn", "children"),
    ("togehter", "together"),
    ("beccause", "because"),
    ("beleive", "believe"),
    ("recevie", "receive"),
    ("thorugh", "through"),
]

TEACHER_TUESDAY_COMP_QUESTIONS = [
    "Why did the mayor receive an award?",
    "Who helped build the library?",
    "What did the children do in the corner?",
]

TEACHER_TUESDAY_COMP_ANSWERS = [
    "For the town (he believed reading was important).",
    "Her father helped build the library.",
    "They read together in the corner.",
]

TEACHER_TUESDAY_PATTERN_HUNT = {
    "match": ["people", "little", "enough", "friend", "mother", "father", "children", "together", "because", "believe", "receive", "through"],
    "decoy": ["cat", "dog", "house", "run", "big"],
}

TEACHER_TUESDAY_SWAP_ANSWERS = [
    "mother, children",
    "because, believe",
    "friend, enough",
]

TEACHER_TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence about family.", "mother"),
    ("Write a sentence about sharing.", "together"),
    ("Write a sentence using an irregular word.", "because"),
]

# Wednesday
TEACHER_WEDNESDAY_PHONICS_EXPLANATION = (
    "Mid-week deepening. Students now move beyond recognition into ANALYSIS &mdash; "
    "understanding word relationships (synonyms/antonyms), connecting vocabulary (word web), "
    "and applying listening skills (dictation). This is where the irregular word "
    "knowledge becomes functional."
)

TEACHER_WEDNESDAY_VOCAB_Q_QUESTION = (
    "In 'Mrs. Green was like a mother to all of us,' what does it mean?"
)

TEACHER_WEDNESDAY_VOCAB_Q_ANSWER = "B) She cared for them like a mom would"

TEACHER_WEDNESDAY_SYN_ANT_WORDS = ["little", "enough", "together", "believe", "friend", "children"]

TEACHER_WEDNESDAY_WORD_WEB_CENTER = "family"

TEACHER_WEDNESDAY_WORD_WEB_SUGGESTIONS = [
    "mother", "father", "children", "friend", "together", "home", "love", "care", "support", "happy"
]

TEACHER_WEDNESDAY_SORT_ANSWERS = {
    "sentences": [
        "The little classroom was full of people on the first day",
        "My father walked me through the school doors",
    ],
    "correct_order": [
        "The little classroom was full of people on the first day.",
        "My father walked me through the school doors.",
    ],
}

TEACHER_WEDNESDAY_CORRECT_ANSWERS = [
    ("the children played together in the park.", "The children played together in the park."),
    ("my mother baked a cake because it was my birthday.", "My mother baked a cake because it was my birthday."),
    ("we believe we will receive a prize.", "We believe we will receive a prize."),
]

TEACHER_WEDNESDAY_FILL_ANSWERS = ["father", "together", "friend"]

TEACHER_WEDNESDAY_CONTEXT_CLUE_QUESTION = (
    "In 'There was enough food for everyone at the party,' what does enough mean?"
)

TEACHER_WEDNESDAY_CONTEXT_CLUE_ANSWER = "B) As much as needed"

TEACHER_WEDNESDAY_DICTATION_WORDS = ["people", "little", "enough", "friend", "mother", "father"]

# Thursday
TEACHER_THURSDAY_PHONICS_EXPLANATION = (
    "Production day. Students have now seen and practiced Irregular Words for 3 days &mdash; "
    "today they actively CREATE with them. Spelling Detective builds metacognition. "
    "Spelling Maps teach word analysis. Paragraph writing brings it all together."
)

TEACHER_THURSDAY_COMP_QUESTIONS = [
    "Why did the parents host a block party?",
    "What did the children play through?",
    "What would every child receive at the end?",
]

TEACHER_THURSDAY_COMP_ANSWERS = [
    "Because they wanted everyone to believe they were a family.",
    "Through the afternoon together.",
    "A small prize.",
]

TEACHER_THURSDAY_SORT_ANSWERS = {
    "sentences": [
        "The little neighborhood had many friendly people",
        "My mother and father hosted a block party together",
    ],
    "correct_order": [
        "The little neighborhood had many friendly people.",
        "My mother and father hosted a block party together.",
    ],
}

TEACHER_THURSDAY_DETECTIVE_ANSWERS = [
    ("peple", "people"),
    ("litle", "little"),
    ("enof", "enough"),
    ("freend", "friend"),
    ("mohter", "mother"),
    ("faher", "father"),
    ("chldren", "children"),
    ("togehter", "together"),
    ("beccause", "because"),
    ("beleve", "believe"),
    ("receve", "receive"),
    ("thru", "through"),
]

TEACHER_THURSDAY_SWAP_ANSWERS = [
    "enough, children",
    "father, believe",
]

TEACHER_THURSDAY_MAP_WORD = "together"

TEACHER_THURSDAY_MAP_SUGGESTIONS = [
    "In the same place at the same time",
    "Chunk it: to-geth-er",
    "We played together in the park.",
]

TEACHER_THURSDAY_PARA_PROMPTS = [
    "Write a paragraph about your family.",
    "Write a paragraph about a day with your friend.",
]

# Friday
TEACHER_FRIDAY_PHONICS_EXPLANATION = (
    "Review and assessment day. Students show what they learned about High-Frequency Irregular Words all week. "
    "Keep the mood positive &mdash; even one more word correct than last week is a win!"
)

TEACHER_FRIDAY_TEST_ANSWERS = WORD_NAMES

TEACHER_FRIDAY_STORY_QUESTIONS = [
    "Who brought cookies and who helped decorate?",
    "Why did Mr. Jones give extra recess?",
    "What would each child receive?",
]

TEACHER_FRIDAY_STORY_ANSWERS = [
    "Mother brought cookies and father helped decorate.",
    "Because they worked so hard.",
    "A sticker.",
]

TEACHER_FRIDAY_OPPOSITE_ANSWERS = [
    ("little", "big"),
    ("together", "apart"),
    ("enough", "not enough"),
]

TEACHER_FRIDAY_BUILDER_WORDS = ["people", "friend", "children", "together"]

TEACHER_FRIDAY_JOURNAL_WORDS = ["because", "believe", "receive", "through"]

# =====================================================================
# VALIDATION
# =====================================================================
fill_data = MONDAY_FILL_DATA
DETECTIVE_WORDS = THURSDAY_DETECTIVE
DETECTIVE_ANSWERS = ["people", "little", "enough", "friend", "mother", "father",
                     "children", "together", "because", "believe", "receive", "through"]
detective_words = DETECTIVE_WORDS
detective_answers = DETECTIVE_ANSWERS
opposite_pairs = [
    ("little", "big"), ("together", "apart"), ("enough", "not enough"),
]
learning_examples = ["people", "little", "enough", "friend", "mother", "father",
                     "children", "together", "because", "believe", "receive", "through"]

errors = validate_week(
    words=WORDS,
    word_names=WORD_NAMES,
    fill_data=fill_data,
    detective_words=detective_words,
    detective_answers=detective_answers,
    opposite_pairs=opposite_pairs,
    learning_examples=learning_examples,
)

if errors:
    for e in errors:
        print(f"  {e}")
    exit(1)
print("[ok] All validation passed")

# =====================================================================
# GENERATE ALL DAYS
# =====================================================================
print(f"\nGenerating Week 13: High-Frequency & Irregular Words...")

generate_monday(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    learning_text=LEARNING_TEXT, vowel_examples=VOWEL_EXAMPLES_MONDAY,
    grammar_note=GRAMMAR_NOTE, grammar_deep=GRAMMAR_DEEP,
    grammar_practice=MONDAY_GRAMMAR_PRACTICE,
    story_text=MONDAY_STORY,
    sort_labels=SORT_LABELS, sort_title=SORT_TITLE,
    fill_data=MONDAY_FILL_DATA,
    opposite_words=MONDAY_OPPOSITE_WORDS,
    sentence_words=MONDAY_SENTENCE_WORDS,
)

generate_tuesday(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    learning_text=TUESDAY_LEARNING, vowel_examples=VOWEL_EXAMPLES_TUE,
    remember_boxes=[TUESDAY_REMEMBER_1, TUESDAY_REMEMBER_2],
    reading_text=TUESDAY_READING,
    comp_questions=TUESDAY_COMP_QUESTIONS,
    swap_data=TUESDAY_SWAP_DATA,
    builder_prompts=TUESDAY_BUILDER_PROMPTS,
    pattern_hunt_title="Irregular Word Hunt",
    pattern_hunt_words=["people", "little", "cat", "enough", "run", "friend", "mother", "dog", "father", "children", "big", "together", "house", "because", "believe", "receive", "through"],
    pattern_hunt_instruction="Check each word that is an irregular sight word.",
)

generate_wednesday(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    learning_text=WEDNESDAY_LEARNING, learning_skills=LEARNING_SKILLS_WED,
    reading_passage=WEDNESDAY_READING,
    vocab_question=WEDNESDAY_VOCAB_Q,
    syn_ant_words=WEDNESDAY_SYN_ANT,
    word_web_center="family",
    sentence_sort_data=WEDNESDAY_SORT_DATA,
    correct_sentences=WEDNESDAY_CORRECT,
    fill_data=WEDNESDAY_FILL,
    context_clue=WEDNESDAY_CONTEXT,
    dictation_words=WEDNESDAY_DICTATION,
)

generate_thursday(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    learning_text=THURSDAY_LEARNING, remember_text=REMINDER_TEXT,
    story_text=THURSDAY_STORY,
    comp_questions=THURSDAY_COMP_QUESTIONS,
    sentence_sort_data=THURSDAY_SORT_DATA,
    detective_words=THURSDAY_DETECTIVE,
    swap_data=THURSDAY_SWAP_DATA,
    map_word=TEACHER_THURSDAY_MAP_WORD,
    para_prompts=THURSDAY_PARA_PROMPTS,
)

generate_friday(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    review_story=FRIDAY_REVIEW_STORY,
    story_questions=FRIDAY_STORY_QUESTIONS,
    opposite_words=FRIDAY_OPPOSITE_WORDS,
    builder_words=FRIDAY_BUILDER_WORDS,
    journal_words=FRIDAY_JOURNAL_WORDS,
)

generate_teacher_guide(
    week_dir=WEEK, week_num=13, phonics_label=PHONICS_LABEL, words=WORDS,
    phonics_name="High-Frequency & Irregular Words",

    # Monday
    monday_phonics_explanation=TEACHER_MONDAY_PHONICS_EXPLANATION,
    monday_grammar_focus=TEACHER_MONDAY_GRAMMAR_FOCUS,
    monday_grammar_explanation=TEACHER_MONDAY_GRAMMAR_EXPLANATION,
    monday_story_text=MONDAY_STORY,
    monday_sort_labels=TEACHER_MONDAY_SORT_LABELS,
    monday_sort_answers=TEACHER_MONDAY_SORT_ANSWERS,
    monday_fill_answers=TEACHER_MONDAY_FILL_ANSWERS,
    monday_opposite_answers=TEACHER_MONDAY_OPPOSITE_ANSWERS,
    monday_sentence_words=TEACHER_MONDAY_SENTENCE_WORDS,

    # Tuesday
    tuesday_phonics_explanation=TEACHER_TUESDAY_PHONICS_EXPLANATION,
    tuesday_scramble_answers=TEACHER_TUESDAY_SCRAMBLE_ANSWERS,
    tuesday_reading_text=TUESDAY_READING,
    tuesday_comp_questions=TEACHER_TUESDAY_COMP_QUESTIONS,
    tuesday_comp_answers=TEACHER_TUESDAY_COMP_ANSWERS,
    tuesday_pattern_hunt_answers=TEACHER_TUESDAY_PATTERN_HUNT,
    tuesday_swap_answers=TEACHER_TUESDAY_SWAP_ANSWERS,
    tuesday_builder_prompts=TEACHER_TUESDAY_BUILDER_PROMPTS,

    # Wednesday
    wednesday_phonics_explanation=TEACHER_WEDNESDAY_PHONICS_EXPLANATION,
    wednesday_reading_text=WEDNESDAY_READING,
    wednesday_vocab_q_question=TEACHER_WEDNESDAY_VOCAB_Q_QUESTION,
    wednesday_vocab_q_answer=TEACHER_WEDNESDAY_VOCAB_Q_ANSWER,
    wednesday_syn_ant_words=TEACHER_WEDNESDAY_SYN_ANT_WORDS,
    wednesday_word_web_center=TEACHER_WEDNESDAY_WORD_WEB_CENTER,
    wednesday_word_web_suggestions=TEACHER_WEDNESDAY_WORD_WEB_SUGGESTIONS,
    wednesday_sort_answers=TEACHER_WEDNESDAY_SORT_ANSWERS,
    wednesday_correct_answers=TEACHER_WEDNESDAY_CORRECT_ANSWERS,
    wednesday_fill_answers=TEACHER_WEDNESDAY_FILL_ANSWERS,
    wednesday_context_clue_question=TEACHER_WEDNESDAY_CONTEXT_CLUE_QUESTION,
    wednesday_context_clue_answer=TEACHER_WEDNESDAY_CONTEXT_CLUE_ANSWER,
    wednesday_dictation_words=TEACHER_WEDNESDAY_DICTATION_WORDS,

    # Thursday
    thursday_phonics_explanation=TEACHER_THURSDAY_PHONICS_EXPLANATION,
    thursday_story_text=THURSDAY_STORY,
    thursday_comp_questions=TEACHER_THURSDAY_COMP_QUESTIONS,
    thursday_comp_answers=TEACHER_THURSDAY_COMP_ANSWERS,
    thursday_sort_answers=TEACHER_THURSDAY_SORT_ANSWERS,
    thursday_detective_answers=TEACHER_THURSDAY_DETECTIVE_ANSWERS,
    thursday_swap_answers=TEACHER_THURSDAY_SWAP_ANSWERS,
    thursday_map_word=TEACHER_THURSDAY_MAP_WORD,
    thursday_map_suggestions=TEACHER_THURSDAY_MAP_SUGGESTIONS,
    thursday_para_prompts=TEACHER_THURSDAY_PARA_PROMPTS,

    # Friday
    friday_phonics_explanation=TEACHER_FRIDAY_PHONICS_EXPLANATION,
    friday_test_answers=TEACHER_FRIDAY_TEST_ANSWERS,
    friday_story_questions=TEACHER_FRIDAY_STORY_QUESTIONS,
    friday_story_answers=TEACHER_FRIDAY_STORY_ANSWERS,
    friday_opposite_answers=TEACHER_FRIDAY_OPPOSITE_ANSWERS,
    friday_builder_words=TEACHER_FRIDAY_BUILDER_WORDS,
    friday_journal_words=TEACHER_FRIDAY_JOURNAL_WORDS,
)

print("\nWeek 13 generation complete!")