1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-05 04:37:01 +08:00
This commit is contained in:
shaoying 2021-06-21 07:28:39 +08:00
parent 970ab800d5
commit 4e1cd604f8
5 changed files with 134 additions and 123 deletions

View File

@ -101,8 +101,9 @@ func Color(m *ice.Message, c string, str interface{}) string {
} }
return fmt.Sprintf(wrap, color, str) return fmt.Sprintf(wrap, color, str)
} }
func ColorRed(m *ice.Message, str interface{}) string { return Color(m, RED, str) } func ColorRed(m *ice.Message, str interface{}) string { return Color(m, RED, str) }
func ColorGreen(m *ice.Message, str interface{}) string { return Color(m, GREEN, str) } func ColorGreen(m *ice.Message, str interface{}) string { return Color(m, GREEN, str) }
func ColorYellow(m *ice.Message, str interface{}) string { return Color(m, YELLOW, str) }
const ( const (
FG = "fg" FG = "fg"

View File

@ -22,11 +22,11 @@ const LEX = "lex"
var Index = &ice.Context{Name: LEX, Help: "词法模块", var Index = &ice.Context{Name: LEX, Help: "词法模块",
Commands: map[string]*ice.Command{ Commands: map[string]*ice.Command{
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {
m.Load() // m.Load()
_lex_load(m) // _lex_load(m)
}}, }},
ice.CTX_EXIT: {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() // m.Save()
}}, }},
}, },
} }

View File

@ -92,19 +92,18 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
cn := make([]bool, mat.ncell) cn := make([]bool, mat.ncell)
cc := make([]byte, 0, mat.ncell) cc := make([]byte, 0, mat.ncell)
sn := make([]bool, len(mat.mat)) sn := make([]bool, len(mat.mat))
begin := len(mat.mat)
points := []*Point{} points := []*Point{}
for i := 0; i < len(seed); i++ { for i := 0; i < len(seed); i++ {
switch seed[i] { switch seed[i] { // 字符集
case '[': case '[':
set := true set := true
if i++; seed[i] == '^' { if i++; seed[i] == '^' { // 补集
set, i = false, i+1 set, i = false, i+1
} }
for ; seed[i] != ']'; i++ { for ; seed[i] != ']'; i++ {
if seed[i] == '\\' { if seed[i] == '\\' { // 转义
i++ i++
for _, c := range mat.char(seed[i]) { for _, c := range mat.char(seed[i]) {
cn[c] = true cn[c] = true
@ -112,7 +111,7 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
continue continue
} }
if seed[i+1] == '-' { if seed[i+1] == '-' { // 区间
begin, end := seed[i], seed[i+2] begin, end := seed[i], seed[i+2]
if begin > end { if begin > end {
begin, end = end, begin begin, end = end, begin
@ -124,10 +123,10 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
continue continue
} }
cn[seed[i]] = true cn[seed[i]] = true // 单个
} }
for c := 1; c < len(cn); c++ { for c := 1; c < len(cn); c++ { // 序列
if (set && cn[c]) || (!set && !cn[c]) { if (set && cn[c]) || (!set && !cn[c]) {
cc = append(cc, byte(c)) cc = append(cc, byte(c))
} }
@ -135,31 +134,31 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
} }
case '.': case '.':
for c := 1; c < len(cn); c++ { for c := 1; c < len(cn); c++ { // 全集
cc = append(cc, byte(c)) cc = append(cc, byte(c))
} }
case '\\': case '\\':
i++ i++
for _, c := range mat.char(seed[i]) { for _, c := range mat.char(seed[i]) { // 转义
cc = append(cc, c) cc = append(cc, c)
} }
default: default:
cc = append(cc, seed[i]) cc = append(cc, seed[i]) // 普通字符
} }
m.Debug("page: \033[31m%d %v\033[0m", len(ss), ss) m.Debug("page: \033[31m%d %v\033[0m", len(ss), ss)
m.Debug("cell: \033[32m%d %v\033[0m", len(cc), cc) m.Debug("cell: \033[32m%d %v\033[0m", len(cc), cc)
flag := '\000' flag := '\000'
if i+1 < len(seed) { if i+1 < len(seed) { // 次数
switch flag = rune(seed[i+1]); flag { switch flag = rune(seed[i+1]); flag {
case '?', '+', '*': case '?', '+', '*':
i++ i++
} }
} }
add := func(s int, c byte, cb func(*State)) { add := func(s int, c byte, cb func(*State)) { // 添加节点
state := mat.mat[s][c] state := mat.mat[s][c]
if state == nil { if state == nil {
state = &State{} state = &State{}
@ -182,7 +181,7 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
for _, s := range ss { for _, s := range ss {
for _, c := range cc { for _, c := range cc {
add(s, c, func(state *State) { add(s, c, func(state *State) {
switch flag { switch flag { // 次数
case '+': case '+':
sn = append(sn, true) sn = append(sn, true)
state.next = len(mat.mat) state.next = len(mat.mat)
@ -201,7 +200,7 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
} }
cc, ss = cc[:0], ss[:0] cc, ss = cc[:0], ss[:0]
for s, b := range sn { for s, b := range sn { // 迭代
if sn[s] = false; b && s > 0 { if sn[s] = false; b && s > 0 {
ss = append(ss, s) ss = append(ss, s)
} }
@ -209,13 +208,13 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
} }
trans := map[int]int{page: page} trans := map[int]int{page: page}
for i := begin; i < len(mat.mat); i++ { for i := mat.nlang; i < len(mat.mat); i++ { // 去空
if len(mat.mat[i]) > 0 { if len(mat.mat[i]) > 0 {
trans[i] = i trans[i] = i
continue continue
} }
for j := i; j < len(mat.mat); j++ { for j := i + 1; j < len(mat.mat); j++ {
if len(mat.mat[j]) > 0 { if len(mat.mat[j]) > 0 {
mat.mat[i] = mat.mat[j] mat.mat[i] = mat.mat[j]
mat.mat[j] = nil mat.mat[j] = nil
@ -230,14 +229,14 @@ func (mat *Matrix) Train(m *ice.Message, npage, nhash string, seed string) int {
} }
m.Debug("DEL: %v", trans) m.Debug("DEL: %v", trans)
for _, p := range points { for _, p := range points { // 去尾
p.s = trans[p.s] p.s = trans[p.s]
state := mat.mat[p.s][p.c] state := mat.mat[p.s][p.c]
m.Debug("GET(%d, %d): %#v", p.s, p.c, state)
if state.next = trans[state.next]; state.next == 0 { if state.next = trans[state.next]; state.next == 0 {
m.Debug("GET(%d, %d): %#v", p.s, p.c, state)
state.hash = hash state.hash = hash
m.Debug("SET(%d, %d): %#v", p.s, p.c, state)
} }
m.Debug("SET(%d, %d): %#v", p.s, p.c, state)
} }
m.Debug("%s %s npage: %v nhash: %v", "train", "lex", len(mat.page), len(mat.hash)) m.Debug("%s %s npage: %v nhash: %v", "train", "lex", len(mat.page), len(mat.hash))
@ -286,23 +285,23 @@ func (mat *Matrix) Parse(m *ice.Message, npage string, line []byte) (hash int, w
return return
} }
func (mat *Matrix) show(m *ice.Message) { func (mat *Matrix) show(m *ice.Message) {
show := map[int]bool{} showCol := map[int]bool{} // 有效列
for j := 1; j < mat.ncell; j++ { for j := 1; j < mat.ncell; j++ {
for i := 1; i < len(mat.mat); i++ { for i := 1; i < len(mat.mat); i++ {
if node := mat.mat[i][byte(j)]; node != nil { if node := mat.mat[i][byte(j)]; node != nil {
show[j] = true showCol[j] = true
} }
} }
} }
for i := 1; i < len(mat.mat); i++ { for i := 1; i < len(mat.mat); i++ {
if len(mat.mat[i]) == 0 { if len(mat.mat[i]) == 0 { // 无效行
continue continue
} }
m.Push("00", kit.Select(kit.Format("%02d", i), mat.hand[i])) m.Push("00", kit.Select(kit.Format("%02d", i), mat.hand[i]))
for j := 1; j < mat.ncell; j++ { for j := 1; j < mat.ncell; j++ {
if !show[j] { if !showCol[j] { // 无效列
continue continue
} }
key, value := kit.Format("%c", j), []string{} key, value := kit.Format("%c", j), []string{}
@ -314,7 +313,7 @@ func (mat *Matrix) show(m *ice.Message) {
value = append(value, cli.ColorGreen(m, node.next)) value = append(value, cli.ColorGreen(m, node.next))
} }
if node.hash > 0 { if node.hash > 0 {
value = append(value, cli.ColorRed(m, mat.word[node.hash])) value = append(value, cli.ColorRed(m, kit.Select(kit.Format("%d", node.hash), mat.word[node.hash])))
} }
} }
m.Push(key, strings.Join(value, ",")) m.Push(key, strings.Join(value, ","))
@ -371,8 +370,20 @@ func init() {
mdb.REMOVE: {Name: "create", Help: "删除", Hand: func(m *ice.Message, arg ...string) { mdb.REMOVE: {Name: "create", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(mdb.DELETE, m.Prefix(MATRIX), "", mdb.HASH, kit.MDB_HASH, m.Option(kit.MDB_HASH)) m.Cmdy(mdb.DELETE, m.Prefix(MATRIX), "", mdb.HASH, kit.MDB_HASH, m.Option(kit.MDB_HASH))
}}, }},
"show": {Name: "show", Help: "矩阵", Hand: func(m *ice.Message, arg ...string) { PARSE: {Name: "parse hash npage text=123", Help: "解析", Hand: func(m *ice.Message, arg ...string) {
m.Richs(m.Prefix(MATRIX), "", m.Option(kit.MDB_HASH), func(key string, value map[string]interface{}) { m.Richs(m.Prefix(MATRIX), "", m.Option(kit.MDB_HASH), func(key string, value map[string]interface{}) {
value = kit.GetMeta(value)
mat, _ := value[MATRIX].(*Matrix)
hash, word, rest := mat.Parse(m, m.Option(NPAGE), []byte(m.Option(kit.MDB_TEXT)))
m.Push(NHASH, mat.word[hash])
m.Push("word", string(word))
m.Push("rest", string(rest))
})
m.ProcessInner()
}},
"show": {Name: "show", Help: "矩阵", Hand: func(m *ice.Message, arg ...string) {
m.Richs(m.Prefix(MATRIX), "", kit.Select(m.Option(kit.MDB_HASH), arg, 0), func(key string, value map[string]interface{}) {
value = kit.GetMeta(value) value = kit.GetMeta(value)
value[MATRIX].(*Matrix).show(m) value[MATRIX].(*Matrix).show(m)
}) })
@ -386,9 +397,10 @@ func init() {
return return
} }
if m.Action(mdb.INSERT); len(arg) == 1 { // 词法列表 if m.Action(mdb.INSERT, "show"); len(arg) == 1 { // 词法列表
m.Fields(len(arg) == 1, "time,npage,nhash,text") m.Fields(len(arg) == 1, "time,npage,nhash,text")
m.Cmdy(mdb.SELECT, m.Prefix(MATRIX), kit.Keys(kit.MDB_HASH, arg[0]), mdb.LIST) m.Cmdy(mdb.SELECT, m.Prefix(MATRIX), kit.Keys(kit.MDB_HASH, arg[0]), mdb.LIST)
m.PushAction(PARSE)
return return
} }

View File

@ -6,16 +6,12 @@ import (
"strings" "strings"
ice "github.com/shylinux/icebergs" ice "github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/cli"
"github.com/shylinux/icebergs/base/lex" "github.com/shylinux/icebergs/base/lex"
"github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/mdb"
kit "github.com/shylinux/toolkits" kit "github.com/shylinux/toolkits"
) )
type Seed struct {
page int
hash int
word []string
}
type Point struct { type Point struct {
s int s int
c int c int
@ -35,11 +31,10 @@ type Matrix struct {
hash map[string]int hash map[string]int
word map[int]string word map[int]string
state map[State]*State mat [][]*State
mat [][]*State
lex *lex.Matrix
lex_key string lex_key string
lex *lex.Matrix
} }
func NewMatrix(m *ice.Message, nlang, ncell int) *Matrix { func NewMatrix(m *ice.Message, nlang, ncell int) *Matrix {
@ -53,7 +48,6 @@ func NewMatrix(m *ice.Message, nlang, ncell int) *Matrix {
key := m.Cmdx("lex.matrix", mdb.CREATE, 32, 256) key := m.Cmdx("lex.matrix", mdb.CREATE, 32, 256)
m.Cmd("lex.matrix", mdb.INSERT, key, "space", "space", "[\t \n]") m.Cmd("lex.matrix", mdb.INSERT, key, "space", "space", "[\t \n]")
mat.state = make(map[State]*State)
mat.mat = make([][]*State, nlang) mat.mat = make([][]*State, nlang)
return mat return mat
} }
@ -83,16 +77,18 @@ func (mat *Matrix) index(m *ice.Message, hash string, h string) int {
return x return x
} }
if hash == NPAGE { m.Assert(hash != NPAGE || len(which)+1 < mat.nlang)
which[h] = len(mat.page) + 1 which[h], names[len(which)+1] = len(which)+1, h
} else {
which[h] = len(mat.hash) + 1
}
names[which[h]] = h
m.Assert(hash != NPAGE || len(mat.page) < mat.nlang)
return which[h] return which[h]
} }
func (mat *Matrix) isVoid(page int) bool {
for j := 1; j < len(mat.mat[page]); j++ {
if mat.mat[page][j] != nil {
return false
}
}
return false
}
func (mat *Matrix) train(m *ice.Message, page, hash int, word []string, level int) (int, []*Point, []*Point) { func (mat *Matrix) train(m *ice.Message, page, hash int, word []string, level int) (int, []*Point, []*Point) {
m.Debug("%s %s\\%d page: %v hash: %v word: %v", TRAIN, strings.Repeat("#", level), level, page, hash, word) m.Debug("%s %s\\%d page: %v hash: %v word: %v", TRAIN, strings.Repeat("#", level), level, page, hash, word)
@ -116,19 +112,16 @@ func (mat *Matrix) train(m *ice.Message, page, hash int, word []string, level in
points = append(points, point...) points = append(points, point...)
i += num - 1 i += num - 1
for _, x := range end { for _, p := range end {
state := &State{} state := mat.mat[p.s][p.c]
*state = *mat.mat[x.s][x.c] if len(sn) <= state.next {
for i := len(sn); i <= state.next; i++ { sn = append(sn, make([]bool, state.next-len(sn)+1)...)
sn = append(sn, false)
} }
sn[state.next] = true sn[state.next] = true
points = append(points, x) if points = append(points, p); word[i] == "rep{" {
if word[i] == "rep{" {
state.star = s state.star = s
mat.mat[x.s][x.c] = state m.Debug("REP(%d, %d): %v", p.s, p.c, state)
m.Debug("REP(%d, %d): %v", x.s, x.c, state)
} }
} }
case "mul{": case "mul{":
@ -141,33 +134,33 @@ func (mat *Matrix) train(m *ice.Message, page, hash int, word []string, level in
} }
fallthrough fallthrough
default: default:
x, ok := mat.page[word[i]] c, ok := mat.page[word[i]]
if !ok { if !ok {
if x, _, _ = mat.lex.Parse(m, mat.name(s), []byte(word[i])); x == 0 { if c, _, _ = mat.lex.Parse(m, mat.name(s), []byte(word[i])); c == 0 {
// x = mat.lex.Train(m, mat.name(s), fmt.Sprintf("%d", len(mat.mat[s])+1), []byte(word[i])) // c = mat.lex.Train(m, mat.name(s), fmt.Sprintf("%d", len(mat.mat[s])+1), []byte(word[i]))
x = kit.Int(m.Cmdx("lex.matrix", mdb.INSERT, mat.lex_key, mat.name(s), len(mat.mat[s]), word[i])) c = kit.Int(m.Cmdx("lex.matrix", mdb.INSERT, mat.lex_key, mat.name(s), len(mat.mat[s]), word[i]))
mat.mat[s] = append(mat.mat[s], nil) mat.mat[s] = append(mat.mat[s], nil)
} }
} }
c := x state := mat.mat[s][c]
state := &State{} if state == nil {
if mat.mat[s][c] != nil { state = &State{}
*state = *mat.mat[s][c]
} }
m.Debug("GET(%d,%d): %v", s, c, state) m.Debug("GET(%d,%d): %#v", s, c, state)
if state.next == 0 { if state.next == 0 {
state.next = len(mat.mat) state.next = len(mat.mat)
mat.mat = append(mat.mat, make([]*State, mat.ncell)) mat.mat = append(mat.mat, make([]*State, mat.ncell))
sn = append(sn, false) sn = append(sn, true)
} else {
sn[state.next] = true
} }
sn[state.next] = true
mat.mat[s][c] = state mat.mat[s][c] = state
m.Debug("SET(%d,%d): %v", s, c, state)
ends = append(ends, &Point{s, c}) ends = append(ends, &Point{s, c})
points = append(points, &Point{s, c}) points = append(points, &Point{s, c})
m.Debug("SET(%d,%d): %#v", s, c, state)
} }
} }
next: next:
@ -181,45 +174,40 @@ func (mat *Matrix) train(m *ice.Message, page, hash int, word []string, level in
} }
} }
for _, s := range ss { trans := map[int]int{page: page}
if s < mat.nlang || s >= len(mat.mat) { loop:
continue for i := mat.nlang; i < len(mat.mat); i++ { // 去空
m.Debug("what %v %v", len(mat.mat[i]), mat.mat[i])
for j := 1; j < len(mat.mat[i]); j++ {
if mat.mat[i][j] != nil {
trans[i] = i
continue loop
}
} }
void := true
for _, x := range mat.mat[s] { for j := i + 1; j < len(mat.mat); j++ {
if x != nil { if len(mat.mat[j]) > 0 {
void = false mat.mat[i] = mat.mat[j]
mat.mat[j] = nil
trans[j] = i
break break
} }
} }
if void { if len(mat.mat[i]) == 0 {
mat.mat = mat.mat[:s] mat.mat = mat.mat[:i]
m.Debug("DEL: %d", len(mat.mat)) break
} }
} }
m.Debug("DEL: %v", trans)
for _, s := range ss { for _, p := range points { // 去尾
for _, p := range points { p.s = trans[p.s]
state := &State{} state := mat.mat[p.s][p.c]
*state = *mat.mat[p.s][p.c] m.Debug("GET(%d, %d): %#v", p.s, p.c, state)
if state.next = trans[state.next]; state.next == 0 {
if state.next == s { state.hash = hash
m.Debug("GET(%d, %d): %v", p.s, p.c, state)
if state.next >= len(mat.mat) {
state.next = 0
}
if hash > 0 {
state.hash = hash
}
mat.mat[p.s][p.c] = state
m.Debug("SET(%d, %d): %v", p.s, p.c, state)
}
if x, ok := mat.state[*state]; !ok {
mat.state[*state] = mat.mat[p.s][p.c]
} else {
mat.mat[p.s][p.c] = x
}
} }
m.Debug("SET(%d, %d): %#v", p.s, p.c, state)
} }
m.Debug("%s %s/%d word: %d point: %d end: %d", TRAIN, strings.Repeat("#", level), level, len(word), len(points), len(ends)) m.Debug("%s %s/%d word: %d point: %d end: %d", TRAIN, strings.Repeat("#", level), level, len(word), len(points), len(ends))
@ -278,36 +266,42 @@ func (mat *Matrix) Parse(m *ice.Message, rewrite Rewrite, page int, line []byte,
return hash, word, rest return hash, word, rest
} }
func (mat *Matrix) show(m *ice.Message) { func (mat *Matrix) show(m *ice.Message) {
max := mat.ncell showCol := map[int]bool{} // 有效列
for i := 1; i < len(mat.mat); i++ { for i := 1; i < len(mat.mat); i++ {
if len(mat.mat[i]) > max { for j := 1; j < len(mat.mat[i]); j++ {
max = len(mat.mat[i]) if node := mat.mat[i][j]; node != nil {
showCol[j] = true
}
} }
} }
for i := 1; i < len(mat.mat); i++ { for i := 1; i < len(mat.mat); i++ {
if len(mat.mat[i]) == 0 { if len(mat.mat[i]) == 0 { // 无效行
continue continue
} }
m.Push("00", kit.Select(kit.Format("%02d", i), mat.hand[i])) m.Push("00", kit.Select(kit.Format("%02d", i), mat.hand[i]))
for j := 1; j < max; j++ { for j := 1; j < len(mat.mat[i]); j++ {
if j > len(mat.page) && j < mat.ncell { if !showCol[j] { // 无效列
continue continue
} }
key := kit.Select(kit.Format("w%02d", j), mat.hand[j]) key, value := kit.Format("%d", j), []string{}
if j < len(mat.mat[i]) { if node := mat.mat[i][j]; node != nil {
if node := mat.mat[i][j]; node != nil { if node.star > 0 {
if node.next == 0 { value = append(value, cli.ColorYellow(m, node.star))
m.Push(key, mat.word[node.hash]) }
} else { if node.next > 0 {
m.Push(key, kit.Select(kit.Format("%02d", node.next), mat.hand[node.next])) value = append(value, cli.ColorGreen(m, node.next))
} }
continue if node.hash > 0 {
value = append(value, cli.ColorRed(m, mat.word[node.hash]))
} }
} }
m.Push(key, "") m.Push(key, strings.Join(value, ","))
} }
} }
m.Status(NLANG, mat.nlang, NCELL, mat.ncell, NPAGE, len(mat.page), NHASH, len(mat.hash))
} }
type Rewrite func(m *ice.Message, nhash string, hash int, word []string, rest []byte) (int, []string, []byte) type Rewrite func(m *ice.Message, nhash string, hash int, word []string, rest []byte) (int, []string, []byte)
@ -315,7 +309,8 @@ type Rewrite func(m *ice.Message, nhash string, hash int, word []string, rest []
const ( const (
NLANG = "nlang" NLANG = "nlang"
NCELL = "ncell" NCELL = "ncell"
NSEED = "nseed" )
const (
NPAGE = "npage" NPAGE = "npage"
NHASH = "nhash" NHASH = "nhash"
) )
@ -334,8 +329,11 @@ func init() {
MATRIX: {Name: "matrix name npage text auto", Help: "魔方矩阵", Action: map[string]*ice.Action{ MATRIX: {Name: "matrix name npage text auto", Help: "魔方矩阵", Action: map[string]*ice.Action{
mdb.CREATE: {Name: "create name=shy nlang=32 ncell=32", Help: "创建", Hand: func(m *ice.Message, arg ...string) { mdb.CREATE: {Name: "create name=shy nlang=32 ncell=32", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
mat := NewMatrix(m, kit.Int(kit.Select("32", m.Option(NLANG))), kit.Int(kit.Select("32", m.Option(NCELL)))) mat := NewMatrix(m, kit.Int(kit.Select("32", m.Option(NLANG))), kit.Int(kit.Select("32", m.Option(NCELL))))
h := m.Rich(m.Prefix(MATRIX), "", kit.Data(kit.MDB_TIME, m.Time(), kit.MDB_NAME, m.Option(kit.MDB_NAME), MATRIX, mat, NLANG, mat.nlang, NCELL, mat.ncell)) h := m.Rich(m.Prefix(MATRIX), "", kit.Data(
switch cb := m.Optionv("matrix.cb").(type) { kit.MDB_TIME, m.Time(), kit.MDB_NAME, m.Option(kit.MDB_NAME),
MATRIX, mat, NLANG, mat.nlang, NCELL, mat.ncell,
))
switch cb := m.Optionv(kit.Keycb(MATRIX)).(type) {
case func(string, *Matrix): case func(string, *Matrix):
cb(h, mat) cb(h, mat)
} }

View File

@ -1,15 +1,15 @@
package code package code
import ( import (
"os"
"path"
"strings"
ice "github.com/shylinux/icebergs" ice "github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/cli"
"github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/mdb"
"github.com/shylinux/icebergs/base/nfs" "github.com/shylinux/icebergs/base/nfs"
kit "github.com/shylinux/toolkits" kit "github.com/shylinux/toolkits"
"os"
"path"
"strings"
) )
func _c_tags(m *ice.Message, key string) { func _c_tags(m *ice.Message, key string) {