Documentation
¶
Overview ¶
A Go package for n-gram based text categorization, with support for utf-8 and raw text.
Many built-in language models are based on frequency lists, see:
http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists
Most of these lists are based on www.opensubtitles.org, see:
http://invokeit.wordpress.com/frequency-word-lists/ https://skydrive.live.com/?cid=3732e80b128d016f&id=3732E80B128D016F%213584
Languages: af ar bg ca cs cy da de el en es et eu fa fi fr he hr hu id is it lt lv mk ms nl no pl pt ro ru sk sl sq sr sr-latin sv tr uk ur
Other language models are based on texts collected from Wikipedia.
Languages: eo fy ga gd hi ia ja kk ko la lb sw ta tl vi vo yi yo zh
Index ¶
- Constants
- func GetPatterns(s string, useRunes bool) []*countType
- type TextCat
- func (tc *TextCat) ActiveLanguages() []string
- func (tc *TextCat) AddLanguage(language, filename string) error
- func (tc *TextCat) AvailableLanguages() []string
- func (tc *TextCat) Classify(text string) (languages []string, err error)
- func (tc *TextCat) DisableAllRawLanguages()
- func (tc *TextCat) DisableAllUtf8Languages()
- func (tc *TextCat) DisableLanguages(language ...string)
- func (tc *TextCat) EnableAllRawLanguages()
- func (tc *TextCat) EnableAllUtf8Languages()
- func (tc *TextCat) EnableLanguages(language ...string)
- func (tc *TextCat) GetMaxCandidates() int
- func (tc *TextCat) GetMinDocSize() int
- func (tc *TextCat) GetThresholdValue() float64
- func (tc *TextCat) SetMaxCandidates(maxCandidates int)
- func (tc *TextCat) SetMinDocSize(minDocSize int)
- func (tc *TextCat) SetThresholdValue(thresholdValue float64)
- func (tc *TextCat) SetVerbose(verbose bool)
Constants ¶
const (
MaxPatterns = 400
)
Variables ¶
This section is empty.
Functions ¶
func GetPatterns ¶
Types ¶
type TextCat ¶
type TextCat struct {
// contains filtered or unexported fields
}
func NewTextCat ¶
func NewTextCat() *TextCat
func (*TextCat) ActiveLanguages ¶
func (*TextCat) AddLanguage ¶
Add language created by 'textpat' in package github.com/pebbe/textcat/textpat
func (*TextCat) AvailableLanguages ¶
func (*TextCat) DisableAllRawLanguages ¶
func (tc *TextCat) DisableAllRawLanguages()
func (*TextCat) DisableAllUtf8Languages ¶
func (tc *TextCat) DisableAllUtf8Languages()
func (*TextCat) DisableLanguages ¶
func (*TextCat) EnableAllRawLanguages ¶
func (tc *TextCat) EnableAllRawLanguages()
func (*TextCat) EnableAllUtf8Languages ¶
func (tc *TextCat) EnableAllUtf8Languages()
func (*TextCat) EnableLanguages ¶
func (*TextCat) GetMaxCandidates ¶
func (*TextCat) GetMinDocSize ¶
func (*TextCat) GetThresholdValue ¶
func (*TextCat) SetMaxCandidates ¶
func (*TextCat) SetMinDocSize ¶
func (*TextCat) SetThresholdValue ¶
func (*TextCat) SetVerbose ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
The `bootstrap` program is used to generated language patterns and store them as the Go source file `../data.go`.
|
The `bootstrap` program is used to generated language patterns and store them as the Go source file `../data.go`. |
|
The program `textcat` is for classifying text by language.
|
The program `textcat` is for classifying text by language. |
|
The program `textpat` creates language patterns that can be loaded into running Go programs that are using the textcat library.
|
The program `textpat` creates language patterns that can be loaded into running Go programs that are using the textcat library. |