VUFIND-1710 Add support for custom delimiters in topic browse #51
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.
Ostensibly this just required a new TopicNormalizer, but the specific use case added a small complication.
What want is to have our topic headings contain a UTF-8 marker (an en-space) to act as a delimiter between different terms. They'll be stripped out by the new TopicNormalizer for the purposes of searching and sorting, but VuFind will use the delimiter to display a user-selectable delimiter when showing topics.
But, this extra delimiter would cause the lookup against the authority index to fail, since the authority index is always space-delimited. Further, we can't change the authority index to use the same delimiter as topics, because the authority index is a mixture of topics and names.
So, in addition to the new TopicNormalizer, this commit extends the Normalizer interface to add a
headingForAuthQuery
method. By default this is a no-op (so existing code doesn't change), but the TopicNormalizer uses this to replace the UTF-8 delimiter with a regular space to allow the authority index lookup to succeed.