placeholder
placeholder copied to clipboard
issue 36: first pass at returning unparsed prefix
[do not merge]
this PR adds support for returning the unparsed prefix from user input as described in https://github.com/pelias/placeholder/issues/36
closes https://github.com/pelias/placeholder/issues/36
note: this PR is fairly old now, two other PRs have landed since which add additional capability related to returning masks of which tokens were used for matching.
I'm leaving this open for now to remind me of how we planned to address this feature.
also requires a rebase and fix once https://github.com/pelias/placeholder/pull/80 is merged.
This would still be useful, right? If so, and you think it's likely we'll actually do it, let me know. Otherwise, please close :)
I'd have to look at it again now the other PRs are merged.
It's a great feature to add, we wanted to get more information from placeholder about the parses it makes, so I first added an internal 'mask' feature which tracks which tokens are matched and which are not.
The current status of that is that it's an internal API which may need to be exposed via the REST API.
This PR extends on that, allowing placeholder to return (verbatim) all the tokens to the left of the most granular match.
It's functionality which Stephen requested, it essentially lays the groundwork for getting off addressit
if we can start using placeholder as the default parser for autocomplete queries.
But yea, need to go over the code again and discuss what corresponding changes need to be made in pelias/api
and what benefits we would get out of it by merging it.