package igpay import "strings" func PigLatin(s string) string { var ret []string for _, v := range strings.Fields(s) { if len(v) < 3 { ret = append(ret, v) continue } switch v[:3] { case "squ", "sch", "thr": ret = append(ret, v[3:]+v[:3]+"ay") continue } switch v[:2] { case "ch", "qu", "th", "sq": ret = append(ret, v[2:]+v[:2]+"ay") continue case "ye", "xe": ret = append(ret, v[1:]+v[:1]+"ay") continue } switch v[:1] { case "a", "e", "o", "u", "i", "y", "x": ret = append(ret, s+"ay") continue } ret = append(ret, v[1:]+v[:1]+"ay") } return strings.Join(ret, " ") }