package
0.0.13
Repository: https://github.com/erikbryant/util-golang.git
Documentation: pkg.go.dev

# README

Utility package

English -> Pig Latin Translation Rules

A word with no characters is unchanged.

  • If a word begins with a vowel sound, do not shift the letters. Note that "xr" and "yt" at the beginning of a word make vowel sounds (e.g. "xray" -> "xrayay", "yttria" -> "yttriaay"). Add 'way' to the end of the word.

  • If a word begins with a consonant sound, move it to the end of the word. Consonant sounds can be made up of multiple consonants, such as the "ch" in "chair" or "st" in "stand" (e.g. "chair" -> "airchay"). If a word starts with a consonant sound followed by "qu", also move the 'u' to the end of the word (e.g. "square" -> "aresquay"). Add 'ay' to the end of the word.

  • If a word contains a "y" after a consonant cluster or as the second letter in a two-letter word the 'y' makes a vowel sound (e.g. "rhythm" -> "ythmrhay", "my" -> "ymay").

# Functions

Cryptoquip returns true if the letter arrangements are similar; e.g., KEEP and LOOT.
IsAnagram returns true if w1 and w2 are anagrams of each other.
IsDigitPermutation returns whether the two numbers are digit permutations of each other.
IsPalindromeInt returns true if the digits of p are a palindrome.
IsPalindromeString returns true if the string is a palindrome.
MakeDigits generates all permutations of the first n digits.