Skip to content

Zabi-01/LexiFix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 LexiFix

A Premium, DSA-Powered Desktop Text Assistant & Interactive Trie Visualizer

Language GUI DSA License


LexiFix is a high-performance, real-time typing companion that demonstrates the practical application of core Data Structures & Algorithms (DSA) in text processing. Built with a responsive, modern light-themed desktop GUI, it provides live prefix matching, spelling suggestions, phrase predictions, state history management, and an interactive tree visualizer.


🎨 Graphical User Interface (GUI) Showcase

The LexiFix interface is split into dynamic, color-coded modular dashboards designed for absolute clarity:

🖥️ Main Editor Workspace

The central workspace containing the real-time editor, dynamic metrics, and modular analysis widgets.

Main Workspace


🌳 Live Trie Visualizer & Dialog Panel

An interactive canvas rendering the prefix tree (Trie) representation of the lexicon. It shows active search paths in blue, terminal words in green, and supports panning and zooming.

Trie Visualizer


🔍 Features Breakdown & Suggestions

Real-time panels for Autocomplete suggestions, spell correction alternatives, and predictive word suggestions.

Trie Autocomplete Spell Corrections Bigram Graph Predictions
Autocomplete Spell Corrections Phrase Suggestions
Retrieves words starting with the typed prefix in O(L) time. Computes Levenshtein edit distance and checks the dictionary using a HashMap. Predicts the next logical word by analyzing transition frequencies in an Adjacency Graph.

🧠 Core Algorithms & Complexity Analysis

LexiFix implements optimized data structures to perform instant checks and predictions as you type:

Engine / Component Underlying Data Structure Key Algorithm Time Complexity Space Complexity
Autocomplete Trie (Prefix Tree) DFS Prefix Retrieval $\mathcal{O}(L)$ $\mathcal{O}(V \times \Sigma)$
Dictionary Validation HashMap Hash-bucket search $\mathcal{O}(1)$ $\mathcal{O}(N)$
Spell Correction Custom Dynamic Array Levenshtein Distance (DP) $\mathcal{O}(M \times N)$ $\mathcal{O}(M \times N)$
Phrase Suggestion Directed Weighted Graph Adjacency Map traversal $\mathcal{O}(1)$ (neighbor fetch) $\mathcal{O}(V + E)$
Undo / Redo Double Stack LIFO State caching $\mathcal{O}(1)$ $\mathcal{O}(S)$

Where:

  • $L$ = Length of the active prefix query
  • $M, N$ = Lengths of compared words
  • $V, E$ = Vertices (words) and Edges (transitions) in the phrase graph
  • $S$ = Size of the history cache stack
  • $\Sigma$ = Alphabet size

📂 Repository Directory Layout

LexiFix/
├── .gitignore
├── README.md
└── LexiFix/
    ├── data/
    │   └── dictionary.txt          # Lexicon database containing default vocabulary
    ├── src/
    │   ├── Main.java               # Application bootstrap class
    │   └── lexifix/
    │       ├── model/
    │       │   ├── TrieNode.java   # Trie node containing character links & flags
    │       │   └── WordEntry.java  # Word wrapper carrying frequency metrics
    │       ├── engine/
    │       │   ├── Trie.java               # Custom prefix tree implementation
    │       │   ├── Dictionary.java         # Lexicon file loader and parser
    │       │   ├── AutocompleteEngine.java # Prefix search processor
    │       │   ├── SpellChecker.java       # Direct verification engine
    │       │   ├── SpellCorrectEngine.java # Dynamic Programming corrector
    │       │   ├── SuggestionEngine.java   # Word recommendation interface
    │       │   ├── BigramGraph.java        # Adjacency Graph for phrase predictions
    │       │   └── UndoRedoManager.java    # State cache double-stack manager
    │       └── ui/
    │           ├── LexiFixGUI.java         # Main Java Swing window application
    │           └── TrieVisualizerPanel.java# Live graphics panel rendering the Trie
    ├── run.bat                     # Windows CLI compiler and launch script
    └── run.sh                      # Unix/macOS CLI compiler and launch script

🚀 How to Build & Run Locally

Prerequisites

  • Java Development Kit (JDK) 11 or higher must be installed on your machine and available in your environment variables.

💻 Windows Command Line

Double-click the run.bat file in the LexiFix folder or launch it from PowerShell/CMD:

cd LexiFix
run.bat

🍎 macOS & Linux Terminal

Give execution permissions to the script, then execute it:

cd LexiFix
chmod +x run.sh
./run.sh

✨ Design & Optimization Highlights

  • 🎨 Harmonic Color Palette: Sleek, low-contrast, light-themed panels built with curated HSL colors to ensure visual balance.
  • ⚡ Debounced Inputs: Integrated javax.swing.Timer debounces input queries (120ms) to ensure the interface updates smoothly without lag during quick typing.
  • 📏 Dynamic DPI Scaling: An interactive font slider ($10\text{px} - 28\text{px}$) that programmatically resizes layouts, buttons, card panels, and scrollbars on the fly.
  • ⌨️ Keyboard Hotkeys: Full compatibility with standard productivity bindings: Ctrl + Z for undo states and Ctrl + Y for redo states.

🎓 Academic Credit

Developed as a semester project for the CSC211 Data Structures and Algorithms course.

About

LexiFix is a modern desktop application that showcases the power of fundamental Data Structures and Algorithms (DSA) in text processing. Designed with a clean, responsive light-themed GUI, it functions as a real-time typing companion, offering instant autocomplete, dynamic spelling corrections, phrase predictions, and visual tree tracing.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages