Repository navigation
Add Mt/St/Ft normalizing - #767
Merged
Merged
Conversation
more accurate since it's smarter about where to replace periods
orangejulius
approved these changes
Dec 13, 2016
| quattroshapes_deprecation: require('../sanitizer/_deprecate_quattroshapes'), | ||
| text: require('../sanitizer/_text'), | ||
| iso2_to_iso3: require('../sanitizer/_iso2_to_iso3'), | ||
| mount_saint_fort_standardizer: require('../sanitizer/_mount_saint_fort_standardizer'), |
Member
There was a problem hiding this comment.
might we want to expand this in the future so that it's less specific and more of an "abbreviation_standardizer"? It feels a bit too specific of a name
| const transliterated = periods_removed.replace(mountSaintFort, transliterate); | ||
|
|
||
| // 3. whitespace-normalize by replacing much whitespace with a space and trimming | ||
| // duplicate whitespace can be introduced when removing periods |
Member
There was a problem hiding this comment.
I think there's a missing word in here. should it be "and trimming duplicate whitespace that can be introduced when removing periods" (or something similar)
| const messages = { errors: [], warnings: [] }; | ||
|
|
||
| // only try to transliterate if there is a city in parsed_text | ||
| if (!_.isEmpty(_.get(clean, 'parsed_text.city'))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WOF names are spelled out as Mount and Fort whereas Saint and Sainte are abbreviated to St and Ste, respectively. This PR adds a sanitizer that transliterates:
This will ensure that, for example, searching for
Saint Louis, MOandSt. Louisreturn the same results.Fixes pelias/schema#157