// KanaToRomaji converts a kana string to its romaji form
481556
func KanaToRomaji(kana string) (romaji string) {
	// unfortunate hack to deal with double n's
	romaji = hiraganaRe.ReplaceAllString(kana, "nn$1")
	romaji = katakanaRe.ReplaceAllString(romaji, "nn$1")

	romaji = kanaToRomajiTrie.convert(romaji)

	// do some post-processing for the tsu and stripe characters
	// maybe a bit of a hacky solution - how can we improve?
	// (they act more like punctuation)
	tsus := []string{"っ", "ッ"}
	for _, tsu := range tsus {
		if strings.Index(romaji, tsu) > -1 {
			for _, c := range romaji {
				ch := string(c)
				if ch == tsu {
					i := strings.Index(romaji, ch)
					runeSize := len(ch)
					followingLetter, _ := utf8.DecodeRuneInString(romaji[i+runeSize:])
					followingLetterStr := string(followingLetter)
					if followingLetterStr != tsu {
						romaji = strings.Replace(romaji, tsu, followingLetterStr, 1)
					} else {
						romaji = strings.Replace(romaji, tsu, "", 1)
					}
				}
			}
		}
	}

	line := "ー"
	for i := strings.Index(romaji, line); i > -1; i = strings.Index(romaji, line) {
		if i > 0 {
			romaji = strings.Replace(romaji, line, "-", 1)
		} else {
			romaji = strings.Replace(romaji, line, "", 1)
		}
	}
	return romaji
}
459433
func (ac *arrayContainer) iremoveReturnMinimized(x uint16) container {
	ac.iremove(x)
	return ac
}
714165
func DefaultJSONEncoder() runtime.Encoder {
	return unstructured.JSONFallbackEncoder{Encoder: Codecs.LegacyCodec(Scheme.PrioritizedVersionsAllGroups()...)}
}
778327
func (q Quality) Invert() Quality {
	switch q.Type {
	case PerfectType:
		return q
	case MajorType:
		return Quality{MinorType, q.Size}
	case MinorType:
		return Quality{MajorType, q.Size}
	case AugmentedType:
		return Quality{DiminishedType, q.Size}
	case DiminishedType:
		return Quality{AugmentedType, q.Size}
	default:
		panic(fmt.Sprintf("invalid type: %d", q.Type))
	}
}
187206
func (c *Config) LowLevelJSONConfig() map[string]interface{} {
	// Make a shallow clone of c.jconf so we can mutate the
	// handlerConfig key to make it explicitly true, without
	// modifying anybody's else view of it.
	ret := map[string]interface{}{}
	for k, v := range c.jconf {
		ret[k] = v
	}
	ret["handlerConfig"] = true
	return ret
}
811521
func EscapeGlobComponent(component string, options *Options) string {
	if options == nil {
		options = DefaultOptions
	}

	runesToEscape := make([]rune, 0, len(expanders)+1)
	runesToEscape = append(runesToEscape, expanders...)
	runesToEscape = append(runesToEscape, options.Separator)

	runesToEscapeMap := make(map[string]bool, len(runesToEscape))
	for _, r := range runesToEscape {
		runesToEscapeMap[string(r)] = true
	}

	scanner := bufio.NewScanner(strings.NewReader(component))
	scanner.Split(separatorsScanner(runesToEscape))
	buf := new(bytes.Buffer)
	for scanner.Scan() {
		component := scanner.Text()
		if runesToEscapeMap[component] {
			buf.WriteRune(Escaper)
		}
		buf.WriteString(component)
	}

	return buf.String()
}
461145
func (api *Client) GetEmoji() (map[string]string, error) {
	return api.GetEmojiContext(context.Background())
}
1323604
func (s *H265Settings) SetAlternateTransferFunctionSei(v string) *H265Settings {
	s.AlternateTransferFunctionSei = &v
	return s
}
420425
func init() {
	RegisterCharset(&Charset{
		Name:    "EUC-JP",
		Aliases: []string{"extended_unix_code_packed_format_for_japanese", "cseucpkdfmtjapanese"},
		NewDecoder: func() Decoder {
			return decodeEucJP
		},
		NewEncoder: func() Encoder {
			jis0208Table.Reverse()
			jis0212Table.Reverse()
			return encodeEucJP
		},
	})
}
245820
func recursiveToJSON(v interface{}) (r interface{}) {
	switch v := v.(type) {
	case []interface{}:
		for i, e := range v {
			v[i] = recursiveToJSON(e)
		}
		r = jsonArray(v)
	case map[interface{}]interface{}:
		newMap := make(map[string]interface{}, len(v))
		for k, e := range v {
			newMap[k.(string)] = recursiveToJSON(e)
		}
		r = jsonMap(newMap)
	default:
		r = v
	}
	return
}
403552
func MsgOptionIconEmoji(iconEmoji string) MsgOption {
	return func(c *sendConfig) error {
		c.values.Set("icon_emoji", iconEmoji)
		return nil
	}
}
1253624
func (p *JSONFormat) TransformData(data interface{}) (string, error) {
	var buf bytes.Buffer
	enc := codec.NewEncoder(&buf, jsonHandlePretty)
	err := enc.Encode(data)
	if err != nil {
		return "", err
	}

	return buf.String(), nil
}
873022
func DecodeJSONArg(name string, v interface{}) error {
	var src io.Reader = os.Stdin
	if name != "-" && name != "" {
		f, err := os.Open(name)
		if err != nil {
			return err
		}
		defer f.Close()
		src = f
	}
	return json.NewDecoder(src).Decode(v)
}
1139370
func ToASCII(r rune) rune {
	a, ok := UnicodeToASCII[r]
	if ok {
		return a
	}
	return r
}
551317
func EscapeGlobString(gs string, options *Options) string {
	if options == nil {
		options = DefaultOptions
	}

	runesToEscapeMap := make(map[string]bool, len(expanders))
	for _, r := range expanders {
		runesToEscapeMap[string(r)] = true
	}

	scanner := bufio.NewScanner(strings.NewReader(gs))
	scanner.Split(separatorsScanner(expanders))
	buf := new(bytes.Buffer)
	for scanner.Scan() {
		part := scanner.Text()
		if runesToEscapeMap[part] {
			buf.WriteRune(Escaper)
		}
		buf.WriteString(part)
	}

	return buf.String()
}
144947
func toBinary(text string) vm.OpCode {
	return vm.StringToOp(strings.ToUpper(text))
}
857922
func IsKanji(s string) bool {
	return isChar(s, []*unicode.RangeTable{unicode.Ideographic})
}