SQLite Forum

Comparison of Hebrew Language Text

Comparison of Hebrew Language Text

(1) By jarcher7 on 2020-04-23 20:17:32 [link] [source]

I have an iOS Objective C app using fmdb.

Using this query successfully until I have run into Hebrew language. Apparently, in Hebrew the vowels characters are optional and some of the strings in the database have vowels and some do not. So, I need to make the comparison ignoring the vowels.

@"SELECT * FROM buttons WHERE LOWER ( TRIM (message) ) = LOWER ( TRIM ("%@") )" (don't worry the user was not able to enter the string that goes into the %@)

I have considered creating a separate column of words with vowels stripped to use for Hebrew but then there will be many special cases in the code to deal with this.

Possibly, I don't understand the collation sequence but I don't this helps here as vowels are to be ignored not reordered.

TIA for your suggestions.

(2) By Richard Damon (RichardDamon) on 2020-04-23 21:09:40 in reply to 1 [source]

My one thought is that IF you define a custom character set definition (which might be part of what is called a 'collation sequence' that made converting a Hebrew character to lower case remove the vowel points (Hebrew doesn't HAVE the concept of Case as far as I know). This might be able to work as the vowel points should be defined as combining characters so they all get bundled up into a single grapheme, which I think is what collation sequences work on.

It's possible that this is a common enough request, that there may be a collation sequence already available somewhere that does this.

(3) By jarcher7 on 2020-04-23 22:42:36 in reply to 2 [link] [source]

Thanks for the thought.

And Yes, I was kinda hoping this was going to be common enough that maybe someone already has an elegant solution.