suffixVowel
untyped stringValue
"way"
suffixConsonant
untyped stringValue
"ay"
isVowel
func(r int32) bool- OID
- 04c4d7…7cde:3
isVowel details
isLetter
func(r int32) boolisLetter reports whether r is an ASCII/unicode letter (word character).
- OID
- 04c4d7…7cde:5
isLetter details
translateWord
func(word string) stringtranslateWord converts a single "core" alphabetic word (no surrounding punctuation) to Pig Latin, preserving its capitalization pattern.
- OID
- 04c4d7…7cde:6
translateWord details
applyCase
func(orig string, translated string) stringapplyCase re-applies the capitalization shape of the original word to the translated word. Two common shapes are handled: ALL CAPS and Title-case; everything else is returned lowercase.
- OID
- 04c4d7…7cde:7
applyCase details
splitAffixes
func(token string) (string, string, string)splitAffixes separates a token into (leading punctuation, core word, trailing punctuation) where the core is the contiguous run of letters (apostrophes inside are kept as part of the core, e.g. "don't").
- OID
- 04c4d7…7cde:8
splitAffixes details
TranslateToken
func(token string) stringTranslateToken translates a single whitespace-delimited token, preserving any punctuation glued to its edges.
- OID
- 04c4d7…7cde:9
TranslateToken details
Translate
func(sentence string) stringTranslate applies Pig Latin to every word in the sentence while preserving the original whitespace between words.
- OID
- 04c4d7…7cde:10
Translate details
Render
func(path string) stringRender is the gnoweb entrypoint (Markdown). Root explains the rules; any other path is treated as a sentence to translate, e.g. Render("/Hello world").
- OID
- 04c4d7…7cde:11