sentitext

package
v0.0.0-...-003d5aa Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: GPL-3.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

Emoji simple regex to match only emoji

View Source
var Spaces *regexp.Regexp

Spaces simple regex to split emojis and words

Functions

func SentimentValence

func SentimentValence(sentitext *SentiText, item SentiWord, i int, sentiments []float64) []float64

SentimentValence .

Types

type SentiText

type SentiText struct {
	WordsAndEmotes *[]SentiWord
	IsCapDiff      bool
	Original       string
}

SentiText Identify sentiment-relevant string-level properties of input text

func Parse

func Parse(text string, lex lexicon.Lexicon) (s *SentiText)

Parse and Identify sentiment-relevant string-level properties of input text

type SentiWord

type SentiWord struct {
	Word          string
	Lower         string
	BaseSentiment float64
	IsCaps        bool
	BoostValue    float64
	IsContrast    bool
	IsNegation    bool
}

type Sentiment

type Sentiment struct {
	Negative float64 `json:"neg" csv:"neg"`
	Neutral  float64 `json:"neu" csv:"neu"`
	Positive float64 `json:"pos" csv:"pos"`
	Compound float64 `json:"compound" csv:"compound"`
}

Sentiment of a phrase or sentence

func PolarityScore

func PolarityScore(senti *SentiText) Sentiment

PolarityScore Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence.

func ScoreValence

func ScoreValence(sentimentscores []float64, text string) Sentiment

ScoreValence .

Jump to

Keyboard shortcuts

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