Created
March 13, 2018 21:13
-
-
Save DavidMellul/3b3fbdd5af704b223208719fc387e442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hypothetical NLP function - ES6 includes used | |
function isTextFunEnough(text) { | |
if(text.length == 0) { | |
return false; | |
} | |
else if(text.includes('lol')) { | |
if(text.includes('angry')) | |
return false; | |
else | |
return true; | |
} | |
} | |
console.log(isTextFunEnough('This article is so epic lol') ? 'Definitely fun, LMAO':'Not very funny...'); | |
// => Definitely fun, LMAO | |
console.log(isTextFunEnough('Lol, how angry do you think I am') ? 'Definitely fun, LMAO':'Not very funny...'); | |
// => Not very funny... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment