feat(query-splitting) first try at returning "query" in geocode split in placeholder#192
feat(query-splitting) first try at returning "query" in geocode split in placeholder#192
Conversation
|
this change seems broken. will keep looking. [{phrase: "saunders st rego park", query: "6307", id: 420782897, name: "Rego Park",…}] |
|
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? |

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