To be more specific, i'm writing a dictionary-like app for android and would like to query words with umlaut characters (ä,ü,ö) in them without having the user type them out. for example the query should return "aufhören" as a result if the user searches for "aufhoren".
My solution
The best solution i could think of was replacing possible umlaut characters with '_' before the query but that would introduce the following problem: if the user were to type something like "schatzen", the query would also contain the similar but irrelevant word "schützen" instead of just "schätzen". i would also like to replace s with ß but since it's not a vowel, it won't produce a false query.
Other solutions i've found
- using replace: i don't really know how heavy the calculations are going to be. there will be 1000+ rows and the query is not limited to the "word" column but also covers the "meaning" and "example" columns (if the user chooses to. it's useful because some words may be used in the example of another word)
- creating a normalized column : same reason as above, creating one wouldn't help and creating 3 will be doubling the table.
collate localized : did not work. according to this question it doesn't work with like '%term%' which kinda makes it useless.
String query = "select * from worterbuch where wort like '%" + constraint.toString() + "%' order by wort collate localized"; db.setLocale(Locale.GERMANY); res = db.rawQuery(query,null);