func ToFixed(p string, a Args) string {
	if a.Style == Initials {
		return initial(p)
	}
	origP := p
	py := rePhoneticSymbol.ReplaceAllStringFunc(p, func(m string) string {
		symbol := phoneticSymbol[m]
		switch a.Style {
		case Normal, FirstLetter, Finals:
			m = reTone2.ReplaceAllString(symbol, "$1")
		case Tone2, FinalsTone2, Tone3, FinalsTone3:
			m = symbol
		default:
		}
		return m
	})
	switch a.Style {
	case Tone3, FinalsTone3:
		py = reTone3.ReplaceAllString(py, "$1$3$2")
	}
	switch a.Style {
	case FirstLetter:
		py = py[:1]
	case Finals, FinalsTone, FinalsTone2, FinalsTone3:
		rs := []rune(origP)
		switch string(rs[0]) {
		case "ḿ", "ń", "ň", "ǹ":
		default:
			py = final(py)
		}
	}
	return py
}
ToFixed fixed pinyin style
package gpy
import (
	"regexp"
	"strings"
)
const (
	Normal      = 0  
	Tone        = 1  
	Tone2       = 2  
	Tone3       = 8  
	Initials    = 3  
	FirstLetter = 4  
	Finals      = 5  
	FinalsTone  = 6  
	FinalsTone2 = 7  
	FinalsTone3 = 9  
)
var (
	Style = Normal
	Heteronym = false
	Separator = "-"
	Fallback = func(r rune, a Args) []string {
		return []string{}
	}
	finalExceptionsMap = map[string]string{
		"ū": "ǖ",
		"ú": "ǘ",
		"ǔ": "ǚ",
		"ù": "ǜ",
	}
	initialArray = strings.Split(
		"b,p,m,f,d,t,n,l,g,k,h,j,q,x,r,zh,ch,sh,z,c,s",
		",",
	)
	rePhoneticSymbolSource = func(m map[string]string) string {
		s := ""
		for k := range m {
			s = s + k
		}
		return s
	}(phoneticSymbol)
	rePhoneticSymbol = regexp.MustCompile("[" + rePhoneticSymbolSource + "]")
	reTone2 = regexp.MustCompile("([aeoiuvnm])([1-4])$")
	reTone3 = regexp.MustCompile("^([a-z]+)([1-4])([a-z]*)$")
	reFinalExceptions  = regexp.MustCompile("^(j|q|x)(ū|ú|ǔ|ù)$")
	reFinal2Exceptions = regexp.MustCompile(`^(j|q|x)u(\d?)$`)
)
type Args struct {
	Style     int     
	Heteronym bool    
	Separator string  
	Fallback func(r rune, a Args) []string
}
func NewArgs() Args {
	return Args{Style, Heteronym, Separator, Fallback}
}
func initial(p string) string {
	s := ""
	for _, v := range initialArray {
		if strings.HasPrefix(p, v) {
			s = v
			break
		}
	}
	return s
}
func final(p string) string {
	n := initial(p)
	if n == "" {
		return handleYW(p)
	}
	matches := reFinalExceptions.FindStringSubmatch(p)
	if len(matches) == 3 && matches[1] != "" && matches[2] != "" {
		v := finalExceptionsMap[matches[2]]
		return v
	}
	p = reFinal2Exceptions.ReplaceAllString(p, "${1}v$2")
	return strings.Join(strings.SplitN(p, n, 2), "")
}
func handleYW(p string) string {
	if strings.HasPrefix(p, "yu") {
		p = "v" + p[2:]  
	}
	if strings.HasPrefix(p, "yi") {
		p = p[1:]  
	}
	if strings.HasPrefix(p, "y") {
		p = "i" + p[1:]  
	}
	if strings.HasPrefix(p, "wu") {
		p = p[1:]  
	}
	if strings.HasPrefix(p, "w") {
		p = "u" + p[1:]  
	}
	return p
}