# Book Statistics — "Introduction to Programming in Java: Learning with Chatbots"

## Overview

The complete book is organized into **3 parts** and **Appendices**, with **25 `.qmd` source files** (including `index.qmd` and appendices) and **40 compilable Java example files**.

### Distribution by Part

| Part | Title | Chapters |
|------|-------|----------|
| I | Fundamentals Applied to the Chatbot | 10 |
| II | Object-Oriented Programming and Project Evolution | 6 |
| III | Chatbots and Natural Language Processing | 6 |
| — | Index + Appendices | 3 |
| **Total** | | **25** |

## Part I: Fundamentals Applied to the Chatbot

Chapters:
1. Getting Started with Java
2. Variables and Types
3. Conditionals
4. Loops
5. Methods
6. Arrays
7. Collections and Lists
8. Classes and Objects
9. Error Handling
10. Console Chatbot

## Part II: Object-Oriented Programming and Project Evolution

Chapters:
1. Object-Oriented Design
2. Inheritance
3. Interfaces and Polymorphism
4. Generics and Collections
5. Testing and Refactoring
6. Final Project: TutorJavaBot

## Part III: Chatbots and Natural Language Processing

Chapters:
1. Introduction to Chatbots and the Legacy of ELIZA
2. Text Processing with Regular Expressions
3. Intents and Entities: Understanding the User
4. Stateful Chatbots: Maintaining Context
5. Database Integration
6. Final Project: Advanced Chatbot

Topics covered:
- History of chatbots and ELIZA
- EchoBot implementation
- Smalltalk with predefined responses
- Randomized responses
- Distinguishing questions from statements
- Regular expressions for text processing
- Key phrase extraction
- Grammatical pronoun replacement
- Intent classification
- Entity extraction
- Word vectors and similarity
- Finite state machines
- Pending actions
- Incremental slot filling
- Negation detection
- SQLite integration via JDBC
- Prepared statements for SQL injection prevention
- Natural language to SQL translation
- Complete layered chatbot architecture

## Java Examples

All **40 compilable Java files** are organized under `examples/src/`:

### Parts I & II (`examples/src/`)
- `Chapter01FirstProgram.java` through `Chapter16Project.java` (16 files)

### Part III (`examples/src/part3/`)
- Chapter 1: `EchoBot.java`, `ImprovedEchoBot.java`, `SmalltalkBot.java`, `VariedBot.java`, `QuestionBot.java`
- Chapter 2: `BasicRegex.java`, `PhraseExtraction.java`, `PronounReplacer.java`, `FullEliza.java`
- Chapter 3: `IntentClassifier.java`, `EntityExtractor.java`, `MessageProcessor.java`
- Chapter 4: `CoffeeOrderBot.java`
- Chapter 5: `CreateDatabase.java`, `DatabaseExample.java`, `SafeQuery.java`

### Part III Advanced Project (`examples/src/part3/chatbot/`)
- `ChatbotApp.java`, `ChatbotController.java`, `DatabaseManager.java`, `EntityExtractor.java`, `IntentClassifier.java`, `MessageProcessor.java`, `ResponseGenerator.java`, `StateManager.java`

## Validation

1. Validate all Java examples: `./scripts/validate-examples.ps1`
2. Render HTML: `quarto render --to html`
3. Verify chapter navigation and links.
