Stephen Hess
a090a1e71a
updated comment
8 years ago
Stephen Hess
1b83247964
exclude `name` for `country` result labels
8 years ago
Stephen Hess
9cdfce13c1
fixed extraneous comma labels for results with only a `name`
9 years ago
Stephen Hess
8d0b0e8780
switched to `_.compact` to remove `undefined` values
9 years ago
Stephen Hess
0870e30366
Refactored the label generation code to be simpler
...
Labels are now, outside US/CA/UK, just name+city+country.
Deduping now only occurs on the first 2 parts of the labels which fixes the "Luxembourg, Luxembourg" issue.
9 years ago
Stephen Hess
5b934b27c3
removed debug
9 years ago
Stephen Hess
fd0718a699
updated labelGeneration special case so that region-specific logic only applies to US/CA
9 years ago
Diana Shkolnikov
af8044ef29
Fix all unit tests
9 years ago
Diana Shkolnikov
b8ab7c00f7
Cleanup the label generation code just a bit
9 years ago
Stephen Hess
0f6059c05a
Refactored to use a function for looking up value for a label
...
The reason for this switch is that special case logic is needed to determine the US state name to display. All other fields can be looked up by name.
The burden of fallback functionality is now in `helper/labelSchema` so the burden of unit testing is now in `test/unit/helper/labelSchema.js`
9 years ago
Stephen Hess
431fe44f05
converted labelSchema to .js with module.exports
...
this is in preparation to introduce functions into the schema instead of strings
9 years ago
Stephen Hess
7b5b9dee61
added comments illustrating the subtleties of label generation
9 years ago
Stephen Hess
5456632cdf
Added flag to not include `default.name` in label
...
when source=`geonames` or `whosonfirst` and layer=`region`
This will stop, say, a search for "New Mexico" resulting in the label "New Mexico, NM, USA"
9 years ago
Stephen Hess
3e8d1bfd9b
broke country-specific label tests out to own file for easier testing
9 years ago
Stephen Hess
515d4aeb94
extracted `getSchema` helper method
9 years ago
Julian Simioni
769f190eab
Replace depricated Lodash function unique with uniq
...
See https://github.com/lodash/lodash/wiki/Changelog#jan-12-2016--diff--docs
9 years ago
Julian Simioni
cb7b38bc75
Replace check-types depricated unemptyString with nonEmptyString
...
See https://www.npmjs.com/package/check-types#what-changed-from-4x-to-5x
9 years ago
Julian Simioni
f4a5dd812b
Replace depricated Lodash function contains with includes
...
See https://github.com/lodash/lodash/wiki/Changelog#jan-12-2016--diff--docs
9 years ago
Peter Johnson
3a54a8b32f
fix label issues
9 years ago
Peter Johnson
2b9c3d79aa
rename outputGenerator -> labelGenerator
9 years ago
Diana Shkolnikov
1b4b401a66
More property renaming/mapping
...
* Rename `layer` to `type` and `source`
* Rename `address` block and merge properties to main `geocoding` namespace
9 years ago
Harish Krishna
69a13e9105
fixing all the js lint related issues (lintified)
10 years ago
Peter Johnson
27e2c4e5b8
migrate outputGenerator from pelias/suggester-pipeline
10 years ago