Phonetic encoding of words