in src/geocoder/geocoder.ts [348:368]
private locationQuality(location: BingLocation): number {
let quality: number = 0;
// two letter ISO country query is most important
if (this.category === CategoryTypes.CountryRegion) {
let iso2: string = location.address && location.address.countryRegionIso2;
if (iso2) {
let queryString: string = this.query.toLowerCase();
if (queryString.length === 2 && queryString === iso2.toLowerCase()) {
quality += 2;
}
}
}
// matching the entity type is also important
if (location.entityType && location.entityType.toLowerCase() === this.getBingEntity().toLowerCase()) {
quality += 1;
}
return quality;
}