Skip to content

A powerful CLI text processor in Go that transforms text files with smart case conversions, number base changes (binary/hex to decimal), intelligent grammar corrections, and automated punctuation formatting.

Notifications You must be signed in to change notification settings

TanakAiko/go-reloaded

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Reloaded

Go Git

✨ A Powerful Text Processing Tool ✨

Transform your text files with ease using smart case conversions, number base transformations, and intelligent formatting!


📖 Overview

Welcome to Go-Reloaded!

This command-line text processor is designed to make your life easier by automating tedious text transformations. Simply provide an input file, and watch as Go-Reloaded applies sophisticated transformations to produce beautifully formatted output. Whether you need case conversions, number base changes, or smart grammar corrections, we've got you covered!

✨ Features

Simple Transformations

  • Case Conversions: Convert text to uppercase (up), lowercase (low), or capitalize (cap)
  • Number Base Conversions:
    • Binary to decimal (bin)
    • Hexadecimal to decimal (hex)

Complex Transformations

  • Batch Case Conversions: Apply case changes to multiple previous words
    • (up, n) - Convert the last n words to uppercase
    • (low, n) - Convert the last n words to lowercase
    • (cap, n) - Capitalize the last n words

Smart Formatting

  • Grammar Correction: Automatically converts "a" to "an" before vowels and 'h'
  • Punctuation Formatting: Proper spacing around punctuation marks
  • Quote Handling: Intelligent single quote placement and formatting
  • Space Normalization: Removes unnecessary spaces while preserving proper formatting

🛠️ Installation

Prerequisites

  • Go 1.19 or higher

Setup

1️⃣ Clone the repository:

git clone <repository-url>
cd go-reloaded

2️⃣ Initialize the Go module:

go mod tidy

3️⃣ Build the application:

cd goReloadedMain
go build -o go-reloaded main.go

🎮 Usage

Basic Command

./go-reloaded <input_file> <output_file>

Example

./go-reloaded sample.txt result.txt

📚 Transformation Examples

Simple Transformations

Input:

hello world (up)
GOODBYE WORLD (low)
welcome home (cap)
1010 (bin)
A1 (hex)

Output:

hello WORLD
GOODBYE world
welcome Home
10
161

Complex Transformations

Input:

This is so exciting (up, 2)
I was thinking about Betty (cap, 1)

Output:

This is SO EXCITING
I was thinking about Betty

Grammar Correction

Input:

There it was a amazing day
I need a hour to complete this

Output:

There it was an amazing day
I need an hour to complete this

📂 Project Structure

go-reloaded/
├── goReloadedMain/
│   ├── main.go           # Main application logic and text processing
│   ├── sample.txt        # Sample input file
│   └── result.txt        # Output file
├── storage/              # Storage utilities package
│   ├── binToDec.go      # Binary to decimal conversion
│   ├── hexToDec.go      # Hexadecimal to decimal conversion
│   ├── getTxt.go        # File reading functionality
│   └── getSizeFile.go   # File size utility
├── go.mod               # Go module definition
├── go.sum               # Module dependencies
└── README.md            # This file

⚠️ Error Handling

The application includes comprehensive error handling:

  • File existence validation
  • Number conversion error checking
  • Graceful exit on invalid inputs
  • Informative error messages in French

📦 Dependencies

  • golang.org/x/text v0.13.0 - Text processing utilities (indirect dependency)
  • Standard library packages: fmt, os, strconv, strings

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

💡 Tips & Tricks

  • Always check that your input and output files exist before running
  • Use the debug mode by uncommenting print statements in main.go to see intermediate steps
  • Test transformations on sample text before processing important files
  • Combine multiple transformations for powerful text processing!

⭐ Star this repository if you found it helpful! ⭐

Made with ❤️ from 🇸🇳

About

A powerful CLI text processor in Go that transforms text files with smart case conversions, number base changes (binary/hex to decimal), intelligent grammar corrections, and automated punctuation formatting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages