CodeRigor

COURSE / REAL PRACTICE

Search your own documents

Build and evaluate a local Python search engine: stable document IDs, Unicode tokens, inverted indexes, ranked results and retrieval metrics.

Lessons & exercises7 authored lessons3 units
Start with the first lesson.

Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.

What you’ll work toward

Build a complete searchable-notes CLI with explicit tokenization, an inverted index, deterministic TF–IDF-style ranking, bounded plain-text snippets and a reproducible relevance evaluation.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

This course builds on these skills:

Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.

A look inside the first lesson

Document identity and a reproducible corpus

Python
ids = ['A', 'a', 'A']
print(len(ids), len(set(ids)))
print(' a ' == 'a')

Your lesson sequence

Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.

UNIT 013 lessons Documents, terms and postings
  1. LESSON 01.01

    Document identity and a reproducible corpus

    Validate a small document corpus, keep opaque IDs separate from searchable text, and preserve a stable snapshot for evaluation.

    Open lesson
  2. LESSON 01.02

    One token policy for documents and queries

    Apply explicit Unicode normalization and case folding, preserve token multiplicity, and use the same boundaries for queries and documents.

    Open lesson
  3. LESSON 01.03

    An inverted index with counts and document lengths

    Map each term to the documents that contain it, count occurrences per document, and retain empty documents in corpus statistics.

    Open lesson
UNIT 023 lessons Ranking, presentation and measurement
  1. LESSON 02.01

    Rank matches with frequency and rarity

    Combine length-normalized term frequency with a stated smoothed rarity weight, deduplicate query terms, and order ties by document ID.

    Open lesson
  2. LESSON 02.02

    Stable result records and bounded plain-text snippets

    Join ranked IDs back to the corpus, preserve their order, and build compact plain-text previews without treating document text as HTML.

    Open lesson
  3. LESSON 02.03

    Evaluate retrieval with labeled queries

    Measure precision at a stated cutoff, recall and reciprocal rank against independent relevance labels, including empty and incomplete-result cases.

    Open lesson
UNIT 031 lesson Searchable notes capstone
  1. LESSON 03.01

    Capstone: a complete searchable notes tool

    Compose corpus validation, indexing, ranking and plain-text results; run the downloadable CLI and evaluate it against bundled relevance judgments.

    Open lesson