Documentation ¶
Index ¶
- Variables
- type CensorWordDetection
- type Options
- func WithCensorReplaceChar(char string) Options
- func WithCustomCensorList(list []string) Options
- func WithKeepPrefixChar() Options
- func WithKeepSuffixChar() Options
- func WithReplaceCheckPattern(pattern string) Options
- func WithSanitizeSpecialCharacters(status bool) Options
- func WithTextNormalization(status bool) Options
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Transformer transform.Transformer
)
Functions ¶
This section is empty.
Types ¶
type CensorWordDetection ¶
type CensorWordDetection struct { CensorList []string CensorReplaceChar string KeepPrefixChar bool KeepSuffixChar bool SanitizeSpecialCharacters bool TextNormalization bool ReplaceCheckPattern string }
func NewDetector ¶
func NewDetector(options ...Options) *CensorWordDetection
this will create a new CensorWordDetection object
func (*CensorWordDetection) CensorWord ¶
func (censor *CensorWordDetection) CensorWord(word string) (string, error)
Censor Word
func (*CensorWordDetection) SanitizeCharacter ¶
func (censor *CensorWordDetection) SanitizeCharacter(str string) string
remove special characters from string
type Options ¶
type Options func(*CensorWordDetection)
func WithCustomCensorList ¶
WithCustomCensorList change the default censor list can provide own censor words list
func WithReplaceCheckPattern ¶
WithReplaceCheckPattern
func WithSanitizeSpecialCharacters ¶
WithSanitizeSpecialCharacters
Click to show internal directories.
Click to hide internal directories.