A small Python program that converts English sentences into Pig Latin.
This repository contains a simple Pig Latin translator written for a class exercise. The script reads a sentence from the user, removes punctuation, and converts each word into Pig Latin before printing the result.
Features
- Simple CLI: Prompts the user for a sentence and prints Pig Latin output. π·
- Punctuation-safe: Strips punctuation before translation. βοΈ
- Handles words without vowels: Appends
aywhen no vowel is present. π€ - Vowel-first rule: Adds
yaywhen a word begins with a vowel. π΅ - Clear, single-file implementation: Easy to read and modify. π
Installation
- Prerequisites: Python 3.8 or newer installed. Use
python --versionto check. - Clone or download this repository into a directory on your machine.
Step-by-step (bash):
# clone (if applicable)
git clone https://github.com/AshMax425/PigLatin.git
# (Optional) create a virtual environment
python -m venv .venv
source .venv/bin/activate
source venv/Scripts/activate # on Windows
Usage
Quick start:
python PigLatinTranslator.py
# then type: Hello, world!
# Output: Your sentence in Pig Latin is: ellohay orldwayCode examples / common use cases:
Run interactively (default behavior)
python PigLatinTranslator.py
# Enter: This is a test.
# Output: Your sentence in Pig Latin is: isthay isyay ayay esttay
**API Overview**
- **`PigLatinTranslator.py`**: Single-file script used as a CLI. Contains `main()` which prompts for input, strips punctuation, converts words to Pig Latin, and prints the result.
Full documentation: This is a small class assignment; no separate docs are included.
**Contributing**
- Fork the repository, create a feature branch, and open a pull request. For small improvements (tests, refactor to expose `translate()`), include a short description and an example.
**Contact**
- **Name**: Ashley Maxam
- **Email**: s-ashley.maxam@lwtech.edu
- **Repository**: `https://github.com/AshMax425/PigLatin.git`