//Humanize First letter of sentence capitalized
// Uses custom friendly replacements via AddHuman()
543905
func (rs *Ruleset) Humanize(word string) string {
	word = replaceLast(word, "_id", "") // strip foreign key kinds
	// replace and strings in humans list
	for _, rule := range rs.humans {
		word = strings.Replace(word, rule.suffix, rule.replacement, -1)
	}
	sentence := rs.separatedWords(word, " ")

	r, n := utf8.DecodeRuneInString(sentence)
	return string(unicode.ToUpper(r)) + sentence[n:]
}
792036
func (rs *Ruleset) Capitalize(word string) string {
	if rs.isAcronym(word) {
		return strings.ToUpper(word)
	}
	return strings.ToUpper(word[:1]) + word[1:]
}
108830
func (s *FQDNSelector) sanitize() error {
	if len(s.MatchName) > 0 && !allowedMatchNameChars.MatchString(s.MatchName) {
		return fmt.Errorf("Invalid characters in MatchName: \"%s\". Only 0-9, a-z, A-Z and . and - characters are allowed", s.MatchName)
	}

	if len(s.MatchPattern) > 0 && !allowedPatternChars.MatchString(s.MatchPattern) {
		return fmt.Errorf("Invalid characters in MatchPattern: \"%s\". Only 0-9, a-z, A-Z and ., - and * characters are allowed", s.MatchPattern)
	}
	_, err := matchpattern.Validate(s.MatchPattern)
	return err
}
404779
func (t *TimePeriod) Normalize() error {
	if t.GetDuration() == "" {
		return nil
	}
	n, err := t.Time.(*TimePeriod_Duration).ToSeconds()
	if err != nil {
		return errors.Annotate(err, "invalid duration").Err()
	}
	t.Time = &TimePeriod_Seconds{
		Seconds: n,
	}
	return nil
}
900513
func NewHumanPrintFlags() *HumanPrintFlags {
	showLabels := false
	sortBy := ""
	showKind := false
	columnLabels := []string{}

	return &HumanPrintFlags{
		NoHeaders:          false,
		WithNamespace:      false,
		AbsoluteTimestamps: false,
		ColumnLabels:       &columnLabels,

		Kind:       schema.GroupKind{},
		ShowLabels: &showLabels,
		SortBy:     &sortBy,
		ShowKind:   &showKind,
	}
}
128689
func Colorize(msg string, color int) string {
	return ColorEscape(color) + msg + ColorResetEscape
}
407438
func (m *Module) Normalized() string {
	return m.formatWithPrefix(m.normalizedHostPrefix(m.Host().Normalized()), false)
}
270531
func (rs *Ruleset) Pluralize(word string) string {
	if len(word) == 0 {
		return word
	}
	lWord := strings.ToLower(word)
	if rs.isUncountable(lWord) {
		return word
	}

	var candidate string
	for _, rule := range rs.plurals {
		if rule.exact {
			if lWord == rule.suffix {
				// Capitalized word
				if lWord[0] != word[0] && lWord[1:] == word[1:] {
					return rs.Capitalize(rule.replacement)
				}
				return rule.replacement
			}
			continue
		}

		if strings.EqualFold(word, rule.suffix) {
			candidate = rule.replacement
		}

		if strings.HasSuffix(word, rule.suffix) {
			return replaceLast(word, rule.suffix, rule.replacement)
		}
	}

	if candidate != "" {
		return candidate
	}
	return word + "s"
}
412882
func (p *PragmaticSegmenter) Tokenize(text string) []string {
	return p.processor.process(text)
}
261625
func filterCapitalize(ctx stick.Context, val stick.Value, args ...stick.Value) stick.Value {
	s := stick.CoerceString(val)
	return strings.ToUpper(s[:1]) + s[1:]
}
1113987
func (p PunktSentenceTokenizer) Tokenize(text string) []string {
	sents := []string{}
	for _, s := range p.tokenizer.Tokenize(text) {
		sents = append(sents, s.Text)
	}
	return sents
}
316473
func normalize(key string) string {
	if key == "" {
		return ""
	}
	path := strings.Split(strings.Trim(key, "/"), "/")
	return "/" + strings.Join(path, "/")
}
865612
func (ident Identifier) Sanitize() string {
	parts := make([]string, len(ident))
	for i := range ident {
		parts[i] = `"` + strings.Replace(ident[i], `"`, `""`, -1) + `"`
	}
	return strings.Join(parts, ".")
}
770618
func (t Tokenizer) Tokenize(input string) []Token {
	return t.Analyze(input, Normal)
}
1271326
func (v *Value) Normalize() error {
	norm, needsNormalization := v.Value.(interface {
		Normalize() error
	})
	if !needsNormalization {
		return nil
	}
	return norm.Normalize()
}
531121
func (v *Value_Array) Normalize() error {
	newAry, err := NormalizeJSON(v.Array, false)
	if err != nil {
		return err
	}
	v.Array = newAry
	return nil
}
1256157
func lowerGoNormalize(s string) string {
	fmtd := xstrings.ToCamelCase(s)
	fmtd = xstrings.FirstRuneToLower(fmtd)
	return formatID(s, fmtd)
}