ghostmansd
ghostmansd

Reputation: 3465

Interchangeable letters

As you may know, in Latin alphabet there was no difference between u/v and i/j. That's a very late tradition to separate this letters, and many Latin texts don't have such a separation. Following this tradition, I decided to make available for users of my little dictionary to find words disregarding u/v and i/j letters. For example, by entering 'adjuvo', 'adiuvo', 'adjuuo', etc. user will get the same result. What's the best way to reach this? For example, I've a list of words. How can I get all words making Python not to differ u/v and i/j? Thanks a lot!

Upvotes: 0

Views: 190

Answers (1)

Marcelo Cantos
Marcelo Cantos

Reputation: 185988

Canonicalise the strings before matching. replace all v's with u's and all j's with i's. In the dictionary, store a mapping from each canonical form to all the matching non-canonical forms.

Upvotes: 6

Related Questions