analyzer

package
v0.0.0-...-ffe3fa0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2013 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Good           = "Good"
	Bad            = "Bad"
	Neutral        = "Neutral"
	ClassIdxOfGood = 0
	ClassIdxOfBad  = 1

	Threshold = 0.01
)

Variables

This section is empty.

Functions

func Normalize

func Normalize(words []string, cutset string) []string

Types

type Analyzer

type Analyzer interface {
	Test(text string) string
}

type BayesianAnalyzer

type BayesianAnalyzer struct {
	// contains filtered or unexported fields
}

func NewBayesianAnalyzer

func NewBayesianAnalyzer(traningDataFilePath string, dictDataFilePath string) (*BayesianAnalyzer, error)

func NewBayesianAnalyzerWithUpdater

func NewBayesianAnalyzerWithUpdater(traningDataFilePath string, dictDataFilePath string, updateDelay time.Duration) (*BayesianAnalyzer, error)

func (*BayesianAnalyzer) Explain

func (ba *BayesianAnalyzer) Explain(text string) WordFreqList

func (*BayesianAnalyzer) Learn

func (ba *BayesianAnalyzer) Learn(text, class string)

func (*BayesianAnalyzer) Test

func (ba *BayesianAnalyzer) Test(text string) string

type DelayedUpdater

type DelayedUpdater struct {
	// contains filtered or unexported fields
}

func NewDelayedUpdater

func NewDelayedUpdater(classifier *bayesian.Classifier, traningDataFilePath string, updateDelay time.Duration, coordinator *sync.RWMutex) *DelayedUpdater

func (*DelayedUpdater) Update

func (bu *DelayedUpdater) Update()

type Learner

type Learner interface {
	Learn(text, class string)
}

type Updater

type Updater interface {
	Update()
}

type WordFreq

type WordFreq struct {
	Word       string
	FreqMatrix []float64
}

func (*WordFreq) String

func (wf *WordFreq) String() string

type WordFreqList

type WordFreqList []WordFreq

func (WordFreqList) String

func (wfl WordFreqList) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL