Skip to content

Commit

Permalink
Avoid file name adding dot at end of name
Browse files Browse the repository at this point in the history
  • Loading branch information
PabiGamito committed Nov 18, 2018
1 parent 497ae97 commit c674fac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions process.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,7 @@ function reduceSuggestions(suggestions) {

async function processCommand(text) {

text = text + '.';

const tokensPromise = tokenalyzeSyntax(text);
const predictedPromise = predict(text);

let text_tokens = text.split(/,? /);
let text_tokens = text.split(/(,|\.)?( |$)/);

let file_mapping = {};
let new_text = [];
Expand All @@ -388,7 +383,10 @@ async function processCommand(text) {
}
}

text = new_text.join(" ");
text = new_text.join(" ") + ".";

const tokensPromise = tokenalyzeSyntax(text);
const predictedPromise = predict(text);

const tokens = await tokensPromise;
verbNounPairs = getVerbNounPairs(tokens);
Expand Down

0 comments on commit c674fac

Please sign in to comment.