fuzzy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsUint16

func AsUint16(val int) uint16

func NormalizeRunes

func NormalizeRunes(runes []rune) []rune

NormalizeRunes normalizes latin script letters

func RunesWidth

func RunesWidth(runes []rune, prefixWidth int, tabstop int, limit int) (int, int)

RunesWidth returns runes width

func StringWidth

func StringWidth(s string) int

StringWidth returns string width where each CR/LF character takes 1 column

Types

type Chars

type Chars struct {

	// XXX Piggybacking item index here is a horrible idea. But I'm trying to
	// minimize the memory footprint by not wasting padded spaces.
	Index int32
	// contains filtered or unexported fields
}

func RunesToChars

func RunesToChars(runes []rune) Chars

func ToChars

func ToChars(bytes []byte) Chars

ToChars converts byte array into rune array

func (*Chars) Bytes

func (chars *Chars) Bytes() []byte

func (*Chars) CopyRunes

func (chars *Chars) CopyRunes(dest []rune, from int)

func (*Chars) Get

func (chars *Chars) Get(i int) rune

func (*Chars) IsBytes

func (chars *Chars) IsBytes() bool

func (*Chars) LeadingWhitespaces

func (chars *Chars) LeadingWhitespaces() int

func (*Chars) Length

func (chars *Chars) Length() int

func (*Chars) Lines

func (chars *Chars) Lines(multiLine bool, maxLines int, wrapCols int, wrapSignWidth int, tabstop int) ([][]rune, bool)

func (*Chars) NumLines

func (chars *Chars) NumLines(atMost int) (int, bool)

func (*Chars) Prepend

func (chars *Chars) Prepend(prefix string)

func (*Chars) SliceRight

func (chars *Chars) SliceRight(last int)

func (*Chars) ToRunes

func (chars *Chars) ToRunes() []rune

func (*Chars) ToString

func (chars *Chars) ToString() string

func (*Chars) TrailingWhitespaces

func (chars *Chars) TrailingWhitespaces() int

func (*Chars) TrimLength

func (chars *Chars) TrimLength() uint16

TrimLength returns the length after trimming leading and trailing whitespaces

func (*Chars) TrimSuffix

func (chars *Chars) TrimSuffix(runes []rune)

func (*Chars) TrimTrailingWhitespaces

func (chars *Chars) TrimTrailingWhitespaces()

type Match

type Match struct {
	Index int
	Str   string
	Score int
	Pos   []int
}

func Find

func Find(pattern []rune, array []string) *Match

type Result

type Result struct {
	Start int
	End   int
	Score int
}

type Slab

type Slab struct {
	I16 []int16
	I32 []int32
}

Jump to

Keyboard shortcuts

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