Skip to content

Blessed-Femi/go-reloaded

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Text Auto-Correction Tool 📌 Overview

This project is a text processing tool written in Go that reads a text file, applies a series of transformations and corrections, and writes the improved version into another file.

It combines concepts such as string manipulation, parsing, formatting, and modular programming to build a simple text editor / auto-correction engine.

🎯 Objectives

The goal of this project is to:

Reuse previously built functions Build a command-line text processing tool Apply multiple transformations to a given text Follow good coding practices

⚙️ How It Works

The program takes two arguments:

Input file (text to process) Output file (processed result) ▶️ Execution go run . sample.txt result.txt

🔄 Features & Transformations

  1. 🔢 Number Conversions Hexadecimal → Decimal Converts a hexadecimal number before (hex) into decimal Example:

Input: 1E (hex) files were added Output: 30 files were added

Binary → Decimal Converts a binary number before (bin) into decimal Example:

Input: It has been 10 (bin) years Output: It has been 2 years

  1. 🔤 Case Transformations Uppercase (up) Converts the previous word to uppercase Input: go (up) Output: GO Lowercase (low) Converts the previous word to lowercase Input: STOP (low) Output: stop Capitalize (cap) Capitalizes the previous word Input: bridge (cap) Output: Bridge

  2. 🔁 Multi-word Transformations

If a number is specified:

(up, N) → last N words uppercase (low, N) → last N words lowercase (cap, N) → last N words capitalized

Example:

Input: This is amazing (up, 2) Output: This is AMAZING

  1. ✏️ Punctuation Formatting Rules: Punctuation marks . , ! ? : ;: Must be attached to the previous word Must have one space after

Example:

Input: Hello ,world ! Output: Hello, world! Multiple punctuation (groups) Keep grouped punctuation together Input: Wait ... What !? Output: Wait... What!?

  1. 🔤 Single Quotes Handling ' Rules: Quotes always come in pairs No spaces inside quotes

Examples:

Input: ' word ' Output: 'word' Input: ' multiple words here ' Output: 'multiple words here'

  1. 🔡 Article Correction (a → an) Replace "a" with "an" when the next word starts with: a vowel (a, e, i, o, u) or 'h'

Example:

Input: A apple Output: An apple Input: a house Output: an house

📂 Project Structure Go-Reloaded/ │── Tree #Contains Transformation functions │──article.go │──caseSensitive.go │──toDecimal.go │──toPuntuate.go
│── go mod # Project module │── main.go # Execute functions │── sample.txt # Sample input │── result.txt # Sample output
│── README.md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages