Guest User

Untitled

a guest
Nov 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import * as sentiment from 'sentiment'
  2.  
  3. export class Analyzer {
  4. static analyze(phrase) {
  5. // Make sure nativeLog is defined and is a function
  6. if (typeof nativeLog === 'function') {
  7. nativeLog(`Analyzing '${phrase}'`)
  8. }
  9.  
  10. let result = sentiment(phrase)
  11. return result['score']
  12. }
  13. };
Add Comment
Please, Sign In to add comment