Documentation ¶
Index ¶
- Variables
- func ByteReplace(bytes []byte, from, to byte) []byte
- func BytesToString(b []byte) string
- func ContainsCJK(str string) bool
- func CurrentTimeMillis() int64
- func FirstWordIsQuestion(runes []rune) bool
- func Format(input string, isCJK bool) string
- func FormatCacheJanitor()
- func FormatMsg(input string, isCJK bool) string
- func GetElemAt(targetIdx int, list *container_list.List) *container_list.Element
- func IP2Int(ip net.IP) uint32
- func Int2IP(nn uint32) net.IP
- func IsPunct(r rune) bool
- func Metaphone(s string) (string, string)
- func RuneReplace(runes []rune, from, to rune) []rune
- func StringToBytes(s string) []byte
- type Contraction
- type FormatResults
Constants ¶
This section is empty.
Variables ¶
var MilliClock func() time.Duration
Clock returns the number of milliseconds that have elapsed since the program was started.
Functions ¶
func ByteReplace ¶
ByteReplace replaces any occurrence of byte `from` to `to` in `bytes`.
func BytesToString ¶
BytesToString unsafely converts a []byte to a string. DO NOT MODIFY the []byte!
func ContainsCJK ¶
ContainsCJK returns whether a string contains any CJK characters.
func CurrentTimeMillis ¶
func CurrentTimeMillis() int64
CurrentTimeMillis gets the current time in milliseconds since UNIX epoch.
func FirstWordIsQuestion ¶
FirstWordIsQuestion returns whether the first word of a []rune indicates a question.
func FormatCacheJanitor ¶
func FormatCacheJanitor()
FormatCacheJanitor cleans up the message format cache in the background.
func GetElemAt ¶
func GetElemAt(targetIdx int, list *container_list.List) *container_list.Element
GetElemAt retrieves the element at targetIdx of list.
func RuneReplace ¶
RuneReplace replaces any occurrence of rune `from` to `to` in `runes`.
func StringToBytes ¶
StringToBytes unsafely converts a string to a []byte. DO NOT MODIFY the []byte!
Types ¶
type Contraction ¶
type FormatResults ¶
type FormatResults struct {
// contains filtered or unexported fields
}
FormatResults stores the results from a successful string format.