Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import json | |
| # Page configuration | |
| st.set_page_config( | |
| page_title="M.Sc. CS Syllabus Explorer", | |
| page_icon="π", | |
| layout="wide", | |
| initial_sidebar_state="expanded" | |
| ) | |
| # Custom CSS for beautiful UI | |
| st.markdown(""" | |
| <style> | |
| .main { | |
| padding-top: 2rem; | |
| } | |
| .stApp { | |
| background: white; | |
| } | |
| .main-header { | |
| background: black; | |
| padding: 2rem; | |
| border-radius: 15px; | |
| text-align: center; | |
| margin-bottom: 2rem; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.1); | |
| } | |
| .main-header h1 { | |
| color: white; | |
| font-size: 2.5rem; | |
| margin: 0; | |
| text-shadow: 2px 2px 4px rgba(0,0,0,0.3); | |
| } | |
| .main-header p { | |
| color: white; | |
| font-size: 1.2rem; | |
| margin: 0.5rem 0 0 0; | |
| opacity: 0.9; | |
| } | |
| .paper-card { | |
| background: white; | |
| padding: 1.5rem; | |
| border-radius: 15px; | |
| margin: 1rem 0; | |
| box-shadow: 0 4px 20px rgba(0,0,0,0.1); | |
| border-left: 5px solid black; | |
| transition: transform 0.3s ease; | |
| } | |
| .paper-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 8px 30px rgba(0,0,0,0.15); | |
| } | |
| .unit-card { | |
| background: #f8f9fa; | |
| padding: 1rem; | |
| border-radius: 10px; | |
| margin: 0.5rem 0; | |
| border-left: 3px solid black; | |
| } | |
| .topic-item { | |
| background: #f8f9fa; | |
| padding: 0.5rem; | |
| margin: 0.3rem 0; | |
| border-radius: 8px; | |
| border-left: 2px solid black; | |
| } | |
| .sidebar .sidebar-content { | |
| background: white; | |
| border-radius: 10px; | |
| padding: 1rem; | |
| } | |
| .metric-card { | |
| background: black; | |
| color: white; | |
| padding: 1rem; | |
| border-radius: 10px; | |
| text-align: center; | |
| margin: 0.5rem 0; | |
| } | |
| .search-box { | |
| background: white; | |
| border-radius: 10px; | |
| padding: 1rem; | |
| margin: 1rem 0; | |
| box-shadow: 0 2px 10px rgba(0,0,0,0.1); | |
| } | |
| </style> | |
| """, unsafe_allow_html=True) | |
| # Syllabus data structure | |
| syllabus_data = { | |
| "Programming in Java": { | |
| "UNIT-I": { | |
| "Introduction": [ | |
| "History and features of Java", | |
| "Difference between C, C++ & JAVA", | |
| "JAVA and Internet, WWW, Web Browsers", | |
| "Java support system, Java Environment", | |
| "JDK, JVM, Byte code" | |
| ], | |
| "Java Programming Basics": [ | |
| "Structure of Java program", | |
| "JAVA tokens and Statements", | |
| "Constants & Variables", | |
| "Data types", | |
| "Operators", | |
| "Command line arguments" | |
| ], | |
| "Java Statements & Arrays": [ | |
| "if and switch statement", | |
| "while, do-while and for loops", | |
| "Introduction to arrays, types of arrays, new operator", | |
| "Strings, String class & its methods", | |
| "Vectors" | |
| ], | |
| "Classes & Objects": [ | |
| "Specifying classes", | |
| "Methods and fields", | |
| "Creating objects", | |
| "Passing objects to methods, returning objects", | |
| "Static fields & methods", | |
| "Constructors", | |
| "Garbage collection", | |
| "Overloading methods & constructors", | |
| "this keyword" | |
| ] | |
| }, | |
| "UNIT-II": { | |
| "Inheritance": [ | |
| "Specifying sub class", | |
| "Types of inheritance", | |
| "Visibility control: public, private, protected, package", | |
| "super keyword", | |
| "Overriding methods", | |
| "Dynamic method dispatch", | |
| "Abstract methods and classes", | |
| "final methods & classes" | |
| ], | |
| "Packages & Interfaces": [ | |
| "Introduction to packages, naming conventions", | |
| "package statement, creating packages", | |
| "import statement, accessing package", | |
| "Use of CLASSPATH, adding class to package, hiding classes", | |
| "Interface, implementing interfaces, multiple interfaces" | |
| ], | |
| "Multithreading": [ | |
| "Creation threads", | |
| "Extending Thread class, implements Runnable interface", | |
| "Stopping and blocking thread", | |
| "Thread life cycle", | |
| "Thread priorities & Thread synchronization", | |
| "Using Thread methods" | |
| ] | |
| }, | |
| "UNIT-III": { | |
| "Exception Handling": [ | |
| "Managing errors, types of errors, exceptions", | |
| "Syntax of exception handling code: try, catch, throw, throws and finally statements", | |
| "Multiple catch & nested try statements" | |
| ], | |
| "Java Input Output": [ | |
| "Java I/O package", | |
| "Byte/Character Stream", | |
| "Buffered reader / writer", | |
| "File reader / writer", | |
| "File Sequential / Random", | |
| "Reading numeric, character & strings data from keyboard" | |
| ], | |
| "Applet Programming": [ | |
| "Applet Vs. Application", | |
| "Creating applets, life cycle", | |
| "Local & remote applets", | |
| "<APPLET> tag & its attributes", | |
| "Adding applet to HTML file, Running applet" | |
| ] | |
| }, | |
| "UNIT-IV": { | |
| "Abstract Windows Toolkit (AWT)": [ | |
| "Components and Graphics", | |
| "Containers, Frames and Panels", | |
| "Layout Managers: Border layout, Flow layout, Grid layout, Card layout", | |
| "AWT components", | |
| "Event delegation Model: Event source and handler, Event categories, Listeners, Interfaces", | |
| "Controls: text box, radio buttons, checkboxes, lists, choice, command buttons, text area etc." | |
| ], | |
| "JDBC (Java Database Connectivity)": [ | |
| "Types of JDBC drivers", | |
| "Writing JDBC applications", | |
| "Types of statement objects: Statement, PreparedStatement and CallableStatement", | |
| "Types of resultset", | |
| "Inserting and updating records", | |
| "JDBC and AWT" | |
| ] | |
| }, | |
| "UNIT-V": { | |
| "Networking with Java": [ | |
| "Networking basics, Sockets, port", | |
| "Internet addressing", | |
| "java.net β networking classes and interfaces", | |
| "Implementing TCP/IP based Server and Client" | |
| ], | |
| "Servlets": [ | |
| "Introduction Servlet API Overview", | |
| "Writing and running Simple Servlet, Servlet Life cycle", | |
| "Generic Servlet, HTTPServlet", | |
| "ServletConfig, ServletContest", | |
| "Writing Servlet to handle Get and Post methods" | |
| ] | |
| } | |
| }, | |
| "Computer Graphics": { | |
| "UNIT-I": { | |
| "Graphics Systems Overview": [ | |
| "Introduction of computer Graphics and its applications", | |
| "Overview of Graphics systems" | |
| ], | |
| "Video Display Devices": [ | |
| "Raster scan display, Raster scan systems, video controller, Raster scan display processor", | |
| "Random scan display, random scan systems", | |
| "Color CRT monitor", | |
| "Flat panel display" | |
| ], | |
| "Interactive Input Devices": [ | |
| "Logical classification of input devices", | |
| "Keyboard, mouse, Trackball and spaceball, Joysticks, Image scanner, Light pens" | |
| ], | |
| "Graphics Foundations": [ | |
| "Graphics software", | |
| "Coordinates representations", | |
| "Graphics functions" | |
| ] | |
| }, | |
| "UNIT-II": { | |
| "Drawing Algorithms": [ | |
| "Line drawing algorithms: DDA, Bresenham's", | |
| "Circle generating: Mid-point circle algorithm", | |
| "Ellipse generating: Polynomials", | |
| "Scan-line polygon fill", | |
| "Boundary fill" | |
| ] | |
| }, | |
| "UNIT-III": { | |
| "2D Transformations": [ | |
| "Basic transformations: Translation, Rotation, Scaling", | |
| "Matrix representations & homogeneous co-ordinates", | |
| "Composite transformations: Reflection" | |
| ], | |
| "2D Viewing and Clipping": [ | |
| "Two dimensional viewing", | |
| "Two dimensional clipping: Line, Polygon, Curve, Text" | |
| ], | |
| "3D Graphics": [ | |
| "3D-transformation, Projection, Viewing, Clipping" | |
| ] | |
| }, | |
| "UNIT-IV": { | |
| "Spline Representation": [ | |
| "Cubic spline", | |
| "Bezier curve, Bezier surfaces", | |
| "Beta spline", | |
| "B-spline surfaces, B-spline curve" | |
| ], | |
| "Hidden Surface Removal": [ | |
| "Hidden surfaces", | |
| "Hidden lines", | |
| "Z-buffer" | |
| ] | |
| }, | |
| "UNIT-V": { | |
| "Fractals Geometry": [ | |
| "Fractal generation procedure", | |
| "Classification of Fractal", | |
| "Fractal dimension", | |
| "Fractal construction methods" | |
| ], | |
| "Color and Shading": [ | |
| "Color models: XYZ, RGB, YIQ, CMY & HSV", | |
| "Shading algorithms", | |
| "Shading model", | |
| "Illumination model", | |
| "Gouraud shading", | |
| "Phong shading" | |
| ] | |
| } | |
| }, | |
| "LINUX": { | |
| "UNIT-I": { | |
| "Introduction to Unix/Linux": [ | |
| "Introduction to Multi-user System", | |
| "Emergency and history of Unix", | |
| "Feature and benefits, Versions of Unix" | |
| ], | |
| "System Structure": [ | |
| "Hardware requirements", | |
| "Kernel and its function", | |
| "Introduction to System calls and Shell" | |
| ], | |
| "File System": [ | |
| "Feature of Unix File System", | |
| "Concept of i-node table, links", | |
| "Commonly used commands (who, pwd, cd, mkdir, rm, ls, mv, lp, chmod, cp, grep, sed, awk, pr, lex, yacc, make)", | |
| "Getting started (login / logout)", | |
| "File system management, file operation, system calls, buffer cache" | |
| ], | |
| "Vi Editor": [ | |
| "Intro to text processing", | |
| "Command and edit mode, invoking vi", | |
| "Command structure, deleting and inserting line", | |
| "Deleting and replacing character, searching strings, yanking", | |
| "Running shell command, command macros", | |
| "Set windows, set auto indent, set number, intro to exrc file" | |
| ] | |
| }, | |
| "UNIT-II": { | |
| "Shell Programming": [ | |
| "Introduction to shell feature, wild card characters", | |
| "I/O redirections, standard error redirection", | |
| "System and user created shell variables, profile files", | |
| "Pipes/tee, background processing", | |
| "Command line arguments, command substitution, read statement", | |
| "Conditional execution of commands", | |
| "Special shell variables ($#, #?, $* etc.)", | |
| "Shift commands", | |
| "Loops and decision making: for, while and until", | |
| "Choice making using case...esac", | |
| "Decision making if...fi", | |
| "Using test, string comparison, numerical comparison, logical operation, using expr" | |
| ] | |
| }, | |
| "UNIT-III": { | |
| "Advanced Shell": [ | |
| "Features, changing the login shell", | |
| "cshrc, login, logout files", | |
| "Setting environment variables", | |
| "History and alias mechanism", | |
| "Command line arguments", | |
| "Redirection/appending safely, noclobber, noglob, ignore eof", | |
| "Directory stacks (pushd, popd)", | |
| "Feature of other shell (rsh, vsh)" | |
| ], | |
| "Process Control": [ | |
| "Process management, process states and transition", | |
| "Regions and control of process", | |
| "Sleep and waking", | |
| "Process creation, process killing", | |
| "Signals", | |
| "System boot and init process", | |
| "Traps", | |
| "Setting process priorities" | |
| ] | |
| }, | |
| "UNIT-IV": { | |
| "Inter-process Communication": [ | |
| "I/O Sub system, terminal drives, disk drives", | |
| "Messages, shared memory, semaphores", | |
| "Memory management, swapping, demand paging" | |
| ], | |
| "System Calls and Unix-C Interface": [ | |
| "File handling calls: access(), open(), create(), read(), write(), close(), fseek()", | |
| "Process control system calls: kill(), exec(), fork(), wait(), signal(), exit()", | |
| "Comparing stdio library and calls" | |
| ] | |
| }, | |
| "UNIT-V": { | |
| "System Administration": [ | |
| "Process and Scheduling", | |
| "Security", | |
| "Basic System Administration: Adding a User, User Passwords, Delete of a User, Adding a Group, Deleting a Group, Super User, Startup and Shutdown", | |
| "Advanced System Administration: Managing Disk Space, Backup and Restore, Managing System Services" | |
| ], | |
| "Xwindows": [ | |
| "Introduction to Xwindows concept" | |
| ] | |
| } | |
| }, | |
| "Image Processing": { | |
| "UNIT-I": { | |
| "Digital Image Fundamentals": [ | |
| "Introduction", | |
| "An image model", | |
| "Sampling & quantization", | |
| "Basic relationships between Pixels", | |
| "Imaging geometry" | |
| ] | |
| }, | |
| "UNIT-II": { | |
| "Image Transforms": [ | |
| "Properties of 2 β D Fourier transform", | |
| "FFT algorithm and other separable image transforms", | |
| "Walsh transforms", | |
| "Hadamard, Cosine, Haar, Slant transforms, KL transforms and their properties" | |
| ] | |
| }, | |
| "UNIT-III": { | |
| "Image Enhancement": [ | |
| "Background", | |
| "Enhancement by point processing, histogram processing", | |
| "Spatial filtering and enhancement in frequency domain", | |
| "Color image processing" | |
| ], | |
| "Image Filtering and Restoration": [ | |
| "Degradation model", | |
| "Diagnolisation of circulant and block circulate matrices", | |
| "Algebraic approach to restoration", | |
| "Inverse filtering, least mean squares and interactive restoration", | |
| "Geometric transformations" | |
| ] | |
| }, | |
| "UNIT-IV": { | |
| "Image Compression": [ | |
| "Fundamentals", | |
| "Image compression modes", | |
| "Error free compression, lossy compression", | |
| "Image compression standards" | |
| ], | |
| "Image Segmentation": [ | |
| "Detection of discontinuities, edge linking and boundary detection", | |
| "Thresholding", | |
| "Region β oriented segmentation", | |
| "Use of motion in segmentation" | |
| ] | |
| }, | |
| "UNIT-V": { | |
| "Representation and Description": [ | |
| "Various schemes for representation", | |
| "Boundary descriptors", | |
| "Regional descriptors" | |
| ], | |
| "Image Reconstruction": [ | |
| "Image reconstruction from Projections", | |
| "Radon Transforms", | |
| "Convolution/Filter back β Project Algorithms" | |
| ] | |
| } | |
| }, | |
| "Object Oriented Analysis And Design": { | |
| "UNIT-I": { | |
| "Introduction to OOAD": [ | |
| "Two views of software Developments: SSAD and OOAD", | |
| "Why Object βOrientation?", | |
| "Object and classes", | |
| "Abstraction and encapsulation", | |
| "Methods and Message", | |
| "Interfaces", | |
| "Inheritance and Polymorphism", | |
| "Access Control", | |
| "The Business case for OO Developments" | |
| ], | |
| "Object Oriented Methodologies": [ | |
| "Object Oriented Design β Booch", | |
| "Object Modeling Techniques β Rumbaugh", | |
| "Object β Oriented Analysis β Coad-Yourdan", | |
| "Object β Oriented Software Engineering β Ivar Jacobson" | |
| ] | |
| }, | |
| "UNIT-II": { | |
| "Unified Approach": [ | |
| "Diagramming and Notational Techniques using the UML", | |
| "UML Notation", | |
| "Analysis Diagramming Techniques (Introduction to all ten diagrams)", | |
| "Design Diagramming Techniques", | |
| "Generalization/Specialization, Aggregation and composition, Association, Cardinality, Navigability, Icons, relationships and adornments" | |
| ], | |
| "Development Process": [ | |
| "Rational Unified Process", | |
| "Four Major phases: Inception, Elaboration, Construction, Transition" | |
| ], | |
| "Requirements Engineering": [ | |
| "Problem analysis, Understanding Stockholders need", | |
| "Type of requirements", | |
| "Use-case Model: Writing Requirements" | |
| ] | |
| }, | |
| "UNIT-III": { | |
| "Analysis Phase": [ | |
| "Behavioral Analysis", | |
| "Domain Analysis or Business Object Analysis", | |
| "Use-case Driven Object Oriented analysis: The UML approach", | |
| "Develop use-case Model", | |
| "Use-case Description", | |
| "Documentation, Activity Diagram", | |
| "Identify the classes" | |
| ], | |
| "Class Identification Approaches": [ | |
| "'Noun Phrase' approach", | |
| "'Conman Class Pattern' approach", | |
| "'CRC' approach", | |
| "Use case Driven Approach" | |
| ], | |
| "Relationships": [ | |
| "Containment and Composition, Aggregation, Inheritance", | |
| "SubTypes and IS-A Hierarchies", | |
| "Association and Link Relationships", | |
| "Diagramming System Events" | |
| ] | |
| }, | |
| "UNIT-IV": { | |
| "Design Phases": [ | |
| "Translating Analysis Concept into Design", | |
| "Optimizing classes and Objects: The Multi-tiered Architecture View", | |
| "Mapping System functions to objects", | |
| "Object to Object Visibility", | |
| "Collaboration Diagram", | |
| "Sequential Diagram", | |
| "Specification Class Diagram", | |
| "Specifying Object Interfaces", | |
| "Designing the Data Access layer", | |
| "Design User Interface layer", | |
| "Designing System Interfaces, Controls and Security" | |
| ] | |
| }, | |
| "UNIT-V": { | |
| "Design Refinement": [ | |
| "Designing for Extensibility", | |
| "Design for reusability", | |
| "Portioning class space", | |
| "Checking Completeness and correctness" | |
| ], | |
| "Database Issues": [ | |
| "The Cood Data Management Domain", | |
| "Object Persistence", | |
| "Object-oriented Database Management System", | |
| "Object-Oriented verses Relational Database", | |
| "Mapping object to Relational Data structure" | |
| ], | |
| "Testing": [ | |
| "Introduction to Testing Strategies", | |
| "Impact of Object Orientation on Testing", | |
| "Testing Business Process", | |
| "Design Matrix", | |
| "Discovering reusable pattern" | |
| ] | |
| } | |
| } | |
| } | |
| def main(): | |
| # Header | |
| st.markdown(""" | |
| <div class="main-header"> | |
| <h1>π M.Sc. Computer Science</h1> | |
| <p>Third Semester Syllabus Explorer</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Sidebar | |
| st.sidebar.title("π Navigation") | |
| # Search functionality | |
| search_term = st.sidebar.text_input("π Search Topics", placeholder="Enter topic to search...") | |
| # Paper selection | |
| selected_paper = st.sidebar.selectbox( | |
| "Select Paper", | |
| ["All Papers"] + list(syllabus_data.keys()), | |
| index=0 | |
| ) | |
| # Unit filter | |
| if selected_paper != "All Papers": | |
| units = list(syllabus_data[selected_paper].keys()) | |
| selected_unit = st.sidebar.selectbox( | |
| "Select Unit", | |
| ["All Units"] + units, | |
| index=0 | |
| ) | |
| else: | |
| selected_unit = "All Units" | |
| # Statistics | |
| st.sidebar.markdown("### π Quick Stats") | |
| total_papers = len(syllabus_data) | |
| total_units = sum(len(paper_data) for paper_data in syllabus_data.values()) | |
| total_topics = sum( | |
| len(unit_data) | |
| for paper_data in syllabus_data.values() | |
| for unit_data in paper_data.values() | |
| ) | |
| col1, col2, col3 = st.sidebar.columns(3) | |
| with col1: | |
| st.markdown(f""" | |
| <div class="metric-card"> | |
| <h3>{total_papers}</h3> | |
| <p>Papers</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| with col2: | |
| st.markdown(f""" | |
| <div class="metric-card"> | |
| <h3>{total_units}</h3> | |
| <p>Units</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| with col3: | |
| st.markdown(f""" | |
| <div class="metric-card"> | |
| <h3>{total_topics}</h3> | |
| <p>Topics</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Main content area | |
| if selected_paper == "All Papers": | |
| display_all_papers(search_term) | |
| else: | |
| display_single_paper(selected_paper, selected_unit, search_term) | |
| def display_all_papers(search_term=""): | |
| """Display all papers with search functionality""" | |
| st.markdown("## π All Papers Overview") | |
| for paper_name, paper_data in syllabus_data.items(): | |
| # Check if paper matches search | |
| if search_term and not matches_search(paper_name, paper_data, search_term): | |
| continue | |
| with st.expander(f"π {paper_name}", expanded=False): | |
| display_paper_content_no_expander(paper_data, search_term) | |
| def display_single_paper(paper_name, selected_unit="All Units", search_term=""): | |
| """Display a single paper with optional unit filtering""" | |
| st.markdown(f"## π {paper_name}") | |
| paper_data = syllabus_data[paper_name] | |
| if selected_unit == "All Units": | |
| display_paper_content(paper_data, search_term) | |
| else: | |
| if selected_unit in paper_data: | |
| unit_data = {selected_unit: paper_data[selected_unit]} | |
| display_paper_content(unit_data, search_term) | |
| def display_paper_content_no_expander(paper_data, search_term=""): | |
| """Display content of a paper without nested expanders""" | |
| for unit_name, unit_data in paper_data.items(): | |
| # Check if unit matches search | |
| if search_term and not matches_search_unit(unit_name, unit_data, search_term): | |
| continue | |
| st.markdown(f""" | |
| <div class="unit-card"> | |
| <h3>π {unit_name}</h3> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| for topic_name, topic_items in unit_data.items(): | |
| # Check if topic matches search | |
| if search_term and not matches_search_topic(topic_name, topic_items, search_term): | |
| continue | |
| st.markdown(f"**π {topic_name}**") | |
| for item in topic_items: | |
| # Highlight search terms | |
| if search_term and search_term.lower() in item.lower(): | |
| highlighted_item = item.replace( | |
| search_term, | |
| f"**{search_term}**" | |
| ) | |
| st.markdown(f""" | |
| <div class="topic-item"> | |
| β’ {highlighted_item} | |
| </div> | |
| """, unsafe_allow_html=True) | |
| else: | |
| st.markdown(f""" | |
| <div class="topic-item"> | |
| β’ {item} | |
| </div> | |
| """, unsafe_allow_html=True) | |
| def display_paper_content(paper_data, search_term=""): | |
| """Display content of a paper""" | |
| for unit_name, unit_data in paper_data.items(): | |
| # Check if unit matches search | |
| if search_term and not matches_search_unit(unit_name, unit_data, search_term): | |
| continue | |
| st.markdown(f""" | |
| <div class="unit-card"> | |
| <h3>π {unit_name}</h3> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| for topic_name, topic_items in unit_data.items(): | |
| # Check if topic matches search | |
| if search_term and not matches_search_topic(topic_name, topic_items, search_term): | |
| continue | |
| with st.expander(f"π {topic_name}", expanded=False): | |
| for item in topic_items: | |
| # Highlight search terms | |
| if search_term and search_term.lower() in item.lower(): | |
| highlighted_item = item.replace( | |
| search_term, | |
| f"**{search_term}**" | |
| ) | |
| st.markdown(f""" | |
| <div class="topic-item"> | |
| β’ {highlighted_item} | |
| </div> | |
| """, unsafe_allow_html=True) | |
| else: | |
| st.markdown(f""" | |
| <div class="topic-item"> | |
| β’ {item} | |
| </div> | |
| """, unsafe_allow_html=True) | |
| def matches_search(paper_name, paper_data, search_term): | |
| """Check if paper matches search term""" | |
| search_term = search_term.lower() | |
| # Check paper name | |
| if search_term in paper_name.lower(): | |
| return True | |
| # Check unit and topic content | |
| for unit_data in paper_data.values(): | |
| if matches_search_unit("", unit_data, search_term): | |
| return True | |
| return False | |
| def matches_search_unit(unit_name, unit_data, search_term): | |
| """Check if unit matches search term""" | |
| search_term = search_term.lower() | |
| # Check unit name | |
| if search_term in unit_name.lower(): | |
| return True | |
| # Check topics | |
| for topic_name, topic_items in unit_data.items(): | |
| if matches_search_topic(topic_name, topic_items, search_term): | |
| return True | |
| return False | |
| def matches_search_topic(topic_name, topic_items, search_term): | |
| """Check if topic matches search term""" | |
| search_term = search_term.lower() | |
| # Check topic name | |
| if search_term in topic_name.lower(): | |
| return True | |
| # Check topic items | |
| for item in topic_items: | |
| if search_term in item.lower(): | |
| return True | |
| return False | |
| if __name__ == "__main__": | |
| main() |