Last active
October 26, 2019 21:18
-
-
Save FelDev/dad7aa81951bb130bb597c03e417cfaa 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
// ai.js | |
module.exports = function unleashAdvancedAI(pathToTextInput) { | |
let fs = require("fs") | |
return new Promise(function(resolve, reject) { | |
try { | |
let content = fs.readFileSync(pathToTextInput, 'utf8') | |
// Intensive Artificial Intelligence Processing | |
if (content.indexOf('🙂') > -1) { | |
resolve('This human is happy') | |
} | |
else if (content.indexOf('🙁') > -1) { | |
resolve('This human is sad') | |
} | |
else { | |
resolve('Look, AI is not magic.') | |
} | |
} catch (error) { | |
console.log('@error: ', error); | |
reject(error) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment