🃏 Flashcard Generator

ArticleFlashcardGenerator — 791 lines

Automatically extracts key terms, definitions, and concepts from articles and turns them into study flashcards.

Key Features

API Overview

let generator = ArticleFlashcardGenerator.shared

// Generate flashcards from an article
let cards = generator.generateFlashcards(from: article)

// Create a deck
generator.createDeck(name: "AI Concepts")
generator.addCards(cards, toDeck: "AI Concepts")

// Study mode
let dueCards = generator.getDueCards(deck: "AI Concepts")
generator.markCard(card, difficulty: .medium)

❓ Quiz Generator

ArticleQuizGenerator — 653 lines

Generates comprehension quizzes from article content to test understanding and retention.

Question Types

Features

API Overview

let quizGen = ArticleQuizGenerator.shared

// Generate a quiz from an article
let quiz = quizGen.generateQuiz(from: article, questionCount: 5)

// Access questions
for question in quiz.questions {
    print(question.text)       // "What protocol does RSS use?"
    print(question.options)    // ["HTTP", "FTP", "SMTP", "WebSocket"]
    print(question.answer)     // 0 (index of correct answer)
}

// Submit answers and get score
let result = quizGen.submitQuiz(quiz, answers: userAnswers)
print(result.score)           // 0.8 (80%)
print(result.missed)          // [QuizQuestion] — wrong answers

🔄 Spaced Repetition Review

ArticleSpacedReview — 525 lines

SM-2 algorithm implementation for scheduling article reviews at optimal intervals to maximize long-term retention.

How It Works

  1. Articles are added to the review queue when read
  2. The SM-2 algorithm calculates the next review date based on your recall quality
  3. Easy articles get longer intervals; difficult ones are shown sooner
  4. Over time, intervals grow from days to weeks to months

Review Parameters

ParameterDescription
easeFactorMultiplier for interval growth (starts at 2.5, adjusts per review)
intervalDays until next review (starts at 1)
repetitionNumber of successful reviews
qualitySelf-rated recall quality (0–5 scale)

API Overview

let reviewer = ArticleSpacedReview.shared

// Add article to review queue
reviewer.addForReview(articleLink: article.link)

// Get articles due for review today
let dueArticles = reviewer.getDueItems()

// Record a review (quality: 0=forgot, 3=hard, 5=easy)
reviewer.recordReview(articleLink: article.link, quality: 4)

// Check next review date
let nextDate = reviewer.getNextReviewDate(for: article.link)

🔗 Article Threading

ArticleThreadManager — 375 lines

Link related articles into narrative threads to follow developing stories over time.

Features

API Overview

let threads = ArticleThreadManager.shared

// Create a story thread
let threadId = threads.createThread(title: "AI Regulation Updates")

// Add articles to the thread
threads.addEntry(articleLink: article1.link, toThread: threadId)
threads.addEntry(articleLink: article2.link, toThread: threadId)

// Navigate the thread
let entries = threads.getEntries(forThread: threadId)
// Returns chronologically ordered ThreadEntry objects

📝 Article Version Tracking

ArticleVersionTracker — 610 lines

Detects and tracks changes to articles over time — useful for following corrections, updates, and evolving stories.

Features

API Overview

let tracker = ArticleVersionTracker.shared

// Snapshot current article state
tracker.captureSnapshot(link: article.link,
                        title: article.title,
                        content: article.body)

// Check for changes
let versions = tracker.getVersions(for: article.link)
if versions.count > 1 {
    let diff = tracker.diffVersions(
        old: versions[0], new: versions[1])
    print(diff.additions)    // New content added
    print(diff.removals)     // Content removed
}

🧩 How They Work Together

The learning modules integrate with each other and the rest of FeedReader:

Article Read
    │
    ├── ArticleFlashcardGenerator → Extracts key terms → Flashcard decks
    │                                                         │
    ├── ArticleQuizGenerator ──── → Generates quiz ─────── Score tracking
    │                                                         │
    ├── ArticleSpacedReview ───── → Schedules review ──── Due date queue
    │                                                         │
    ├── ArticleVersionTracker ─── → Captures snapshot ─── Change alerts
    │
    └── ArticleThreadManager ──── → Links to thread ───── Story timeline

Combined Workflow

  1. Read an article — version tracker captures a snapshot
  2. Generate flashcards and a quiz from the content
  3. Add the article to a story thread if it's part of an ongoing narrative
  4. Schedule spaced repetition reviews for long-term retention
  5. Track quiz scores and review performance over time