Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { // Char /** * @Author: rym 2022-11-16 09:01:47 * @Description: 该节点的字符 */ Char string // Code /** * @Author: rym 2022-11-16 09:08:38 * @Description: 改节点的unicode */ Code rune // Children /** * @Author: rym 2022-11-16 09:09:00 * @Description: 该节点的子节点字典 */ Children map[rune]*Node `json:"children"` // ContentList /** * @Author: rym 2022-11-16 09:10:54 * @Description: */ Content []string `json:"content"` }
Node *
- @Author: rym 2022-11-16 09:01:35
- @Description: 数据结构节点对象
type Tire ¶
type Tire struct { // Root /** * @Author: rym 2022-11-16 09:14:41 * @Description: 根节点 */ Root *Node // contains filtered or unexported fields }
Tire *
- @Author: rym 2022-11-16 09:18:42
- @Description:Tire Map 数据结构对象
func (*Tire) Add ¶
Add *
- @Author: rym 2022-11-16 17:39:14
- @Description: 根据关键词添加节点,并下挂相关内容 对外方法
- @Description: 创建普通的树节点 例如: 碳中和 通过 碳、碳中、碳中和 可以查找到对应的内容列表
- @receiver t
- @param keyword
- @param content
func (*Tire) AddFull ¶
AddFull *
- @Author: rym 2022-11-16 17:32:32
- @Description: 根据关键词添加节点,并下挂相关内容 对外方法
- @Description: 创建详细的树节点 例如:碳中和 通过 碳、碳中、碳中和、中、中和、和 都可以查找到对应的内容列表
- @Description: 此方式创建的树,会更多消耗内存
- @receiver t
- @param keyword
- @param content
func (*Tire) AutoAdd ¶ added in v0.0.2
AutoAdd *
- @Author: rym 2023-01-31 17:26:29
- @Description:自动添加非全词搜索
- @receiver t
- @param list
func (*Tire) AutoAddFull ¶ added in v0.0.2
AutoAddFull *
- @Author: rym 2023-01-31 17:24:56
- @Description:自动添加全词搜索
- @receiver t
- @param list
Click to show internal directories.
Click to hide internal directories.