Documentation ¶ Index ¶ func ExpandWords(wcs []*WordCount) []uint32 type Corpus func (this *Corpus) AddDoc(docId uint32, wcs []*WordCount) func (this *Corpus) Load(fn string) type WordCount Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ExpandWords ¶ func ExpandWords(wcs []*WordCount) []uint32 Types ¶ type Corpus ¶ type Corpus struct { VocabSize uint32 DocNum uint32 Docs map[uint32][]*WordCount } func (*Corpus) AddDoc ¶ func (this *Corpus) AddDoc(docId uint32, wcs []*WordCount) add one document to corpus with specified docId and word count list, if the specified docId already exists in corpus, the old doc will be overwritted func (*Corpus) Load ¶ func (this *Corpus) Load(fn string) load training data from file, the file format should be like: [docId wordId:wordCount wordId:wordCount ... wordId:wordCount] the function will panic if docId, wordId and wordCount cannot be parsed to uint32 type WordCount ¶ type WordCount struct { WordId uint32 Count uint32 } Source Files ¶ View all Source files corpus.go Click to show internal directories. Click to hide internal directories.