android - How to query all Korean words start with an initial character -
it easy query words start initial character in english, example query words start "a", execute query:
select * table word 'a%';
we can results "an", "at", "after"....
but not same in korean, because korean word considered single unicode character, query:
select * table word 'ㄱ%';
will not return words "가", "고", "간"... (the results may "ㄱ자", "ㄱ견"...)
so should result expect? (i.e. words "가", "고", "간"... when want query word start "ㄱ")
thank much!
your problem here 1 of unicode format , korean's unique behavior of combining consonants , vowels create new character. can either store these new characters individual glyphs, or combined glyphs. if want search this, need store them individual glyphs. means taking every incoming string stored in db , processing them before inserting them, breaking compound glyphs components. , if have existing db, you'd have existing data well.
the other route make list of every possible combination of glyphs character complex expression in unicode, , search of them massive set of ors.
either way pain in neck. asian languages can real problem programmers, seem have little things make them difficult process.
Comments
Post a Comment