calculate_score: Calculate the score of sentences

Description Usage Arguments Value Examples

View source: R/test.R

Description

This function loads text and calculates score of each sentence on basis of presence of words of positive and negative sentiment, presence of negation, and checking for sarcasm. 0 indicates neutral sentiment. Positive value indicates positive sentiment. Negative value indicates negative sentiment. 99 indicates sarcasm.

Usage

1

Arguments

text

A vector of sentences or a sentence (English).

Value

A vector containing polarity of each sentence.

Examples

1
2
calculate_score("This is good")
calculate_score(c("This is good","This is bad"))

Example output

[1] "Processing sentence: this is good"
1 
1 
[1] "Processing sentence: this is good"
[1] "Processing sentence: this is bad"
[1]  1 -1

RSentiment documentation built on May 2, 2019, 3:45 a.m.