Documentation ¶
Index ¶
- Constants
- func LoadField[T any](Mongo *mongo.Database, collectionName string, typeJson string) ([]T, error)
- type BlackList
- type IllegalWordsSearch
- func (this *IllegalWordsSearch) ContainsAny(text string) bool
- func (this *IllegalWordsSearch) ContainsAny2(text string, flag int) bool
- func (this *IllegalWordsSearch) CreateCollection() error
- func (this *IllegalWordsSearch) FindAll(text string) []*IllegalWordsSearchResult
- func (this *IllegalWordsSearch) FindAll2(text string, flag int) []*IllegalWordsSearchResult
- func (this *IllegalWordsSearch) FindFirst(text string) *IllegalWordsSearchResult
- func (this *IllegalWordsSearch) FindFirst2(text string, flag int) *IllegalWordsSearchResult
- func (this *IllegalWordsSearch) Load2(f *os.File)
- func (this *IllegalWordsSearch) LoadData()
- func (this *IllegalWordsSearch) LoadFromDB(config *MongoConfig)
- func (this *IllegalWordsSearch) Replace(text string, replaceChar rune) string
- func (this *IllegalWordsSearch) Replace2(text string, replaceChar rune, flag int) string
- func (this *IllegalWordsSearch) Save2(f *os.File)
- func (this *IllegalWordsSearch) SetBlacklist(blacklist []int) error
- func (this *IllegalWordsSearch) SetKeywords(keywords []string)
- func (this *IllegalWordsSearch) SetSkipWords(skipList string)
- type IllegalWordsSearchResult
- type Keywords
- type MongoConfig
- type StringSearch
- type StringSearchEx
- type WordsSearch
- func (this *WordsSearch) ContainsAny(text string) bool
- func (this *WordsSearch) FindAll(text string) []*WordsSearchResult
- func (this *WordsSearch) FindFirst(text string) *WordsSearchResult
- func (this *WordsSearch) Replace(text string, replaceChar int32) string
- func (this *WordsSearch) SetKeywords(keywords []string)
- type WordsSearchEx
- type WordsSearchResult
Constants ¶
View Source
const BlackListCollection = "blacklist"
View Source
const ID = "_id"
View Source
const KeywordBson = "keyword"
View Source
const KeywordsCollection = "keywords"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IllegalWordsSearch ¶
type IllegalWordsSearch struct { tool.BaseSearchEx UseSkipWordFilter bool UseDuplicateWordFilter bool UseBlacklistFilter bool UseDBCcaseConverter bool UseSimplifiedChineseConverter bool UseIgnoreCase bool // contains filtered or unexported fields }
func NewIllegalWordsSearch ¶
func NewIllegalWordsSearch() *IllegalWordsSearch
func (*IllegalWordsSearch) ContainsAny ¶
func (this *IllegalWordsSearch) ContainsAny(text string) bool
func (*IllegalWordsSearch) ContainsAny2 ¶
func (this *IllegalWordsSearch) ContainsAny2(text string, flag int) bool
func (*IllegalWordsSearch) CreateCollection ¶
func (this *IllegalWordsSearch) CreateCollection() error
func (*IllegalWordsSearch) FindAll ¶
func (this *IllegalWordsSearch) FindAll(text string) []*IllegalWordsSearchResult
在文本中查找所有的关键字
func (*IllegalWordsSearch) FindAll2 ¶
func (this *IllegalWordsSearch) FindAll2(text string, flag int) []*IllegalWordsSearchResult
func (*IllegalWordsSearch) FindFirst ¶
func (this *IllegalWordsSearch) FindFirst(text string) *IllegalWordsSearchResult
func (*IllegalWordsSearch) FindFirst2 ¶
func (this *IllegalWordsSearch) FindFirst2(text string, flag int) *IllegalWordsSearchResult
func (*IllegalWordsSearch) Load2 ¶
func (this *IllegalWordsSearch) Load2(f *os.File)
func (*IllegalWordsSearch) LoadData ¶
func (this *IllegalWordsSearch) LoadData()
func (*IllegalWordsSearch) LoadFromDB ¶
func (this *IllegalWordsSearch) LoadFromDB(config *MongoConfig)
func (*IllegalWordsSearch) Replace ¶
func (this *IllegalWordsSearch) Replace(text string, replaceChar rune) string
func (*IllegalWordsSearch) Replace2 ¶
func (this *IllegalWordsSearch) Replace2(text string, replaceChar rune, flag int) string
func (*IllegalWordsSearch) Save2 ¶
func (this *IllegalWordsSearch) Save2(f *os.File)
func (*IllegalWordsSearch) SetBlacklist ¶
func (this *IllegalWordsSearch) SetBlacklist(blacklist []int) error
func (*IllegalWordsSearch) SetKeywords ¶
func (this *IllegalWordsSearch) SetKeywords(keywords []string)
func (*IllegalWordsSearch) SetSkipWords ¶
func (this *IllegalWordsSearch) SetSkipWords(skipList string)
type IllegalWordsSearchResult ¶
type IllegalWordsSearchResult struct { Start int End int Keyword string BlacklistType int SrcString string }
type MongoConfig ¶
type StringSearch ¶
type StringSearch struct {
// contains filtered or unexported fields
}
func NewStringSearch ¶
func NewStringSearch() *StringSearch
func (*StringSearch) ContainsAny ¶
func (this *StringSearch) ContainsAny(text string) bool
func (*StringSearch) FindAll ¶
func (this *StringSearch) FindAll(text string) []string
func (*StringSearch) FindFirst ¶
func (this *StringSearch) FindFirst(text string) string
func (*StringSearch) Replace ¶
func (this *StringSearch) Replace(text string, replaceChar int32) string
func (*StringSearch) SetKeywords ¶
func (this *StringSearch) SetKeywords(keywords []string)
type StringSearchEx ¶
type StringSearchEx struct {
tool.BaseSearchEx
}
func NewStringSearchEx ¶
func NewStringSearchEx() *StringSearchEx
func (*StringSearchEx) ContainsAny ¶
func (this *StringSearchEx) ContainsAny(text string) bool
func (*StringSearchEx) FindAll ¶
func (this *StringSearchEx) FindAll(text string) []string
func (*StringSearchEx) FindFirst ¶
func (this *StringSearchEx) FindFirst(text string) string
type WordsSearch ¶
type WordsSearch struct {
// contains filtered or unexported fields
}
func NewWordsSearch ¶
func NewWordsSearch() *WordsSearch
func (*WordsSearch) ContainsAny ¶
func (this *WordsSearch) ContainsAny(text string) bool
func (*WordsSearch) FindAll ¶
func (this *WordsSearch) FindAll(text string) []*WordsSearchResult
func (*WordsSearch) FindFirst ¶
func (this *WordsSearch) FindFirst(text string) *WordsSearchResult
func (*WordsSearch) Replace ¶
func (this *WordsSearch) Replace(text string, replaceChar int32) string
func (*WordsSearch) SetKeywords ¶
func (this *WordsSearch) SetKeywords(keywords []string)
type WordsSearchEx ¶
type WordsSearchEx struct {
tool.BaseSearchEx
}
func NewWordsSearchEx ¶
func NewWordsSearchEx() *WordsSearchEx
func (*WordsSearchEx) ContainsAny ¶
func (this *WordsSearchEx) ContainsAny(text string) bool
func (*WordsSearchEx) FindAll ¶
func (this *WordsSearchEx) FindAll(text string) []*WordsSearchResult
func (*WordsSearchEx) FindFirst ¶
func (this *WordsSearchEx) FindFirst(text string) *WordsSearchResult
type WordsSearchResult ¶
func NewWordsSearchResult ¶
func NewWordsSearchResult(keyword string, start int, end int, index int) *WordsSearchResult
Source Files ¶
Click to show internal directories.
Click to hide internal directories.