Giter Site home page Giter Site logo

piglatin's Introduction

Overview

This repository contains a python package to perform english to pig latin translations based on the rules below.

The install below will create an executable and you can then start the server locally.

Installation

OSX and Linux

git clone https://github.com/steve-federowicz/piglatin.git
pip install ./piglatin

Usage

From command line

piglatin 'Hello, World!'

Via python API

from piglatin import translator

translator.translate_phrase('Hello, World!')

Optionally, you can run the flask server via the following commands and then access the web UI locally at localhost:5000

export FLASK_APP=$(pwd)/piglatin/piglatin/server.py
flask run

Pig Latin Rules

  1. General rule: take the first letter of a word, move it to the end, and add "ay". Example: "hello" becomes "ellohay".

  2. A phrase with multiple words should translate each word: "hello world" becomes "ellohay orldway"

  3. A word which begins with a vowel keeps its first letter, and just adds "way" to the end of the word: "eat apples" becomes "eatway applesway"

  4. A word which is capitalized should remain capitalized after translation: "Hello world" becomes "Ellohay orldway"

  5. A phrase with punctuation should maintain the position of the punctuation: "Hello, world!" becomes "Ellohay, orldway!"

  6. A word beginning with multiple consonants should move all of them together to the end: "drunk strangers" becomes "unkdray angersstray"

  7. The letters "qu" should stay together when moved to the end of a word: "quickly and quietly" becomes "icklyquay andway ietlyquay"

piglatin's People

Contributors

steve-federowicz avatar sfederow avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.