Skip to content

Commit

Permalink
deps: use our modernized, renamed fork of unmaintained vader_sentim…
Browse files Browse the repository at this point in the history
…ent crate
  • Loading branch information
jqnatividad committed Sep 26, 2024
1 parent cd19c84 commit b426761
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ qsv_currency = "0.7"
qsv-sniffer = { version = "0.10", default-features = false, features = [
"runtime-dispatch-simd",
] }
qsv_vader_sentiment_analysis = { version = "0.2", optional = true }
rand = "0.8"
rand_hc = "0.3"
rand_xoshiro = "0.6"
Expand Down Expand Up @@ -232,7 +233,6 @@ titlecase = { version = "3", optional = true }
tokio = { version = "1", features = ["rt-multi-thread"] }
uuid = { version = "1", features = ["v4", "v7"] }
url = "2.5"
vader_sentiment = { version = "0.1", optional = true }
whatlang = { version = "0.16", optional = true }
xlsxwriter = { version = "0.6", optional = true }
xxhash-rust = { version = "0.8", features = ["xxh3"] }
Expand Down Expand Up @@ -339,10 +339,11 @@ apply = [
"eudex",
"gender_guesser",
"hashbrown",
"qsv_vader_sentiment_analysis",
"strsim",
"thousands",
"titlecase",
"vader_sentiment",
# "vader_sentiment",
"whatlang",
]
fetch = [
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ use strsim::{
use strum_macros::EnumString;
use thousands::{policies, Separable, SeparatorPolicy};
use titlecase::titlecase;
use vader_sentiment::SentimentIntensityAnalyzer;
use qsv_vader_sentiment_analysis::SentimentIntensityAnalyzer;
use whatlang::detect;

use crate::{
Expand Down Expand Up @@ -1204,7 +1204,7 @@ fn apply_operations(
Operations::Sentiment => {
// safety: we set SENTIMENT_ANALYZER in validate_operations()
let sentiment_analyzer = SENTIMENT_ANALYZER
.get_or_init(vader_sentiment::SentimentIntensityAnalyzer::new);
.get_or_init(SentimentIntensityAnalyzer::new);
let sentiment_scores = sentiment_analyzer.polarity_scores(cell);
*cell = sentiment_scores.get("compound").unwrap_or(&0.0).to_string();
},
Expand Down

0 comments on commit b426761

Please sign in to comment.