preprocessor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preprocessor

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

Preprocessor 文本预处理器

func NewPreprocessor

func NewPreprocessor(options core.SWDOptions) *Preprocessor

NewPreprocessor 创建新的预处理器实例

func NewPreprocessorWithConfig

func NewPreprocessorWithConfig(options core.SWDOptions, cfg *config.MappingConfig) *Preprocessor

NewPreprocessorWithConfig 使用自定义配置创建预处理器

func (*Preprocessor) DetectAndReplacePinyin

func (p *Preprocessor) DetectAndReplacePinyin(text string) []string

DetectAndReplacePinyin 检测文本中的拼音并替换为可能的汉字组合

func (*Preprocessor) NormalizeHomophone

func (p *Preprocessor) NormalizeHomophone(text string) []string

NormalizeHomophone 处理同音字(外部调用)

func (*Preprocessor) Process

func (p *Preprocessor) Process(text string) string

Process 处理文本

func (*Preprocessor) ProcessWithPinyin

func (p *Preprocessor) ProcessWithPinyin(text string) []string

ProcessWithPinyin 处理包含拼音混合的文本

func (*Preprocessor) SetConfig

func (p *Preprocessor) SetConfig(cfg *config.MappingConfig)

SetConfig 设置映射配置

Jump to

Keyboard shortcuts

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