1 Star 0 Fork 0

BabyRun / triesearch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
node.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
心跳NicYan 提交于 2023-03-29 09:30 . 新增项目
package triesearch
// Node
/**
* @Author: rym 2022-11-16 09:01:35
* @Description: 数据结构节点对象
*/
type Node struct {
// Children
/**
* @Author: rym 2022-11-16 09:09:00
* @Description: 该节点的子节点字典
*/
Children map[rune]*Node `json:"children"`
// ContentMap
/**
* @Author: rym 2023-03-09 16:00:51
* @Description: 临时用的map,用来作数据去重
*/
ContentMap map[string]string
// Char
/**
* @Author: rym 2022-11-16 09:01:47
* @Description: 该节点的字符
*/
Char string
// ContentList
/**
* @Author: rym 2022-11-16 09:10:54
* @Description:
*/
Content []string `json:"content"`
// Code
/**
* @Author: rym 2022-11-16 09:08:38
* @Description: 改节点的unicode
*/
Code rune
}
// newTrieNode
/**
* @Author: rym 2022-11-16 17:18:08
* @Description: 初始化节点
* @param char
* @return *Node
*/
func newTrieNode(char string) *Node {
return &Node{
Char: char,
Children: make(map[rune]*Node),
Content: []string{},
}
}
Go
1
https://gitee.com/babyrun-plus/triesearch.git
git@gitee.com:babyrun-plus/triesearch.git
babyrun-plus
triesearch
triesearch
24a98b2821df

搜索帮助