lex

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NLANG = "nlang"
	NCELL = "ncell"
)
View Source
const (
	NPAGE = "npage"
	NHASH = "nhash"
)
View Source
const (
	TRAIN = "train"
	PARSE = "parse"
)
View Source
const LEX = "lex"
View Source
const MATRIX = "matrix"

Variables

View Source
var Index = &ice.Context{Name: LEX, Help: "词法模块",
	Commands: map[string]*ice.Command{
		ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {

		}},
		ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {
			m.Save()
		}},
	},
}

Functions

This section is empty.

Types

type Matrix

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

func NewMatrix

func NewMatrix(m *ice.Message, nlang, ncell int) *Matrix

func (*Matrix) Parse

func (mat *Matrix) Parse(m *ice.Message, npage string, stream *Stream) (hash int, word []byte)

func (*Matrix) Train

func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int

type Point

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

type State

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

type Stream

type Stream struct {
	P int
	// contains filtered or unexported fields
}

func NewStream

func NewStream(r io.Reader) *Stream

func (*Stream) Char

func (s *Stream) Char() byte

func (*Stream) Next

func (s *Stream) Next()

func (*Stream) Scan

func (s *Stream) Scan() bool

Jump to

Keyboard shortcuts

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