I have a list of words for a fictional world I've made (don't judge lol).

My ultimate goal is to generate more words that sound like them through a markov generator, but for now, I'm trying to build a model that will classify words into their region by similarity to the other words in that region.

My first attempt used Levenshtein distance, and this performed... well, not very good.

I then tried using the Jaro-Winkler distance plus the Jaro-Winkler distance for the inverted string divided by two, to get the average distance (to refresh, Winkler considers the beginning of the word to be more important, so I did this to get the end as important too). This was better, with 80% train/25% test accuracy, but obviously not good enough at all.

As you can see, for the multiclass models I'm trying to use, these are poor predictors of the regional class I've assigned to each word. I have only found this:


As any sort of mechanism that takes sound into account, but it seems like words have to be similar length, and mine aren't necessarily within one or two character lengths of each other.

I mean, might be able to apply it, but I wanted to see if there was a better solution. My research hasn't turned up anything useful.


1 Answer 1


I haven't tried it myself, but you could try the IPA (International Phonetic Alphabet) version of your words and then calculate the Levenshtein distance.

There is a Python library called panphon. I have no affiliate with it. Just found it with Google Search.

import panphon.distance
dst = panphon.distance.Distance()
dst.dogol_prime_distance(u'pops', u'bobz')
>> 0
dst.dogol_prime_distance(u'father', u'mother')
>> 1
dst.dogol_prime_distance(u'school', u'fool')
>> 3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.