Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

πŸ“Œ Overview A C++ implementation of an auto-complete system using the Trie data structure. This project provides real-time word suggestions as the user types, with multiple sorting options (frequency, length, lexicographical order). It supports dynamic dictionary updates, case insensitivity, and robust error handling.

✨ Features βœ” Prefix-based suggestions – Get word completions in real-time. βœ” Multiple sorting methods:

Frequency-based (most searched words first)

Shortest-first (BFS traversal)

Lexicographical order (DFS traversal) βœ” Dynamic dictionary management:

Add new words

Delete existing words

Auto-save changes to file βœ” Case-insensitive matching – Works with "Car", "CAR", or "car". βœ” Exact match highlighting – Bold or colorize exact matches. βœ” Error handling – Handles invalid inputs gracefully.

πŸ“‚ Project Structure AutoComplete_Project/ β”œβ”€β”€ src/ # Source code

β”‚ β”œβ”€β”€ Trie.cpp # Trie implementation

β”‚ β”œβ”€β”€ Trie.h # Trie header

β”‚ β”œβ”€β”€AppStart.cpp # Core logic

β”‚ β”œβ”€β”€AppStart.h #Core header

β”‚ β”œβ”€β”€ AutoComplete.cpp #The main function

β”‚ β”œβ”€β”€ main.cpp # CLI interface

β”œβ”€β”€ data/ # Dictionary files

β”‚ └── dictionary.txt # Default word list

β”‚ └── searchedWord.txt # The words that the user searched about

└── README.md # This file

  1. Entering a Prefix Enter a prefix: ca Choose sorting method:

  2. Frequency (default)

  3. Shortest-first (BFS)

  4. Lexicographical (DFS) => 2
    Output: car cat care cart

  5. Adding/Deleting Words Options:

  6. Search suggestions

  7. Add a word

  8. Delete a word

  9. Display Dectionary

2 Enter word to add: coffee "coffee" added successfully!

πŸ”§ Extending the Project

  • GUI Integration: Use Qt or ImGui for a graphical interface.
  • Persistent Frequency Tracking: Store word frequencies in a file.
  • Multilingual Support: Extend for non-English characters.

🀝 Contributers

  • Gehad Ebrahim
  • Tassnim Shellah
  • Habiba Osama
  • Lina Hisham
  • Dalia Ahmed
  • Sondos Khalid
  • Sara Mohsen

⭐ Star this repo if you find it useful! πŸ”— Share with others who might benefit!

πŸ” Why Trie? The Trie data structure is ideal for auto-complete because: βœ… Fast prefix searches – O(L) where L is the length of the prefix. βœ… Memory-efficient – Shares common prefixes among words. βœ… Scalable – Handles large dictionaries efficiently.

About

A C++ implementation of an auto-complete system using Trie data structure with multiple traversal methods (BFS, DFS) and dynamic dictionary management. The program suggests word completions in different orders (frequency, length, lexicographical) and handles case insensitivity, exact match highlighting, and robust error handling.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors