Skip to content

Commit

Permalink
bug: example update to use async process.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus Seijas committed Sep 13, 2018
1 parent 4ab2cd7 commit 9306c3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/console-bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const rl = readline.createInterface({
output: process.stdout,
terminal: false,
});
rl.on('line', (line) => {
rl.on('line', async (line) => {
if (line.toLowerCase() === 'quit') {
rl.close();
process.exit();
} else {
const result = nlpManager.process(line);
const result = await nlpManager.process(line);
const answer = result.score > threshold && result.answer ? result.answer : 'Sorry, I don\'t understand';
let sentiment = '';
if (result.sentiment.score !== 0) {
Expand Down

0 comments on commit 9306c3f

Please sign in to comment.