Skip to content

Commit

Permalink
Merge branch 'master' into feature/functional-test-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
gasper-az committed May 27, 2019
2 parents 5199dfe + 1a0c294 commit c165471
Show file tree
Hide file tree
Showing 27 changed files with 2,523 additions and 840 deletions.
2 changes: 1 addition & 1 deletion libraries/botbuilder-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"codelyzer": "^4.1.0",
"fs-extra": "^7.0.1",
"mocha": "^5.2.0",
"nock": "^10.0.1",
"nock": "^10.0.3",
"nyc": "^11.4.1",
"source-map-support": "^0.5.3",
"ts-node": "^4.1.0"
Expand Down
27 changes: 16 additions & 11 deletions libraries/botbuilder-ai/src/luisRecognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,12 @@ export class LuisRecognizer implements LuisRecognizerTelemetryClient {
return;
}

this.addProperty(entitiesAndMetadata, this.getNormalizedEntityName(entity), this.getEntityValue(entity));
if (verbose) {
this.addProperty(entitiesAndMetadata.$instance, this.getNormalizedEntityName(entity), this.getEntityMetadata(entity));
let val = this.getEntityValue(entity);
if (val != null) {
this.addProperty(entitiesAndMetadata, this.getNormalizedEntityName(entity), val);
if (verbose) {
this.addProperty(entitiesAndMetadata.$instance, this.getNormalizedEntityName(entity), this.getEntityMetadata(entity));
}
}
});

Expand Down Expand Up @@ -572,11 +575,10 @@ export class LuisRecognizer implements LuisRecognizerTelemetryClient {
return obj;
}
default:
return Object.keys(entity.resolution).length > 1 ?
entity.resolution :
entity.resolution.value ?
entity.resolution.value :
entity.resolution.values;
// This will return null if there is no value/values which can happen when a new prebuilt is introduced
return entity.resolution.value ?
entity.resolution.value :
entity.resolution.values;
}
}
}
Expand Down Expand Up @@ -654,10 +656,13 @@ export class LuisRecognizer implements LuisRecognizerTelemetryClient {

// Add to the set to ensure that we don't consider the same child entity more than once per composite
coveredSet.add(i);
this.addProperty(childrenEntites, this.getNormalizedEntityName(entity), this.getEntityValue(entity));

if (verbose) {
this.addProperty(childrenEntites.$instance, this.getNormalizedEntityName(entity), this.getEntityMetadata(entity));
let val = this.getEntityValue(entity);
if (val != null) {
this.addProperty(childrenEntites, this.getNormalizedEntityName(entity), val);
if (verbose) {
this.addProperty(childrenEntites.$instance, this.getNormalizedEntityName(entity), this.getEntityMetadata(entity));
}
}
}
}
Expand Down

0 comments on commit c165471

Please sign in to comment.