Skip to content

Commit

Permalink
Merge cf74e8a into 7e229ac
Browse files Browse the repository at this point in the history
  • Loading branch information
gcampax committed Dec 17, 2021
2 parents 7e229ac + cf74e8a commit 25817e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
21 changes: 16 additions & 5 deletions lib/dataset-tools/augmentation/replace_parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,25 @@ export default class ParameterReplacer {

let valueListKey = await this._getParamListKey(slot, arg);
const fallbackKey = this._getFallbackParamListKey(slot);
if (valueListKey[0] === 'string' && valueListKey[1] !== fallbackKey &&
coin(this._untypedStringProbability, this._rng))
valueListKey = ['string', fallbackKey];
if (valueListKey[0] === 'string') {
if (valueListKey[1] === fallbackKey) {
const isExplicit = arg ? !!arg.getImplementationAnnotation<string>('string_values') : false;
if (!isExplicit) {
this._warn('default-free-text:' + slot.tag + ':' + slot.type,
`Using default value of ${valueListKey[0]} ${valueListKey[1]} for ${slot.tag}:${slot.type}`);
}
} else {
if (coin(this._untypedStringProbability, this._rng))
valueListKey = ['string', fallbackKey];
}
}

let valueList = await this._loader.get(valueListKey);
if (valueList.size === 0) {
if (this._debug)
this._warn('novalue:' + slot.tag + ':' + slot.type, `Found no values for ${slot.tag}:${slot.type}, falling back to ${fallbackKey}`);
if (this._debug) {
this._warn('novalue:' + slot.tag + ':' + slot.type + ':' + valueListKey[0] + ':' + valueListKey[1],
`Found no values for ${slot.tag}:${slot.type} (searching for ${valueListKey[0]} ${valueListKey[1]}), falling back to ${fallbackKey}`);
}

valueList = await this._loader.get(['string', fallbackKey]);
if (valueList.size === 0)
Expand Down
3 changes: 2 additions & 1 deletion lib/templates/load-thingpedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ export default class ThingpediaLoader {
}

for (const entity of entityTypes) {
entity.has_ner_support = !!(entity.type.startsWith('tt:') && entity.has_ner_support);
entity.has_ner_support = !!((entity.type.startsWith('tt:') || entity.type === 'org.freedesktop:app_id')
&& entity.has_ner_support);
this._loadEntityType(entity.type, entity);
}
for (const device of devices)
Expand Down

0 comments on commit 25817e8

Please sign in to comment.