The rationale is inspired by the algorithm behind sentimentr (Rinker, 2018b) but extends that approach to data that are nonpunctuated or very brief.
our algorithm identifies each sentiment as matched with the 'Jockers & Rinker Polarity Lookup Table' from the lexicon R package (Rinker, 2018a) and then constructs a "naïve context" cluster (i.e., without relying on punctuation or other structure) around that sentiment (here: two words before and after the sentiment).