Skip to content

About

A full-stack linguistic intelligence suite & forensic reporting tool. Features a "Dual-Engine" architecture (Django + DuckDB) for real-time text analysis, global etymology mapping, and persistent history storage.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

πŸ“š Word Counter Vault β€” Full-Stack Linguistic Analysis Suite


An interactive intelligence dashboard and automated reporting tool built to analyse linguistic patterns and global etymology. This project transforms raw text input into actionable forensic insights using a modern Python stack.


πŸ“‘ Table of Contents


🧠 Why This Project Was Built

This project was built to explore text analysis beyond simple word counts. It combines linguistic analysis, readability scoring, word origins, geospatial visualisation, and automated reporting into a single application, while serving as a practical showcase of modern Python and Django development.


πŸŽ₯ Project Walkthrough

Click here

Watch the Demo on LinkedIn

Note: Click the badge above to view the full feature walkthrough and linguistic analysis demo on LinkedIn.


πŸ“Έ Screenshots

See the full gallery here:

Click to expand screenshots
  • Analysis view after inputting text into the text box Main Dashboard Main Dashboard

  • Geographic map of where words originate from. Main Dashboard Map Main Dashboard Map

  • login view screen Main Login

  • PDF report PDF Report
  • Word document report Word Document

  • Top ten most common words identified from the text input Chart View

  • In Depth view of entered text In-Depth UI

  • Text Analysis history view Main Dashboard

  • Delete Buttons View Delete Buttons

  • Readability Score Guide
  • Flesch Reading Ease (0–100 scale): High score: Easy to read (plain English, blogs, general audiences). Low score: Very difficult (dense academic or legal texts).
  • Gunning Fog Index (Years of education required): High score: Advanced professional/college level (requires 16+ years of education). Low score: Mass-market, accessible level (high school or below). Flesch_score & Gunning_fog

  • Comparative Analysis with hover tooltips displaying information. Comparison screenshot Comparative Analysis Comparative Analysis

  • Custom Stopword Management UI: Dedicated interface for adding and managing personal stopword lists to tailor text analysis and filtering. Custom Stopwords for users


πŸ“ Project Architecture

Word-Counter-Vault/
β”‚
β”œβ”€β”€ manage.py                    # Django entry point
β”œβ”€β”€ pyproject.toml               # Project dependencies and configuration
β”œβ”€β”€ .env.example                 # Example environment variables
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”‚
β”œβ”€β”€ wordcounterapp/              # Django project configuration
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ settings.py              # Global settings
β”‚   β”œβ”€β”€ urls.py                  # Root URL routing
β”‚   β”œβ”€β”€ asgi.py
β”‚   └── wsgi.py
β”‚
β”œβ”€β”€ counter/                     # Main application
β”‚   β”‚
β”‚   β”œβ”€β”€ models.py                # Database models
β”‚   β”œβ”€β”€ views.py                 # Request handlers
β”‚   β”œβ”€β”€ urls.py                  # App URL routes
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ apps.py
β”‚   └── tests.py
|   |
β”‚   β”œβ”€β”€ management/
|   |    β”œβ”€β”€ commands/
β”‚   |        └── seed_stress_data.py
|   |
|   |
β”‚   β”œβ”€β”€ migrations/              # Django database migrations
β”‚   β”‚   β”œβ”€β”€ 0001_initial.py
β”‚   β”‚   └── 0002_analysisrecord_bullets_and_more.py
β”‚   β”‚
β”‚   β”œβ”€β”€ services/                # Business logic layer
β”‚   β”‚   β”œβ”€β”€ analysis.py
β”‚   β”‚   β”œβ”€β”€ exporters.py
β”‚   β”‚   β”œβ”€β”€ quality_insights.py
β”‚   β”‚   β”œβ”€β”€ summariser.py
β”‚   β”‚   β”œβ”€β”€ text_extractors.py
β”‚   β”‚   β”œβ”€β”€ word_selectors.py
β”‚   β”‚   β”œβ”€β”€ seed_origins.py
β”‚   β”‚   └── word_data.json
β”‚   β”‚
β”‚   β”œβ”€β”€ templates/               # HTML templates
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ counter/
β”‚   β”‚   β”‚   β”œβ”€β”€ analysis.html
β”‚   β”‚   β”‚   β”œβ”€β”€ base.html
β”‚   β”‚   β”‚   β”œβ”€β”€ compare.html
β”‚   β”‚   β”‚   β”œβ”€β”€ counter.html
β”‚   β”‚   β”‚   β”œβ”€β”€ history.html
β”‚   β”‚   β”‚   └── stopwords.html
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ registration/
β”‚   β”‚   β”‚   β”œβ”€β”€ login.html
β”‚   β”‚   β”‚   └── register.html
β”‚   β”‚   β”‚
β”‚   β”‚   └── export/
β”‚   β”‚       └── pdf_template.html
β”‚   β”‚
β”‚   └── static/
β”‚       └── counter/
β”‚           β”œβ”€β”€ css/             # Dashboard styling
β”‚           └── img/             # UI assets
β”‚
β”œβ”€β”€ tests/                       # Pytest test suite
β”‚   β”œβ”€β”€ conftest.py
β”‚   β”œβ”€β”€ test_analysis.py
β”‚   β”œβ”€β”€ test_exporters.py
|   β”œβ”€β”€ test_extractors.py
|   β”œβ”€β”€ test_quality_insights.py
|   β”œβ”€β”€ test_seed_origins.py
|   β”œβ”€β”€ test_summariser.py
|   β”œβ”€β”€ test_text_extractors.py
|   β”œβ”€β”€ test_vault.py
|   β”œβ”€β”€ test_views.py
β”‚   └── test_word_selectors.py
β”‚
β”œβ”€β”€ screenshots/                 # README screenshots
β”‚   β”œβ”€β”€ user_UI.png
β”‚   β”œβ”€β”€ user_UI2.png
β”‚   β”œβ”€β”€ chart.png
β”‚   β”œβ”€β”€ map.png
β”‚   β”œβ”€β”€ pdf_report.png
β”‚   └── ...
β”‚
└── analysis/                    # Generated analysis artifacts
    β”œβ”€β”€ metadata.json
    β”œβ”€β”€ hashes.json
    └── remaining/

πŸ“ File Structure

  • word_counter/settings.py: Core configuration for the Django environment.
  • counter/views.py: Logic for text processing, regex normalisation, and dashboard rendering.
  • counter/services/seed_origins.py: Data pipeline script for ingesting the global word library.
  • counter/services/word_data.json: The "Source of Truth" containing 500+ global etymology records.
  • word_vault_analytics.duckdb: High-performance database for geospatial word lookups.

🧰 Tech Stack

  • Python 3.12 (Development Environment)
  • Django 5.2: For the web framework and user authentication.
  • DuckDB: For high-performance, local analytical etymology queries.
  • SQLite: For persistent user history and session management.
  • Folium/Leaflet: For interactive geospatial mapping.
  • WeasyPrint / python-docx: For automated forensic report creation.
  • Regex: For high-speed text normalisation and cleaning.

βš™οΈ Installation & Local Usage

To run this project locally:

  1. Clone the repo: git clone https://github.com/reory/Word-Counter-Vault.git
  2. Install dependencies: uv sync
  3. Seed the Global Vault: python -m counter.services.seed_origins
  4. Launch the app: python manage.py runserver

πŸ§ͺ Stress Testing & Database Seeding

This project includes a custom Django management command powered by Faker to generate synthetic AnalysisRecord entries for performance and load testing.

Running the Seeder

To populate your local vault with synthetic records, run:

python manage.py seed_stress_data --count 500

πŸ§ͺ Quality Assurance & Testing

This project implements a comprehensive automated testing suite using Pytest to ensure data integrity and security across the analytical pipeline.

Test Coverage:

  • Linguistic Logic: Validates regex normalisation, word frequency calculations, and lexical diversity metrics.
  • Security & Permissions: Ensures strict object-level access control (e.g., users cannot view or delete others' analysis history).
  • Service Layer & Mocking: Utilises pytest-mock to simulate DuckDB OLAP connections, allowing for high-speed testing without disk I/O dependency.
  • File Extraction: Verifies robust handling of .txt, .pdf, and .docx uploads using Django's SimpleUploadedFile.

Running Tests Locally:

uv run pytest

πŸ™ Acknowledgments

  • Etymology Sources: Online Etymology Dictionary for root-word tracking.
  • Community: Thanks to the Django and DuckDB communities for the robust library support.

πŸ›£οΈ Roadmap Features

  • Core Architecture: Dual-Engine (Django + DuckDB) setup.
  • Forensic Reporting: PDF/WORD export functionality for text analysis.
  • User Accounts: Private storage for linguistic history.
  • Data Seeding: Integration with Faker for large-scale stress testing.
  • Readability Metrics: Add Flesch Reading Ease, and Gunning Fog Index calculations for deeper writing quality assessment.
  • Comparative Analysis: Compare two text submissions side-by-side to identify differences in vocabulary, lexical diversity, readability, and writing style.
  • Custom Stopword Management: Allow users to create personal stopword lists to exclude common or domain-specific words from analysis results.
  • Analysis Tags & Collections: Enable users to organiae saved analyses into categories, folders, or tagged collections for improved vault management.
  • Interactive Word Trends: Track frequently used words across a user's analysis history to visualise vocabulary evolution over time.
  • Enhanced Geospatial Mapping: Interactive etymology origins via Plotly/Mapbox.

Built By Roy Peters 😁 LinkedIn

About

A full-stack linguistic intelligence suite & forensic reporting tool. Features a "Dual-Engine" architecture (Django + DuckDB) for real-time text analysis, global etymology mapping, and persistent history storage.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages