Documentation
¶
Index ¶
- func Accents(b []byte) (output []byte, err error)
- func AddLeadingSpace(b []byte) []byte
- func Case(b []byte) (output []byte, err error)
- func CaseAndAccents(b []byte) (output []byte, err error)
- func Collapse(input []byte) []byte
- func CollapseAndQuotemarks(input []byte) []byte
- func CollapseAndQuotemarksAndUnixLines(input []byte) []byte
- func CollapseAndUnixLines(input []byte) []byte
- func NFD(input []byte) (output []byte, err error)
- func NFDAndCase(b []byte) (output []byte, err error)
- func Quotemarks(input []byte) []byte
- func Trim(b []byte) []byte
- func TrimAndAddLeadingSpace(b []byte) []byte
- func UnixLines(input []byte) []byte
- type Normalizer
- func (n Normalizer) Normalize(data []byte) ([]byte, error)
- func (n Normalizer) SpecifiedAccents() bool
- func (n Normalizer) SpecifiedCollapse() bool
- func (n Normalizer) SpecifiedLeadingSpace() bool
- func (n Normalizer) SpecifiedLowercase() bool
- func (n Normalizer) SpecifiedNFD() bool
- func (n Normalizer) SpecifiedQuotemarks() bool
- func (n Normalizer) SpecifiedTrim() bool
- func (n Normalizer) SpecifiedUnixLines() bool
- func (n Normalizer) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLeadingSpace ¶
Adds a leading space if there isn't one already.
func CaseAndAccents ¶
Lowercase and remove accents from UTF-8 text.
func CollapseAndQuotemarks ¶
All sequences of 2 or more spaces are converted into single spaces, and curly UTF-8 apostrophes and quotes are converted into ASCII.
func CollapseAndQuotemarksAndUnixLines ¶
Does all three in one loop.
func NFDAndCase ¶
Lowercases and performs UTF-8 NFD normalization.
func Quotemarks ¶
Curly UTF-8 apostrophes and quotes are converted into ASCII.
func TrimAndAddLeadingSpace ¶
Removes preceding and trailing whitespace (& some non-printable characters), then adds space to the front.
Types ¶
type Normalizer ¶
type Normalizer struct {
Flag uint8
}
func NewNormalizer ¶
func NewNormalizer(s string) (Normalizer, error)
func (Normalizer) SpecifiedAccents ¶
func (n Normalizer) SpecifiedAccents() bool
func (Normalizer) SpecifiedCollapse ¶
func (n Normalizer) SpecifiedCollapse() bool
func (Normalizer) SpecifiedLeadingSpace ¶
func (n Normalizer) SpecifiedLeadingSpace() bool
func (Normalizer) SpecifiedLowercase ¶
func (n Normalizer) SpecifiedLowercase() bool
func (Normalizer) SpecifiedNFD ¶
func (n Normalizer) SpecifiedNFD() bool
func (Normalizer) SpecifiedQuotemarks ¶
func (n Normalizer) SpecifiedQuotemarks() bool
func (Normalizer) SpecifiedTrim ¶
func (n Normalizer) SpecifiedTrim() bool
func (Normalizer) SpecifiedUnixLines ¶
func (n Normalizer) SpecifiedUnixLines() bool
func (Normalizer) String ¶
func (n Normalizer) String() string
Click to show internal directories.
Click to hide internal directories.