util

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 1 Imported by: 1

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").

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cryptoquip

func Cryptoquip(w1, w2 string) (map[byte]byte, bool)

Cryptoquip returns true if the letter arrangements are similar; e.g., KEEP and LOOT

func IsAnagram

func IsAnagram(w1, w2 string) bool

IsAnagram returns true if w1 and w2 are anagrams of each other

func IsDigitPermutation added in v0.0.7

func IsDigitPermutation(a, b int) bool

IsDigitPermutation returns whether the two numbers are digit permutations of each other

func IsPalindromeInt

func IsPalindromeInt(p []int) bool

IsPalindromeInt returns true if the digits of p are a palindrome

func IsPalindromeString

func IsPalindromeString(p string) bool

IsPalindromeString returns true if the string is a palindrome

func MakeDigits

func MakeDigits(n int, c chan []int)

MakeDigits generates all permutations of the first n digits

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL