Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: create fewer intersection variations #133

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions post/intersections.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function intersections( doc ){
// ensure both street & cross street props are set
let street = doc.getAddress(ADDRESS_STREET_PROP);
if( !_.isString(street) || _.isEmpty(street) ){ return; }

let cross_street = doc.getAddress(ADDRESS_CROSS_STREET_PROP);
if( !_.isString(cross_street) || _.isEmpty(cross_street) ){ return; }

Expand All @@ -21,15 +21,15 @@ function intersections( doc ){

// corner of A & B
doc.setNameAlias('default', `${street} & ${cross_street}`);
doc.setNameAlias('default', `${street} @ ${cross_street}`);
//doc.setNameAlias('default', `${street} @ ${cross_street}`);
doc.setNameAlias('default', `${street} at ${cross_street}`);
doc.setNameAlias('default', `Corner of ${street} & ${cross_street}`);
//doc.setNameAlias('default', `Corner of ${street} & ${cross_street}`);

// corner of B & A
doc.setNameAlias('default', `${cross_street} & ${street}`);
doc.setNameAlias('default', `${cross_street} @ ${street}`);
//doc.setNameAlias('default', `${cross_street} @ ${street}`);
doc.setNameAlias('default', `${cross_street} at ${street}`);
doc.setNameAlias('default', `Corner of ${cross_street} & ${street}`);
//doc.setNameAlias('default', `Corner of ${cross_street} & ${street}`);
}

module.exports = intersections;
module.exports = intersections;
6 changes: 1 addition & 5 deletions test/post/intersections.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports.tests = {};
module.exports.tests.functional = function(test) {
test('functional', function(t) {
var doc = new Document('mysource','intersection','myid');

// street and cross_street not set
intersections(doc);
t.deepEqual(doc.getNameAliases('default'), [], 'no names set');
Expand All @@ -28,13 +28,9 @@ module.exports.tests.functional = function(test) {
// intersection aliases defined
t.deepEqual(doc.getNameAliases('default'), [
'Example Street & Cross Street',
'Example Street @ Cross Street',
'Example Street at Cross Street',
'Corner of Example Street & Cross Street',
'Cross Street & Example Street',
'Cross Street @ Example Street',
'Cross Street at Example Street',
'Corner of Cross Street & Example Street'
]);

t.end();
Expand Down