Constants & Variables
Compact
var
#
var Compact Option = compact
NoLower
var
#
var NoLower Option = noLower
Supported
var
#
var Supported language.Coverage
UnicodeVersion
const
#
const UnicodeVersion = "15.0.0"
UnicodeVersion
const
#
const UnicodeVersion = "9.0.0"
UnicodeVersion
const
#
const UnicodeVersion = "10.0.0"
UnicodeVersion
const
#
const UnicodeVersion = "12.0.0"
UnicodeVersion
const
#
const UnicodeVersion = "11.0.0"
UnicodeVersion
const
#
const UnicodeVersion = "13.0.0"
above
const
#
const above = 230
cIgnorableCased
const
#
const cIgnorableCased
cIgnorableUncased
const
#
const cIgnorableUncased
cLower
const
#
const cLower
cTitle
const
#
const cTitle
cUncased
const
#
const cUncased info = iota
cUpper
const
#
const cUpper
cXORCase
const
#
const cXORCase
caseIndex
var
#
var caseIndex = [1728]uint16{...}
caseIndex
var
#
var caseIndex = [1600]uint16{...}
caseIndex
var
#
var caseIndex = [1600]uint16{...}
caseIndex
var
#
var caseIndex = [1600]uint16{...}
caseIndex
var
#
var caseIndex = [1600]uint16{...}
caseIndex
var
#
var caseIndex = [1600]uint16{...}
caseValues
var
#
var caseValues = [1408]uint16{...}
caseValues
var
#
var caseValues = [1408]uint16{...}
caseValues
var
#
var caseValues = [1280]uint16{...}
caseValues
var
#
var caseValues = [1408]uint16{...}
caseValues
var
#
var caseValues = [1536]uint16{...}
caseValues
var
#
var caseValues = [1280]uint16{...}
casedMask
const
#
const casedMask = 0x0003
cccAbove
const
#
const cccAbove
cccBreak
const
#
const cccBreak info = *ast.BinaryExpr
cccMask
const
#
const cccMask = *ast.BinaryExpr
cccOther
const
#
const cccOther
cccZero
const
#
const cccZero
exceptionBit
const
#
const exceptionBit = *ast.BinaryExpr
exceptionShift
const
#
const exceptionShift = 4
exceptions
var
#
var exceptions string = *ast.BinaryExpr
exceptions
var
#
var exceptions string = *ast.BinaryExpr
exceptions
var
#
var exceptions string = *ast.BinaryExpr
exceptions
var
#
var exceptions string = *ast.BinaryExpr
exceptions
var
#
var exceptions string = *ast.BinaryExpr
exceptions
var
#
var exceptions string = *ast.BinaryExpr
fullCasedMask
const
#
const fullCasedMask = 0x0007
hasMappingMask
const
#
const hasMappingMask = *ast.BinaryExpr
ignorableMask
const
#
const ignorableMask = 0x0006
ignorableValue
const
#
const ignorableValue = 0x0004
inverseFoldBit
const
#
const inverseFoldBit = *ast.BinaryExpr
iotaSubscript
const
#
const iotaSubscript = 240
isMidBit
const
#
const isMidBit = *ast.BinaryExpr
lastRuneForTesting
const
#
const lastRuneForTesting = *ast.CallExpr
lengthBits
const
#
const lengthBits = 3
lengthMask
const
#
const lengthMask = 0x07
lowerFunc
var
#
var lowerFunc = []mapFunc{...}
matcher
var
#
var matcher *internal.InheritanceMatcher
maxCaseMode
const
#
const maxCaseMode = cUpper
maxIgnorable
const
#
const maxIgnorable = 30
noChange
const
#
const noChange = 0
numExceptionBits
const
#
const numExceptionBits = 12
sparse
var
#
var sparse = sparseBlocks{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseOffsets
var
#
var sparseOffsets = []uint16{...}
sparseValues
var
#
var sparseValues = [1483]valueRange{...}
sparseValues
var
#
var sparseValues = [1418]valueRange{...}
sparseValues
var
#
var sparseValues = [1562]valueRange{...}
sparseValues
var
#
var sparseValues = [1451]valueRange{...}
sparseValues
var
#
var sparseValues = [1395]valueRange{...}
sparseValues
var
#
var sparseValues = [1360]valueRange{...}
starter
const
#
const starter = 0
supported
const
#
const supported = "und af az el lt nl tr"
titleInfos
var
#
var titleInfos = []struct{...}{...}
trie
var
#
var trie = *ast.CallExpr
undLower
var
#
var undLower transform.SpanningTransformer = *ast.UnaryExpr
undLowerIgnoreSigma
var
#
var undLowerIgnoreSigma transform.SpanningTransformer = *ast.UnaryExpr
undUpper
var
#
var undUpper transform.SpanningTransformer = *ast.UnaryExpr
upperFunc
var
#
var upperFunc = []struct{...}{...}
xorData
var
#
var xorData string = *ast.BinaryExpr
xorData
var
#
var xorData string = *ast.BinaryExpr
xorData
var
#
var xorData string = *ast.BinaryExpr
xorData
var
#
var xorData string = *ast.BinaryExpr
xorData
var
#
var xorData string = *ast.BinaryExpr
xorData
var
#
var xorData string = *ast.BinaryExpr
xorIndexBit
const
#
const xorIndexBit = *ast.BinaryExpr
xorShift
const
#
const xorShift = 8
Functions
Bytes
method
#
Bytes returns a new byte slice with the result of converting b to the case
form implemented by c.
func (c Caser) Bytes(b []byte) []byte
Fold
function
#
Fold returns a Caser that implements Unicode case folding. The returned Caser
is stateless and safe to use concurrently by multiple goroutines.
Case folding does not normalize the input and may not preserve a normal form.
Use the collate or search package for more convenient and linguistically
sound comparisons. Use golang.org/x/text/secure/precis for string comparisons
where security aspects are a concern.
func Fold(opts ...Option) Caser
HandleFinalSigma
function
#
HandleFinalSigma specifies whether the special handling of Greek final sigma
should be enabled. Unicode prescribes handling the Greek final sigma for all
locales, but standards like IDNA and PRECIS override this default.
func HandleFinalSigma(enable bool) Option
Lower
function
#
Lower returns a Caser for language-specific lowercasing.
func Lower(t language.Tag, opts ...Option) Caser
Reset
method
#
func (c *context) Reset()
Reset
method
#
Reset resets the Caser to be reused for new input after a previous call to
Transform.
func (c Caser) Reset()
Span
method
#
func (t *titleCaser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
func (t undUpperCaser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
func (t undLowerCaser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
Span implements the transform.SpanningTransformer interface.
func (c Caser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
func (t *simpleCaser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
Span implements a generic lower-casing. This is possible as isLower works
for all lowercasing variants. All lowercase variants only vary in how they
transform a non-lowercase letter. They will never change an already lowercase
letter. In addition, there is no state.
func (t undLowerIgnoreSigmaCaser) Span(src []byte, atEOF bool) (n int, err error)
Span
method
#
func (t *caseFolder) Span(src []byte, atEOF bool) (n int, err error)
String
method
#
String returns a string with the result of transforming s to the case form
implemented by c.
func (c Caser) String(s string) string
Title
function
#
Title returns a Caser for language-specific title casing. It uses an
approximation of the default Unicode Word Break algorithm.
func Title(t language.Tag, opts ...Option) Caser
Transform
method
#
simpleCaser implements the Transformer interface for doing a case operation
on a rune-by-rune basis.
func (t *simpleCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
Transform implements the transform.Transformer interface and transforms the
given input to the case form implemented by c.
func (c Caser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
func (t undLowerIgnoreSigmaCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
caseFolder implements the Transformer interface for doing case folding.
func (t *caseFolder) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
undUpperCaser implements the Transformer interface for doing an upper case
mapping for the root locale (und). It eliminates the need for an allocation
as it prevents escaping by not using function pointers.
func (t undUpperCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
func (t undLowerCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
func (t *lowerCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Transform
method
#
Transform implements the standard Unicode title case algorithm as defined in
Chapter 3 of The Unicode Standard:
toTitlecase(X): Find the word boundaries in X according to Unicode Standard
Annex #29, "Unicode Text Segmentation." For each word boundary, find the
first cased character F following the word boundary. If F exists, map F to
Titlecase_Mapping(F); then map all characters C between F and the following
word boundary to Lowercase_Mapping(C).
func (t *titleCaser) Transform(dst []byte, src []byte, atEOF bool) (nDst int, nSrc int, err error)
Upper
function
#
Upper returns a Caser for language-specific uppercasing.
func Upper(t language.Tag, opts ...Option) Caser
afnlRewrite
function
#
Not part of CLDR, but see https://unicode.org/cldr/trac/ticket/7078.
func afnlRewrite(c *context)
aztrLower
function
#
func aztrLower(c *context) (done bool)
aztrUpper
function
#
func aztrUpper(f mapFunc) mapFunc
caseType
method
#
caseType returns an info with only the case bits, normalized to either
cLower, cUpper, cTitle or cUncased.
func (c *context) caseType() info
cccType
method
#
func (c info) cccType() info
cccVal
method
#
func (c info) cccVal() info
checkpoint
method
#
checkpoint sets the return value buffer points for Transform to the current
positions.
func (c *context) checkpoint()
compact
function
#
func compact(o options) options
copy
method
#
copy writes the current rune to dst.
func (c *context) copy() bool
copyXOR
method
#
copyXOR copies the current rune to dst and modifies it by applying the XOR
pattern of the case info. It is the responsibility of the caller to ensure
that this is a rune with a XOR pattern defined.
func (c *context) copyXOR() bool
doICU
function
#
func doICU(tag string, caser string, input string) string
elUpper
function
#
elUpper implements Greek upper casing, which entails removing a predefined
set of non-blocked modifiers. Note that these accents should not be removed
for title casing!
Example: "Οδός" -> "ΟΔΟΣ".
func elUpper(c *context) bool
finalSigma
function
#
finalSigma adds Greek final Sigma handing to another casing function. It
determines whether a lowercased sigma should be σ or ς, by looking ahead for
case-ignorables and a cased letters.
func finalSigma(f mapFunc) mapFunc
finalSigmaBody
function
#
func finalSigmaBody(c *context) bool
foldFull
function
#
foldFull writes the foldFull version of the current rune to dst.
func foldFull(c *context) bool
getOpts
function
#
func getOpts(o ...Option) (res options)
handleFinalSigma
function
#
func handleFinalSigma(o options) options
hasPrefix
method
#
hasPrefix returns true if src[pSrc:] starts with the given string.
func (c *context) hasPrefix(s string) bool
ignoreFinalSigma
function
#
func ignoreFinalSigma(o options) options
init
function
#
func init()
isBreak
method
#
isBreak returns whether this rune should introduce a break.
func (c info) isBreak() bool
isCaseIgnorable
method
#
func (c info) isCaseIgnorable() bool
isCaseIgnorableAndNotCased
method
#
func (c info) isCaseIgnorableAndNotCased() bool
isCased
method
#
func (c info) isCased() bool
isFoldFull
function
#
isFoldFull reports whether the current run is mapped to foldFull
func isFoldFull(c *context) bool
isLetter
method
#
isLetter returns whether the rune is of break type ALetter, Hebrew_Letter,
Numeric, ExtendNumLet, or Extend.
func (c info) isLetter() bool
isLower
function
#
func isLower(c *context) bool
isMid
method
#
func (c info) isMid() bool
isNotCasedAndNotCaseIgnorable
method
#
func (c info) isNotCasedAndNotCaseIgnorable() bool
isTitle
function
#
isTitle reports whether the current rune is in title case.
func isTitle(c *context) bool
isUpper
function
#
isUpper writes the isUppercase version of the current rune to dst.
func isUpper(c *context) bool
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookup
method
#
lookup returns the value from values block n for byte b using binary search.
func (s *sparseBlocks) lookup(n uint32, b byte) uint16
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookup
method
#
lookup returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookup(s []byte) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupString
method
#
lookupString returns the trie value for the first UTF-8 encoding in s and
the width in bytes of this encoding. The size will be 0 if s does not
hold enough bytes to complete the encoding. len(s) must be greater than 0.
func (t *caseTrie) lookupString(s string) (v uint16, sz int)
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupStringUnsafe
method
#
lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupStringUnsafe(s string) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupUnsafe
method
#
lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
s must start with a full and valid UTF-8 encoded rune.
func (t *caseTrie) lookupUnsafe(s []byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lookupValue
method
#
lookupValue determines the type of block n and looks up the value for b.
func (t *caseTrie) lookupValue(n uint32, b byte) uint16
lower
function
#
lower writes the lowercase version of the current rune to dst.
func lower(c *context) bool
ltLower
function
#
func ltLower(c *context) bool
ltUpper
function
#
func ltUpper(f mapFunc) mapFunc
makeFold
function
#
func makeFold(o options) transform.SpanningTransformer
makeLower
function
#
func makeLower(t language.Tag, o options) transform.SpanningTransformer
makeTitle
function
#
func makeTitle(t language.Tag, o options) transform.SpanningTransformer
makeUpper
function
#
func makeUpper(t language.Tag, o options) transform.SpanningTransformer
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
newCaseTrie
function
#
func newCaseTrie(i int) *caseTrie
next
method
#
func (c *context) next() bool
nlTitle
function
#
func nlTitle(c *context) bool
nlTitleSpan
function
#
func nlTitleSpan(c *context) bool
noLower
function
#
func noLower(o options) options
noSpan
function
#
func noSpan(c *context) bool
ret
method
#
ret returns the return values for the Transform method. It checks whether
there were insufficient bytes in src to complete and introduces an error
accordingly, if necessary.
func (c *context) ret() (nDst int, nSrc int, err error)
retSpan
method
#
retSpan returns the return values for the Span method. It checks whether
there were insufficient bytes in src to complete and introduces an error
accordingly, if necessary.
func (c *context) retSpan() (n int, err error)
title
function
#
title writes the title case version of the current rune to dst.
func title(c *context) bool
unreadRune
method
#
unreadRune causes the last rune read by next to be reread on the next
invocation of next. Only one unreadRune may be called after a call to next.
func (c *context) unreadRune()
upper
function
#
upper writes the uppercase version of the current rune to dst.
func upper(c *context) bool
writeBytes
method
#
writeBytes adds bytes to dst.
func (c *context) writeBytes(b []byte) bool
writeString
method
#
writeString writes the given string to dst.
func (c *context) writeString(s string) bool