Browse Source

cleanup variable name and add ciao test

pull/670/head
Diana Shkolnikov 8 years ago
parent
commit
30e42e2b80
  1. 10
      middleware/accuracy.js
  2. 3
      test/ciao/search/address_parsing.coffee

10
middleware/accuracy.js

@ -9,9 +9,9 @@
var check = require('check-types');
var accuracyLevel_point = 'point';
var accuracyLevel_interpolated = 'interpolated';
var accuracyLevel_centroid = 'centroid';
var accuracyLevelPoint = 'point';
var accuracyLevelInterpolated = 'interpolated';
var accuracyLevelCentroid = 'centroid';
function setup() {
@ -43,11 +43,11 @@ function computeAccuracyLevelForResult(hit) {
switch (hit.layer) {
case 'venue':
case 'address':
hit.accuracy = accuracyLevel_point;
hit.accuracy = accuracyLevelPoint;
break;
// this means it's a street or admin area
default:
hit.accuracy = accuracyLevel_centroid;
hit.accuracy = accuracyLevelCentroid;
break;
}

3
test/ciao/search/address_parsing.coffee

@ -41,4 +41,5 @@ json.geocoding.query.parsed_text['regions'].should.eql []
json.geocoding.query.parsed_text['admin_parts'].should.eql "ny"
json.features[0].properties.confidence.should.eql 1
json.features[0].properties.match_type.should.eql "exact"
json.features[0].properties.match_type.should.eql "exact"
json.features[0].properties.accuracy.should.eql "point"
Loading…
Cancel
Save