Socket
Socket
Sign inDemoInstall

prospectimo

Package Overview
Dependencies
3
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prospectimo

Analyse the temporal orientation of a string.


Version published
Maintainers
1
Created

Readme

Source

prospectimo

Get the temporal orientation of a string.

Usage

const prospectimo = require('prospectimo');
const opts = {
  'return': 'lex',         // 'orientation' returns a string, 'lex' (default) returns object of lexical values
  'encoding': 'binary',    // 'binary' (default), or 'frequency' - type of word encoding to use.
  'threshold': -0.98       // a lexical weight threshold between 1.16 (include nothing), and -0.98 (include everything, default)
}
const str = "A big long string of text...";
const orientation = prospectimo(str, opts);
console.log(orientation);

Options

'return'

Valid options: 'lex' (default), or 'orientation'.

'lex' returns an object with 'PAST', 'PRESENT' and 'FUTURE' keys, each containing a lexical value for that orientation.

'orientation' returns a string stating either 'Past', 'Present', 'Future', or 'Unknown'.

'encoding'

Valid options: 'binary' (default), or 'frequency'.

'binary' calculates the lexical value as simply a sum of weights, i.e. weight[1] + weight[2] + etc...

'frequency' calculates the lexical value as (word frequency / total wordcount) * word weight

Unless you have a specific need for frequency encoding, we recommend you use binary only.

'threshold'

The lexicon contains weight values that are very small. You can exclude them using the threshold option.

The smallest value in the lexicon is -0.9772179. Therefore a threshold of -0.98 will include all words in the lexicon.

The largest value in the lexicon is 1.15807005. Therefore a threshold of 1.16 will include no words in the lexicon.

Acknowledgements

References

Park, G., Schwartz, H.A., Sap, M., Kern, M.L., Weingarten, E., Eichstaedt, J.C., Berger, J., Stillwell, D.J., Kosinski, M., Ungar, L.H. & Seligman, M.E. (2015). Living in the Past, Present, and Future: Measuring Temporal Orientation with Language. Journal of personality.

Lexicon

Using the prospection lexicon data from WWBP

Used under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Licence

(C) 2017 P. Hughes

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Keywords

FAQs

Last updated on 14 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc