The snippet depends on the character codes being consecutive numbers (as they are for A - Z).
If this is true of the character codes in your alphabet, you might be able to use the properties: &alphabetHeadingStart and alphabetHeadingEnd']. They default to 'A' and 'Z', but they can be any characters.
If not, the snippet would have to be rewritten and you'd have to create an array containing your alphabet (around line 95 of the snippet).
That would look like this (but with your own letters):
$alphabet = array(
'A',
'B',
'C',
// etc.
);