On the database side, create an additional column with a copy of your word, but each character converted to its 'ordinary' version, e.g. convert ó
, ö
, etc. to o
.
It would actually probably have been better as a computed column, but it doesn't look like SQLite supports this though.
Then you could simply do the same conversion on the entered text, and query the added column for the converted text.
Example:
Word NormalizedWord
foobar foobar
foöbar foobar
fóóbar foobar
Query: fóöbar
.
Normalized query: foobar
.
Then simply look for the rows where NormalizedWord
is foobar
(which will be all of the above in this case).
The above approach is to optimize running time - it will allow you to add an index to NormalizedWord
allowing for quick lookup.
To optimize space usage, you could just store the word, and convert on the fly in the lookup, but this would require that you look through all the rows regardless, as doing it this way does not allow for indexing.
By 'convert on the fly', I mean something like:
SELECT *
FROM Table
WHERE Normalize(Word) = NormalizedInputString