Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseAll(input, culture) {
return [
// Number recognizer - This function will find any number from the input
// E.g "I have two apples" will return "2".
...Recognizers.recognizeNumber(input, culture),
// Ordinal number recognizer - This function will find any ordinal number
// E.g "eleventh" will return "11".
...Recognizers.recognizeOrdinal(input, culture),
// Percentage recognizer - This function will find any number presented as percentage
// E.g "one hundred percents" will return "100%"
...Recognizers.recognizePercentage(input, culture),
// Age recognizer - This function will find any age number presented
// E.g "After ninety five years of age, perspectives change" will return "95 Year"
...Recognizers.recognizeAge(input, culture),
// Currency recognizer - This function will find any currency presented
// E.g "Interest expense in the 1988 third quarter was $ 75.3 million" will return "75300000 Dollar"
...Recognizers.recognizeCurrency(input, culture),
this.builtins.forEach(name => {
try {
const entities = Recognizers[`recognize${name}`](utterance, culture);
if (name === 'Number') {
entities.push(
...Recognizers.recognizeNumber(utterance, NlpUtil.getCulture('en'))
);
}
for (let i = 0; i < entities.length; i += 1) {
const entity = entities[i];
let entityName = entity.typeName;
const index = entityName.lastIndexOf('.');
if (index !== -1) {
entityName = entityName.slice(index + 1);
}
if (this.builtinWhitelist[entityName]) {
const text = utterance.slice(entity.start, entity.end + 1);
const accuracy = 0.95;
const edge = {
start: entity.start,
end: entity.end,
len: entity.end - entity.start + 1,
this.settings.builtins.forEach(name => {
try {
const entities = Recognizers[`recognize${name}`](utterance, culture);
if (name === 'Number' && locale !== 'en') {
entities.push(
...Recognizers.recognizeNumber(utterance, getCulture('en'))
);
}
for (let i = 0; i < entities.length; i += 1) {
const entity = entities[i];
source.push(entity);
let entityName = entity.typeName;
const index = entityName.lastIndexOf('.');
if (index !== -1) {
entityName = entityName.slice(index + 1);
}
if (this.settings.builtinWhitelist[entityName]) {
const text = utterance.slice(entity.start, entity.end + 1);
const accuracy = 0.95;
const edge = {
start: entity.start,
end: entity.end,
this.builtins.forEach(name => {
try {
const entities = Recognizers[`recognize${name}`](utterance, culture);
if (name === 'Number') {
entities.push(
...Recognizers.recognizeNumber(utterance, NlpUtil.getCulture('en'))
);
}
for (let i = 0; i < entities.length; i += 1) {
const entity = entities[i];
source.push(entity);
let entityName = entity.typeName;
const index = entityName.lastIndexOf('.');
if (index !== -1) {
entityName = entityName.slice(index + 1);
}
if (this.builtinWhitelist[entityName]) {
const text = utterance.slice(entity.start, entity.end + 1);
const accuracy = 0.95;
const edge = {
start: entity.start,
end: entity.end,