spm

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsBase64

func AsBase64(key []byte) string

func FromBase64

func FromBase64(s string) ([]byte, error)

func NmtNfkc

func NmtNfkc() []byte

func NormalizeMn

func NormalizeMn(input string) string

Types

type Array

type Array []ArrayUnit

func Parse

func Parse(precompiledCharsmap []byte) ([]byte, Array)

type ArrayUnit

type ArrayUnit struct {
	// contains filtered or unexported fields
}

func (ArrayUnit) HasLeaf

func (u ArrayUnit) HasLeaf() bool

Implement ArrayUnitTrait for ArrayUnit

func (ArrayUnit) Label

func (u ArrayUnit) Label() uint

func (ArrayUnit) Offset

func (u ArrayUnit) Offset() uint

func (ArrayUnit) Value

func (u ArrayUnit) Value() int

type ArrayUnitTrait

type ArrayUnitTrait interface {
	HasLeaf() bool
	Value() int   // isize
	Label() uint  // usize
	Offset() uint // usize
}

type DoubleArray

type DoubleArray struct {
	Array Array
}

func NewDoubleArrayFrom

func NewDoubleArrayFrom(array Array) *DoubleArray

type Precompiled

type Precompiled struct {
	PrecompiledCharsmap []byte
	Normalized          string
	Trie                *DoubleArray
}

func NewPrecompiledFrom

func NewPrecompiledFrom(data []byte) (*Precompiled, error)

func (*Precompiled) NormalizeString

func (m *Precompiled) NormalizeString(original string) string

func (*Precompiled) Transform

func (m *Precompiled) Transform(chunk string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL