Documentation ¶
Index ¶
- Constants
- func CutAccurateW(s string, words *[]string)
- func CutFullW(s string, words *[]string)
- func CutNoHMMW(s string, words *[]string)
- func CutSymbolW(s string, words *[]string)
- func GetDictFS() fs.FS
- func GetDictFile(file string) (string, error)
- func GetDictPath() string
- func Init(dictPath string)
- func InitDictionary()
- func InitFSToken()
- func InitTFIDF()
- func InitWithFS(fs fs.FS)
- func IsChineseChars(s string) bool
- func IsEnglishChars(s string) bool
- func IsTextChars(s string) bool
- func SetDictFS(fs fs.FS)
- func SetDictPath(path string)
- func SplitChineseSeg(s string) []string
- func SplitNumberSeg(s string) []string
- func SplitTextSeg(s string) []string
- type Dictionary
- type FinalSeg
- type IDFLoader
- type Keyword
- type Keywords
- type NodeDAG
- type Sentence
- type StopWords
- type TFIDF
Constants ¶
View Source
const ( DictStdFile = "dict_std_utf8.txt" // standard dictionary file DictUserFile = "dict_user_utf8.txt" // user-defined dictionary file IDFStdFile = "idf_std_utf8.txt" // standard IDF file StopWordsStdFile = "stop_words_std_utf8.txt" // standard stop words file StopWordsUserFile = "stop_words_user_utf8.txt" // user-defined stop words file RegExpEnglish = "([a-zA-Z0-9])+" // English regular expression RegExpChinese = "([\u4e00-\u9fa5])+" // Chinese regular expression RegExpText = "([\u4e00-\u9fa5a-zA-Z0-9+#&._%-])+" // text regular expression RegExpNumber = "[a-zA-Z0-9]+(\\.\\d+)?%?" // numeric regular expression RegExpDelimiter = "[\\r\\n\\s\\t]" // delimiter regular expression DefaultWordsLen = 32 // default slice size of the word segmentation result )
View Source
const (
DefaultIDFSize = 300000
)
Variables ¶
This section is empty.
Functions ¶
func CutAccurateW ¶
func CutSymbolW ¶
func GetDictPath ¶
func GetDictPath() string
func InitDictionary ¶
func InitDictionary()
func InitFSToken ¶
func InitFSToken()
func InitWithFS ¶
func IsChineseChars ¶
func IsEnglishChars ¶
func IsTextChars ¶
func SetDictPath ¶
func SetDictPath(path string)
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
func GetDictionary ¶
func GetDictionary() *Dictionary
func (*Dictionary) Exist ¶
func (d *Dictionary) Exist(word string) bool
func (*Dictionary) GetTotalFreq ¶
func (d *Dictionary) GetTotalFreq() float64
type FinalSeg ¶
type FinalSeg struct {
// contains filtered or unexported fields
}
func GetFinalSeg ¶
func GetFinalSeg() *FinalSeg
type Sentence ¶
type Sentence struct {
// contains filtered or unexported fields
}
func NewSentence ¶
type TFIDF ¶
type TFIDF struct {
// contains filtered or unexported fields
}
func (*TFIDF) ExistStopWord ¶
Click to show internal directories.
Click to hide internal directories.