Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "datasets/afinn-96/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

WordRating

WordRating: [string, number]

Two-element array holding a word and its associated valence rating.

Functions

Export assignment afinn96

  • Returns a list of English words rated for valence. An earlier version of AFINN-111.

    Notes

    • This function synchronously reads data from disk for each invocation. Such behavior is intentional and so is the avoidance of require. We assume that invocations are infrequent, and we want to avoid the require cache. This means that we allow data to be garbage collected and a user is responsible for explicitly caching data.
    throws

    unable to read data

    Returns Array < WordRating >

    word ratings

    Example

    var list = afinn96();
    // returns [ ['abandon',-2], ['abandons',-2], ['abandoned',-2], ... ]