Realm

v1

gno.land/r/moul/x/daily/piglatindemo/v1

Render

Pig Latin

Demo of the p/moul/x/daily/piglatin library — a tiny port of the classic Pig Latin translator (the go-to beginner exercise). Pure strings/unicode, fully deterministic.

Rules

  1. Word starts with a vowel → append way. appleappleway
  2. Word starts with consonant(s) → move the leading consonant cluster to the end, then add ay. stringingstray
  3. y is a consonant only as the first letter (yellowellowyay); otherwise a vowel (mythythmay).
  4. Capitalization is preserved: HelloEllohay, NASAASANAY.
  5. Punctuation glued to a word stays put: Hello,Ellohay,.

Try it

Append a sentence to the path — spaces are fine:

Examples

InputPig Latin
pigigpay
bananaananabay
smileilesmay
eateatway
yellowellowyay
mythythmay
Hello,Ellohay,
GNOOGNAY

Source (qfile)

README.md
gnomod.toml
piglatindemo.gno