diff --git a/NEWS b/NEWS index d0ebcf5..0536e43 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,12 @@ MINOR FEATURES IMPROVEMENTS +* `hash_sentiment_jockers_rinker` now contains the word 'fuckin'. Additionally, + the word 'fucking' has a milder negative value because this word, though often + used as a negator, is also used as a amplifier. By reducing it's weight it + allows more positive words to have more pull but if no polarized words exist + 'fucking' will still keep the typical negative direction of the clause. + CHANGES diff --git a/NEWS.md b/NEWS.md index 8f83ba7..d51d4ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -55,5 +55,11 @@ lexicon 1.0.1 - **IMPROVEMENTS** +* `hash_sentiment_jockers_rinker` now contains the word 'fuckin'. Additionally, + the word 'fucking' has a milder negative value because this word, though often + used as a negator, is also used as a amplifier. By reducing it's weight it + allows more positive words to have more pull but if no polarized words exist + 'fucking' will still keep the typical negative direction of the clause. + **CHANGES** diff --git a/R/hash_sentiment_jockers_rinker.R b/R/hash_sentiment_jockers_rinker.R index 4b45034..10755fc 100644 --- a/R/hash_sentiment_jockers_rinker.R +++ b/R/hash_sentiment_jockers_rinker.R @@ -14,7 +14,7 @@ #' @keywords datasets #' @name hash_sentiment_jockers_rinker #' @usage data(hash_sentiment_jockers_rinker) -#' @format A data frame with 11,709 rows and 2 variables +#' @format A data frame with 11,710 rows and 2 variables #' @references Jockers, M. L. (2017). Syuzhet: Extract sentiment and plot arcs #' from Text. Retrieved from https://github.com/mjockers/syuzhet \cr \cr #' diff --git a/R/lexicon-package.R b/R/lexicon-package.R index 0695127..7506f01 100644 --- a/R/lexicon-package.R +++ b/R/lexicon-package.R @@ -7,3 +7,4 @@ NULL + diff --git a/data/hash_sentiment_jockers_rinker.rda b/data/hash_sentiment_jockers_rinker.rda index f85c721..75313df 100644 Binary files a/data/hash_sentiment_jockers_rinker.rda and b/data/hash_sentiment_jockers_rinker.rda differ diff --git a/inst/scraping_scripts/sentiment Lexicon Scripts/jockers_rinker.R b/inst/scraping_scripts/sentiment Lexicon Scripts/jockers_rinker.R index 8f2523d..b27d1af 100644 --- a/inst/scraping_scripts/sentiment Lexicon Scripts/jockers_rinker.R +++ b/inst/scraping_scripts/sentiment Lexicon Scripts/jockers_rinker.R @@ -5,12 +5,31 @@ hash_sentiment_jockers_rinker <- dplyr::bind_rows( hash_sentiment_jockers, dplyr::data_frame( x = c("the shit", "the bomb", "bad ass", "yeah right", - "cut the mustard", "kiss of death"), - y = c(1, 1, 1, -1, 1, -1) + "cut the mustard", "kiss of death", "back handed", "blow smoke", + "blowing smoke", "break a leg", "effing", "in the black", + "in the red", "under the weather"), + y = c(1, 1, 1, -1, 1, -1, -0.5, -0.5, -0.5, 0.5, -0.1, 0.5, -0.5, -0.5) ) ) %>% -sentimentr::as_key() + sentimentr::as_key() %>% + sentimentr::update_key(drop = 'fucking') %>% + sentimentr::update_key(x = dplyr::data_frame( + ## this was done b/c f bomb is more of a valence shifter usually....but + ## can be a negator. By making it a small negator it will still pull a + ## sentence down but if it is paired with 'awesome' the awesome will + ## outweigh it and the polarity direction will be maintained. The -in + ## version is almost always negative (we're more confident) + ## see: https://github.com/trinker/lexicon/issues/20 + + x = c('fucking', 'fuckin'), + y = c(-.15, -.5) + )) pax::new_data(hash_sentiment_jockers_rinker) +# anti_join( +# lexicon::hash_sentiment_jockers_rinker, +# hash_sentiment_jockers_rinker, by = 'x' +# ) %>% +# dput() diff --git a/man/hash_sentiment_jockers_rinker.Rd b/man/hash_sentiment_jockers_rinker.Rd index f912a29..1b6ba87 100644 --- a/man/hash_sentiment_jockers_rinker.Rd +++ b/man/hash_sentiment_jockers_rinker.Rd @@ -4,7 +4,7 @@ \name{hash_sentiment_jockers_rinker} \alias{hash_sentiment_jockers_rinker} \title{Combined Jockers & Rinker Polarity Lookup Table} -\format{A data frame with 11,709 rows and 2 variables} +\format{A data frame with 11,710 rows and 2 variables} \usage{ data(hash_sentiment_jockers_rinker) }