Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Update readme #2

Merged
merged 2 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 💬 GoSentiwordnet

[![Build Status](https://travis-ci.com/dinopuguh/gosentiwordnet.svg?branch=master)](https://travis-ci.com/dinopuguh/gosentiwordnet) [![Go Report Card](https://goreportcard.com/badge/github.com/dinopuguh/gosentiwordnet)](https://goreportcard.com/report/github.com/dinopuguh/gosentiwordnet) [![codecov](https://codecov.io/gh/dinopuguh/gosentiwordnet/branch/master/graph/badge.svg)](https://codecov.io/gh/dinopuguh/gosentiwordnet)

Sentiment analyzer using [sentiwordnet](https://github.com/aesuli/SentiWordNet) lexicon in Go. This library produce sentiment score for each word, including positive, negative, and objective score.

## ⚙ Installation
Expand Down
6 changes: 3 additions & 3 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func main() {
sa := goswn.New()

tokens := []Token{
Token{Word: "love", PosTag: "v", Usage: "2"},
Token{Word: "neat", PosTag: "a", Usage: "4"},
Token{Word: "overacting", PosTag: "n", Usage: "1"},
{Word: "love", PosTag: "v", Usage: "2"},
{Word: "neat", PosTag: "a", Usage: "4"},
{Word: "overacting", PosTag: "n", Usage: "1"},
}

for _, token := range tokens {
Expand Down
8 changes: 4 additions & 4 deletions gosentiwordnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ type SentimentTestCase struct {

func generateTestCases() []SentimentTestCase {
return []SentimentTestCase{
SentimentTestCase{Word: "love", PosTag: "v", Usage: "2", Scores: gosentiwordnet.Sentiment{Positive: 1, Negative: 0, Objective: 0}},
SentimentTestCase{Word: "neat", PosTag: "a", Usage: "4", Scores: gosentiwordnet.Sentiment{Positive: 0.625, Negative: 0, Objective: 0.375}},
SentimentTestCase{Word: "overacting", PosTag: "n", Usage: "1", Scores: gosentiwordnet.Sentiment{Positive: 0, Negative: 0.875, Objective: 0.125}},
SentimentTestCase{Word: "finely", PosTag: "r", Usage: "2", Scores: gosentiwordnet.Sentiment{Positive: 0.625, Negative: 0, Objective: 0.375}},
{Word: "love", PosTag: "v", Usage: "2", Scores: gosentiwordnet.Sentiment{Positive: 1, Negative: 0, Objective: 0}},
{Word: "neat", PosTag: "a", Usage: "4", Scores: gosentiwordnet.Sentiment{Positive: 0.625, Negative: 0, Objective: 0.375}},
{Word: "overacting", PosTag: "n", Usage: "1", Scores: gosentiwordnet.Sentiment{Positive: 0, Negative: 0.875, Objective: 0.125}},
{Word: "finely", PosTag: "r", Usage: "2", Scores: gosentiwordnet.Sentiment{Positive: 0.625, Negative: 0, Objective: 0.375}},
}
}

Expand Down
1 change: 1 addition & 0 deletions helpers/substrings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package helpers

import "strings"

// CheckSubstrings checks the string containing substring or not
func CheckSubstrings(str string, subs ...string) bool {
isMatch := true

Expand Down