Skip to content

feat(query-splitting) first try at returning "query" in geocode split in placeholder#192

Closed
blackmad wants to merge 3 commits intomasterfrom
return-query
Closed

feat(query-splitting) first try at returning "query" in geocode split in placeholder#192
blackmad wants to merge 3 commits intomasterfrom
return-query

Conversation

@blackmad
Copy link

@blackmad blackmad commented Aug 4, 2020

This change is in preparation for experimenting with placeholder doing more of the admin splitting work that parser & libpostal currently do. It adds a "query" to the placeholder responses which is the left most tokens in the query that are not matched by placeholder.

It adds a /tokenize2 endpoint (which I think is for debugging only?) to expose this
it adds "query" to the results from /search

internally, it primarily adds a remainder: {before: string, after: string} to the "group" object in the code.

It is a tiny bit based off of this stale PR: #37

demo frontend updated

image

@blackmad blackmad requested a review from missinglink August 4, 2020 19:09
@blackmad
Copy link
Author

blackmad commented Aug 4, 2020

this change seems broken. will keep looking.

[{phrase: "saunders st rego park", query: "6307", id: 420782897, name: "Rego Park",…}]
0: {phrase: "saunders st rego park", query: "6307", id: 420782897, name: "Rego Park",…}
geom: {area: 0.000259, bbox: "-73.871429,40.711338,-73.85173,40.73627346", lat: 40.727122, lon: -73.862152}
id: 420782897
languageDefaulted: false
lineage: [{borough: {id: 421205767, name: "Queens", languageDefaulted: false},…}]
name: "Rego Park"
phrase: "saunders st rego park"
placetype: "neighbourhood"
query: "6307"

@blackmad
Copy link
Author

blackmad commented Aug 5, 2020

this seems happier now

image

@blackmad blackmad closed this Nov 5, 2020
@blackmad blackmad reopened this Nov 5, 2020
@blackmad
Copy link
Author

blackmad commented Nov 5, 2020

Actually, looking back at this work, it's still an interesting base to play with. tokenize2 could probably be called tokenizeStructured or something else smarter. @missinglink equally happy to abandon this or keep working on it, what do you think?

@blackmad blackmad closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant