Source File
trieval.go
Belonging Package
golang.org/x/text/cases
package cases
type info uint16
const (
casedMask = 0x0003
fullCasedMask = 0x0007
ignorableMask = 0x0006
ignorableValue = 0x0004
inverseFoldBit = 1 << 7
isMidBit = 1 << 6
exceptionBit = 1 << 3
exceptionShift = 4
numExceptionBits = 12
xorIndexBit = 1 << 6
xorShift = 8
hasMappingMask = 0xff80 | exceptionBit
)
const (
cUncased info = iota // 000
cTitle // 001
cLower // 010
cUpper // 011
cIgnorableUncased // 100
cIgnorableCased // 101 // lower case if mappings exist
cXORCase // 11x // case is cLower | ((rune&1) ^ x)
maxCaseMode = cUpper
)
func ( info) () bool {
return &casedMask != 0
}
func ( info) () bool {
return &ignorableMask == ignorableValue
}
func ( info) () bool {
return &fullCasedMask == 0
}
func ( info) () bool {
return &fullCasedMask == cIgnorableUncased
}
func ( info) () bool {
return &(fullCasedMask|isMidBit) == isMidBit|cIgnorableUncased
}
const (
lengthMask = 0x07
lengthBits = 3
noChange = 0
)
var trie = newCaseTrie(0)
var sparse = sparseBlocks{
values: sparseValues[:],
offsets: sparseOffsets[:],
}
type valueRange struct {
value uint16
lo, hi byte
}
type sparseBlocks struct {
values []valueRange
offsets []uint16
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |