Documentation ¶
Index ¶
- func IsNumberOnly(s string) bool
- func Jsonify(data interface{}) string
- func NormalizeAposthrope(s string) string
- func NormalizeCharset(str string) string
- func NormalizeString(str string) string
- func NormalizeUnicode(str string) string
- func RemoveRegion(locale string) string
- func SanitizeDate(s string) string
- func SanitizeSpaces(s string) string
- func StripBraces(s string) string
- func TrimChars(s string, chars string) string
- type Dict
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNumberOnly ¶
IsNumberOnly check if string only consist of number.
func Jsonify ¶
func Jsonify(data interface{}) string
Jsonify is used to get a JSON rpresentation of specified data.
func NormalizeAposthrope ¶
NormalizeAposthrope replace apostrope lookalike chars into the ordinary aposthrope.
func NormalizeCharset ¶
NormalizeCharset is used to normalize charset in a string. Used before detecting language of a string.
func NormalizeString ¶
NormalizeString is used to normalize the string before translated into another language. This function will normalizes the unicode, convert the string to lowercase then remove any excess whitespaces.
func NormalizeUnicode ¶
NormalizeUnicode removes Nonspacing Mark (Mn) characters then use NFKC as the normal forms.
func RemoveRegion ¶
RemoveRegion removes region code from a locale, returning the language of locale.
func SanitizeDate ¶
SanitizeDate is used to sanitize the specified date string before it parsed by the parser.
func SanitizeSpaces ¶
SanitizeSpaces replaces non-breaking spaces into a normal one, then remove any excess whitespaces.
func StripBraces ¶
StripBraces, as it name implies, will remove any braces from the string.
Types ¶
type Dict ¶
type Dict map[string]struct{}
Dict is a simple wrapper for `map[string]struct{}`. Useful for keeping unique values.
func (Dict) Add ¶
Add add items into the Dict. If the Dict has not been initialized, it will stop and items won't be added to Dict.