Skip to content

Commit

Permalink
fix(nlu): entities extraction fix (whole entities)
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed Mar 18, 2019
1 parent 2e1c64f commit 3259547
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -51,7 +51,10 @@ export default class PatternExtractor {
let partOfPhrase = tok
const occ = val.join('+')
if (val.length > 1) {
partOfPhrase = (await tokenize(input.substr(cur, occ.length), lang)).join('+')
const _tokens = await tokenize(input.substr(cur + partOfPhrase.length), lang)
while (_tokens.length && partOfPhrase.length < occ.length) {
partOfPhrase += '+' + _tokens.shift()
}
}

let distance = 0.0
Expand Down

0 comments on commit 3259547

Please sign in to comment.