codec

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustMatchIndex

func AdjustMatchIndex(segments []*EncodedSegment, matchIndex []int) []int

AdjustMatchIndex maps a match index from the current decode pass back to its location in the original text

func CurrentLine

func CurrentLine(segments []*EncodedSegment, currentRaw string) string

CurrentLine returns from the start of the line containing the segments to the end of the line where the segment ends.

func Tags

func Tags(segments []*EncodedSegment) []string

Tags returns additional meta data tags related to the types of segments

Types

type Decoder

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

Decoder decodes various types of data in place

func NewDecoder

func NewDecoder() *Decoder

NewDecoder creates a default decoder struct

func (*Decoder) Decode

func (d *Decoder) Decode(data string, predecessors []*EncodedSegment) (string, []*EncodedSegment)

Decode returns the data with the values decoded in place along with the encoded segment meta data for the next pass of decoding

type EncodedSegment

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

EncodedSegment represents a portion of text that is encoded in some way.

func SegmentsWithDecodedOverlap

func SegmentsWithDecodedOverlap(segments []*EncodedSegment, start, end int) []*EncodedSegment

SegmentsWithDecodedOverlap the segments where the start and end overlap its decoded range

Jump to

Keyboard shortcuts

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