getAlphaIndex function added to retrieve the alphabetical index

@josenaranjo please review
Please use a proper name for the function