Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnglishStrategy ¶
EnglishStrategy is the default scoring strategy (implements ScoringStrategy interface)
func NewEnglishStrategy ¶
func NewEnglishStrategy() *EnglishStrategy
NewEnglishStrategy builds the default sentiment scoring strategy for the English language
type ScoringStrategy ¶
type ScoringStrategy interface {
// contains filtered or unexported methods
}
ScoringStrategy is an interface that holds a function to determine a scoring strategy
type SentimentAnalyzer ¶
type SentimentAnalyzer struct { Strategy ScoringStrategy Tokens map[string]float64 Negators map[string]float64 }
SentimentAnalyzer is loaded with a dictionary and contains the method to provide sentiment analysis
func NewDefaultSentimentAnalyzer ¶
func NewDefaultSentimentAnalyzer() *SentimentAnalyzer
NewDefaultSentimentAnalyzer returns an English AFINN165 sentiment analyzer
func NewSentimentAnalyzerFromStrategy ¶
func NewSentimentAnalyzerFromStrategy(strategy ScoringStrategy) *SentimentAnalyzer
NewSentimentAnalyzerFromStrategy loads a dictionary and returns a new instance of a SentimentAnalyzer, given a strategy
func (*SentimentAnalyzer) Analyze ¶
func (a *SentimentAnalyzer) Analyze(phrase string) SentimentResult
Analyze a phrase for its sentiment (positive or negative)
Click to show internal directories.
Click to hide internal directories.