Documentation ¶
Index ¶
- func CharCount(str string) int
- func CreateAbsoluteURL(url string, base *nurl.URL) string
- func EqualsIgnoreCase(str1, str2 string) bool
- func HasPrefixIgnoreCase(str, prefix string) bool
- func IsStringAllDigit(str string) bool
- func IsStringAllWhitespace(str string) bool
- func UnescapedString(u *nurl.URL) string
- type FastWordCounter
- type FullWordCounter
- type LetterWordCounter
- type WordCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAbsoluteURL ¶
CreateAbsoluteURL convert url to absolute path based on base. However, if url is prefixed with hash (#), the url won't be changed.
func EqualsIgnoreCase ¶
EqualsIgnoreCase checks if two string is similar in case-insensitive mode.
func HasPrefixIgnoreCase ¶
HasPrefixIgnoreCase checks if str is stared with prefix in case-insensitive mode.
func IsStringAllDigit ¶
func IsStringAllWhitespace ¶
func UnescapedString ¶
Types ¶
type FastWordCounter ¶
type FastWordCounter struct{}
func (FastWordCounter) Count ¶
func (c FastWordCounter) Count(text string) int
type FullWordCounter ¶
type FullWordCounter struct{}
func (FullWordCounter) Count ¶
func (c FullWordCounter) Count(text string) int
type LetterWordCounter ¶
type LetterWordCounter struct{}
func (LetterWordCounter) Count ¶
func (c LetterWordCounter) Count(text string) int
type WordCounter ¶
WordCounter is object for counting the number of words. For some languages, doing this relies on non-trivial word segmentation algorithms, or even huge look-up tables. However, for our purpose this function needs to be reasonably fast, so the word count for some languages would only be an approximation. Read https://crbug.com/484750 for more info.
func SelectWordCounter ¶
func SelectWordCounter(text string) WordCounter
SelectWordCounter picks the most suitable WordCounter depending on the specified text.