Table of Contents

This page is in the 'old' namespace, and was imported from our previous wiki.
We recommend checking for more up-to-date information using the search box.

How to handle diacritics

Problem statement

In any collection with diacritics in searchable/browsable metadata the problem occurs
that (international) users might not be able to search (or at least are inhibited from searching) for these terms since they don't have
those characters on their keyboards or that the sorting behaviour might appear improper.

In such cases the filter_text() function can be used to map "unwanted" characters onto less problematic ones. This How-to is intended to aid with the necessary modifications.

NOTE: Since version 2.71, MGPP comes with an "accent folding" option. This is described here [Shaoqun Wu]

Preliminaries

The following is tailored to v2.62 but applies to other (only newer?) versions as well. Regarding modifications to classifiers an example for AZCompactList is given.

In order for users still being able to enter diacritics into the search form additional modifications to some macros are required. However, this might not be necessary in any case, depending on what you want to offer to your users. Besides this gets quite complicated if mgpp is used (maybe I'll add that later).

The instructions are organized as follows:

file name [line number/position]:

description

original code snippet

modify to:

modified code snippet

Where the file names are given relative to the installation's perllib directory ($GSDLHOME/perllib).

Instructions

Perl modules

mgbuildproc.pm [49-55] and mgppbuildproc.pm [142-148]:

Comment out in order to have the filter_text() function from basebuildproc.pm applied to both mg and mgpp collections.

sub filter_text {
# $self->filter_text ($field, $new_text);
# don't want to do anything for this version, however,
# in a particular collection you might want to override
# this method to post-process certain fields depending on
# the field, or whether we are outputting it for indexing
}

modify to:

#sub filter_text {
# # $self->filter_text ($field, $new_text);
# # don't want to do anything for this version, however,
# # in a particular collection you might want to override
# # this method to post-process certain fields depending on
# # the field, or whether we are outputting it for indexing
#}