Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VUFIND-1710 Add support for custom delimiters in topic browse #51

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

marktriggs
Copy link
Collaborator

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.

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.
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @marktriggs!

@demiankatz demiankatz merged commit 25863e5 into vufind-org:dev Oct 15, 2024
1 check passed
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.

2 participants