Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferStream ¶
type BufferStream struct {
// contains filtered or unexported fields
}
BufferStream a closable read/write stream of bytes backed by a slice
func NewBufferStream ¶ added in v1.8.0
func NewBufferStream(buf []byte) *BufferStream
NewBufferStream creates a new instance of BufferStream backed by the provided byte slice.
func (*BufferStream) Close ¶
func (this *BufferStream) Close() error
Close makes the stream unavailable for further reads or writes.
func (*BufferStream) Offset ¶
func (this *BufferStream) Offset() int
Offset returns the offset of the read pointer
func (*BufferStream) Read ¶
func (this *BufferStream) Read(b []byte) (int, error)
Read returns an error if the stream is closed, otherwise reads data from the internal buffer at the read offset position. Returns the number of bytes read.
func (*BufferStream) SetOffset ¶
func (this *BufferStream) SetOffset(off int) error
SetOffset sets the offset of the read pointer. Returns an error if the offset value is invalid otr the stream is closed.
type LyndonWords ¶
type LyndonWords struct {
// contains filtered or unexported fields
}
LyndonWords main structure used to decompose a string into Lyndon words
func NewLyndonWords ¶
func NewLyndonWords() (*LyndonWords, error)
NewLyndonWords creates a new instance of LyndonWords
func (*LyndonWords) GetPositions ¶
func (this *LyndonWords) GetPositions(s string) []int32
GetPositions reutrns the start index of each Lyndon word in the given string
func (*LyndonWords) Split ¶
func (this *LyndonWords) Split(s string) []string
Split partitions the given sting into Lyndon words