Documentation
¶
Index ¶
- type Preprocessor
- func (p *Preprocessor) DetectAndReplacePinyin(text string) []string
- func (p *Preprocessor) NormalizeHomophone(text string) []string
- func (p *Preprocessor) Process(text string) string
- func (p *Preprocessor) ProcessWithPinyin(text string) []string
- func (p *Preprocessor) SetConfig(cfg *config.MappingConfig)
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) ProcessWithPinyin ¶
func (p *Preprocessor) ProcessWithPinyin(text string) []string
ProcessWithPinyin 处理包含拼音混合的文本
func (*Preprocessor) SetConfig ¶
func (p *Preprocessor) SetConfig(cfg *config.MappingConfig)
SetConfig 设置映射配置
Click to show internal directories.
Click to hide internal directories.