Documentation
¶
Overview ¶
Package govader implements the vader sentiment analysis algorithm see https://github.com/cjhutto/vaderSentiment
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PythonesqueRegex ¶
type PythonesqueRegex struct {
LowerRegex *regexp.Regexp
UpperRegex *regexp.Regexp
PunctuationRegex *regexp.Regexp
PunctuationString string
}
PythonesqueRegex holds all the regex needed to replicate python string manipulation behaviors
func NewPythonesqueRegex ¶
func NewPythonesqueRegex() *PythonesqueRegex
NewPythonesqueRegex builds a new set of regex
type SentiText ¶
type SentiText struct {
Text string
WordsAndEmoticons []string
WordsAndEmoticonsLower []string
IsCapDiff bool
}
SentiText holds sentiment-relevant string-level properties of input text.
func NewSentiText ¶
func NewSentiText(text string, pr *PythonesqueRegex) *SentiText
NewSentiText initliazes and returns a fleshed-out SentiText.
type SentimentIntensityAnalyzer ¶
type SentimentIntensityAnalyzer struct {
Lexicon map[string]float64
EmojiDict map[string]string
Constants *TermConstants
}
SentimentIntensityAnalyzer computes sentiment intensity scores for sentences.
func NewSentimentIntensityAnalyzer ¶
func NewSentimentIntensityAnalyzer() *SentimentIntensityAnalyzer
NewSentimentIntensityAnalyzer constructs and initializes an analyzer for computing intensity scores to sentences.
func (*SentimentIntensityAnalyzer) PolarityScores ¶
func (sia *SentimentIntensityAnalyzer) PolarityScores(text string) Sentiment
PolarityScores returns a score for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence.
type TermConstants ¶
type TermConstants struct {
NegateList []string
BoosterDict map[string]float64
LadenIdioms map[string]float64
SpecialCaseIdioms map[string]float64
Regex *PythonesqueRegex
}
TermConstants contains the large list and dictionary constants
func NewTermConstants ¶
func NewTermConstants() *TermConstants
NewTermConstants assembles a fully-populated constant struct