Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

C++23 Text Editor with Real-Time Spell-Checking & Autocomplete

A custom, lightweight text editor built from scratch in C++23 using Raylib. The project demonstrates custom implementations of essential computer science data structures (Trie, Gap Buffer, and Min-Heap) to deliver real-time fuzzy text completion and efficient text manipulation.


📸 Key Features

  • Real-Time Autocomplete & Spell-Checking: Dynamically suggests word completions as you type using Levenshtein edit distance logic.
  • Custom Gap Buffer Implementation: Fast localized insertion and deletion operations around the cursor.
  • Custom Trie Dictionary: Fast prefix lookups and fuzzy searches using custom C++ ranges-compatible iterators.
  • Custom Min-Heap: Efficiently prioritizes and retrieves top dictionary suggestions based on edit costs.
  • Rich Keyboard Shortcuts & Controls:
    • Up / Down Arrows: Navigate popup suggestions or move text line-by-line.
    • Enter: Select and insert highlighted suggestion (or insert a newline when no suggestion is active).
    • Ctrl + Backspace: Delete whole word blocks.
    • Ctrl + Left / Right: Jump across entire word blocks.
    • Ctrl + Mouse Wheel / Numpad + / -: Scale rendering font size dynamically.
    • Ctrl + V: Clipboard insertion directly into the gap buffer.

🏗️ Architecture & Data Structures

Structure File Description
Trie Node-based prefix tree acting as the primary dictionary database. Features a custom DFS Levenshtein distance search (searchImpl) and PreOrderIterator satisfying std::input_or_output_iterator.
Gap Buffer High-performance text buffer handling insertion, deletion, and cursor movements by managing an internal dynamic "gap" region with a custom contiguous-like iterator.
Min-Heap Array-based min-heap tournament structure used for ranking search results by edit distance.
Text Editor & GUI Raylib-powered rendering pipeline handling fonts, line wrapping, cursor blinking, and context popup positioning.

🚀 Building & Running

Prerequisites

  • Compiler: Modern C++ compiler supporting C++23 (GCC 13+, Clang 16+, or MSVC 2022+).
  • Build System: CMake version 3.15 or higher.
  • Internet Connection: Required on the initial CMake run to automatically download Raylib 5.0 via FetchContent.

Assets Setup

Before running the application, ensure the following asset files are present in the project folder or executable working directory:

  • rijeci.txt – Dictionary text file containing list of words for the Trie lookup.
  • IntelOneMono-Regular.ttf – TTF font file for text rendering.

Build Steps

  1. Clone the repository:

    bash git clone git@github.com:Sebo1411/spellchecker.git cd spellchecker

  2. Configure with CMake:

    mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release

  3. Compile: cmake --build .

  4. Run: ./seminar

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages