Documentation
¶
Overview ¶
Package search 提供基于 Unicode 字符的文本索引与匹配能力。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexOfRunes ¶
IndexOfRunes 返回 needle 在 text 中首次出现的位置;未找到时返回 -1。
func RuneSearchTable ¶
RuneSearchTable 为 needle 构造 KMP 最长前缀表。
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder 构建 Index,并避免为每个文本段单独分配临时 map。
func NewBuilder ¶
NewBuilder 创建一个可容纳 runCapacity 个文本段的构建器。
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index 保存规范化后的文本段,并记录每个字符出现在哪些文本段中。
func (*Index) Candidates ¶
Candidates 返回包含指定字符的文本段索引。
Click to show internal directories.
Click to hide internal directories.