text

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntHash

func IntHash(text string) (int, error)

func MiddleOut

func MiddleOut(str string, maxWords int, ellipsis string) string

MiddleOut truncates the given text by applying a "middle out" strategy

See https://openrouter.ai/docs/features/message-transforms and https://arxiv.org/abs/2307.03172

func Truncate

func Truncate(str string, maxWords int) string

Truncate truncates the given text to a maximum number of words

Types

type Word

type Word struct {
	Start int
	End   int
}

func SplitByWords

func SplitByWords(text string) []*Word

Jump to

Keyboard shortcuts

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