draft: parser interpretation improvements#1487
Draft
missinglink wants to merge 5 commits intomasterfrom
Draft
Conversation
missinglink
commented
Sep 1, 2020
missinglink
commented
Sep 1, 2020
| cases.push(['Kaschk Be', { subject: 'Kaschk Be' }, true]); | ||
| cases.push(['Kaschk Ber', { subject: 'Kaschk Ber' }, true]); | ||
| cases.push(['Kaschk Berl', { subject: 'Kaschk Berl' }, true]); | ||
| cases.push(['Kaschk Berli', { subject: 'Kaschk Berli' }, true]); |
Member
Author
missinglink
commented
Sep 1, 2020
| // this constant defines a lower boundary for the solution score returned | ||
| // by the Pelias parser. Any solutions which scored lower than this value | ||
| // will simply have their entire body returned as the $subject | ||
| const MIN_ACCEPTABLE_SCORE = 0.3; |
Member
Author
There was a problem hiding this comment.
Users would probably appreciate this being tuneable via a config option.
Member
Author
|
Paired with pelias/parser#120 these tests all pass 🎉 |
09973da to
67c9c81
Compare
missinglink
commented
Sep 1, 2020
| .join(''); | ||
|
|
||
| // same as $body above but with consecutive whitespace squashed and trimmed. | ||
| const normalizedBody = t.section.map(sp => sp.body).join(' ').replace(/\s+/g, ' ').trim(); |
Member
Author
There was a problem hiding this comment.
This is not quite the same as above since it includes postalcode classifications.
Need to give this some more consideration before merging 🤔
Member
Author
|
added an additional commit ac26263 to improve parsing of addresses where the unit number was previously being included in the $admin section of the parse: |
ac26263 to
639b3a9
Compare
Member
Author
|
rebased |
Member
Author
|
linking pelias/pelias#894 as it may be covered by this work |
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.


draft: parser interpretation improvements
this will be paired with changes to
pelias/parserwhich will need to be merged first.