Urban Planning Lecture Notes Pdf -

def _identify_focus_areas(self) -> List[str]: """Identify areas that need more attention based on complexity markers""" complexity_markers = [ 'important', 'crucial', 'essential', 'note that', 'remember', 'key point', 'significant', 'critical', 'fundamental' ] focus_areas = [] sentences = sent_tokenize(self.full_text) for sentence in sentences: for marker in complexity_markers: if marker in sentence.lower(): focus_areas.append(sentence[:100]) break return list(set(focus_areas))[:8]

def extract_text_from_pdf(self) -> str: """Extract text from PDF file""" text = "" with open(self.pdf_path, 'rb') as file: pdf_reader = PyPDF2.PdfReader(file) for page_num, page in enumerate(pdf_reader.pages): page_text = page.extract_text() self.pages_text.append( 'page_num': page_num + 1, 'text': page_text ) text += page_text + "\n" self.full_text = text return text urban planning lecture notes pdf

def _extract_principles(self) -> List[str]: """Extract core urban planning principles""" principle_patterns = [ r'(?i)principle[s]? of (.+?)[\.\n]', r'(?i)core (?:concept|principle)[s]?: (.+?)[\.\n]', r'(?i)([^.]*?(?:should|must|requires|essential|crucial|important)[^.]*?\.)' ] principles = [] for pattern in principle_patterns: matches = re.findall(pattern, self.full_text) principles.extend(matches[:5]) return principles[:10] concept['term']

def extract_case_studies(self) -> List[Dict]: """Identify and extract case studies from lecture notes""" case_patterns = [ r'(?i)case study[:]\s*(.+?)(?:\n\n|\n\s*\n|$)', r'(?i)example[:]\s*(.+?)(?:\n\n|\n\s*\n|$)', r'(?i)([A-Z][a-z]+(?:[-\s][A-Z][a-z]+)*)\s+(?:is\s+an\s+example|demonstrates|illustrates)', ] case_studies = [] sentences = sent_tokenize(self.full_text) for i, sentence in enumerate(sentences): for pattern in case_patterns: matches = re.findall(pattern, sentence) for match in matches: # Get surrounding context start_idx = max(0, i - 2) end_idx = min(len(sentences), i + 3) context = ' '.join(sentences[start_idx:end_idx]) case_studies.append( 'title': match if isinstance(match, str) else match[0], 'description': sentence, 'context': context ) self.case_studies = case_studies return case_studies def _identify_focus_areas(self) -&gt

def _take_quiz(self): questions = self.analyzer.generate_study_questions()[:5] score = 0 print("\n📝 QUICK QUIZ (5 questions)") print("Answer in your own words, then press Enter for sample answer\n") for i, q in enumerate(questions, 1): print(f"\ni. q['question']") input("Press Enter to see sample answer...") print(f"\n Sample approach: q['hint']") print(" Review the relevant section for complete answer.\n") def main(): # Replace with your PDF path pdf_path = "urban_planning_lecture_notes.pdf"

def generate_study_questions(self) -> List[Dict]: """Generate study questions based on key concepts and sections""" questions = [] # Generate questions from key concepts for concept in self.key_concepts[:10]: questions.append( 'type': 'concept', 'question': f"What are the key principles and applications of concept['term'] in urban planning?", 'related_concept': concept['term'], 'hint': f"Review section discussing concept['term'] (mentioned concept['frequency'] times)" ) # Generate questions from sections for section_name, section_text in list(self.sections.items())[:5]: if len(section_text) > 100: questions.append( 'type': 'section', 'question': f"Summarize the main arguments presented in 'section_name' regarding urban planning approaches.", 'related_section': section_name, 'hint': "Focus on the key definitions and examples provided" ) # Add comparative questions if len(self.case_studies) >= 2: questions.append( 'type': 'comparative', 'question': f"Compare and contrast the urban planning approaches in 'self.case_studies[0]['title']' vs 'self.case_studies[1]['title']'.", 'hint': "Consider differences in context, implementation, and outcomes" ) return questions

def _show_concepts(self): print("\n🔑 KEY CONCEPTS:") for i, concept in enumerate(self.analyzer.key_concepts[:15], 1): print(f"\ni. concept['term'].upper() (appears concept['frequency']x)") if concept['context']: print(f" Context: concept['context'][0][:150]...")