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 check = require('check-types');
var accuracyLevel_point = 'point'; var accuracyLevelPoint = 'point';
var accuracyLevel_interpolated = 'interpolated'; var accuracyLevelInterpolated = 'interpolated';
var accuracyLevel_centroid = 'centroid'; var accuracyLevelCentroid = 'centroid';
function setup() { function setup() {
@ -43,11 +43,11 @@ function computeAccuracyLevelForResult(hit) {
switch (hit.layer) { switch (hit.layer) {
case 'venue': case 'venue':
case 'address': case 'address':
hit.accuracy = accuracyLevel_point; hit.accuracy = accuracyLevelPoint;
break; break;
// this means it's a street or admin area // this means it's a street or admin area
default: default:
hit.accuracy = accuracyLevel_centroid; hit.accuracy = accuracyLevelCentroid;
break; 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.geocoding.query.parsed_text['admin_parts'].should.eql "ny"
json.features[0].properties.confidence.should.eql 1 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