mangle

package
v0.0.0-...-9ed1330 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mangle performs text manipulation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ExtraWords are common words that can be thrown out for matching
	ExtraWords = map[string]bool{
		"&":          true,
		"(CA)":       true,
		"AND":        true,
		"AREA":       true,
		"CAMP":       true,
		"CAMPGROUND": true,
		"COUNTY":     true,
		"DAY":        true,
		"FOREST":     true,
		"FS":         true,
		"MONUMENT":   true,
		"NATIONAL":   true,
		"NATL":       true,
		"PARK":       true,
		"RECREATION": true,
		"REGIONAL":   true,
		"STATE":      true,
		"USE":        true,
		"GROUP":      true,
		"VILLAGE":    true,
		"WALK-IN":    true,
		"RESORT":     true,
		"VISITOR":    true,
		"LONG":       true,
		"TERM":       true,
		"RV":         true,
		"SITES":      true,
		"FAMILY":     true,
		"SPA":        true,
		"ON":         true,
		"THE":        true,
		"BAY":        true,
		"BY":         true,
	}
)

Functions

func Ellipsis

func Ellipsis(s string, max int) string

Ellipsis sets a cap on the number of words to show

func Expand

func Expand(s string) string

func Features

func Features(s string) []string

Features returns a list of features from a raw string

func Locale

func Locale(s string) string

Locale returns a shorter locale name

func LocaleProperty

func LocaleProperty(s string) string

func Normalize

func Normalize(s string) string

Normalize removes weird characters so that a string is easy to compare

func ShortLocale

func ShortLocale(s string) string

Locale returns an even shorter locale

func Shorten

func Shorten(s string) (string, bool)

Shorten is a one-pass shortening

func Shortest

func Shortest(s string) string

Shortest returns the shortest possible name for a string

func SiteKind

func SiteKind(title string, kind string, sid string) campwiz.SiteKind

func Title

func Title(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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