phoneme-to-phoneme: support multi-phoneme input

This fixes the logic so that mapped entries with multi-phoneme
sequences are correctly matched.