aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/spellfix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-12-17 14:18:21 +0000
committerdrh <drh@noemail.net>2015-12-17 14:18:21 +0000
commit1db0a72be23771498ebd1a18c897056a98bd8fc8 (patch)
treef8e067651acd59f99d5464bbe225255f9cfc4ced /ext/misc/spellfix.c
parent5732671db95c21b5c0edcd4053ee44d3ea053882 (diff)
downloadsqlite-1db0a72be23771498ebd1a18c897056a98bd8fc8.tar.gz
sqlite-1db0a72be23771498ebd1a18c897056a98bd8fc8.zip
Fix the spellfix1_scriptcode() function to ignore whitespace and punctuation,
and to recognize hebrew and arabic scripts. FossilOrigin-Name: 7adfa4a5794e47f97491c08abeaaac90e826b331
Diffstat (limited to 'ext/misc/spellfix.c')
-rw-r--r--ext/misc/spellfix.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c
index 0515b7bc6..c0da6b339 100644
--- a/ext/misc/spellfix.c
+++ b/ext/misc/spellfix.c
@@ -1717,17 +1717,23 @@ static void scriptCodeSqlFunc(
# define SCRIPT_LATIN 0x0001
# define SCRIPT_CYRILLIC 0x0002
# define SCRIPT_GREEK 0x0004
+# define SCRIPT_HEBREW 0x0008
+# define SCRIPT_ARABIC 0x0010
while( nIn>0 ){
c = utf8Read(zIn, nIn, &sz);
zIn += sz;
nIn -= sz;
- if( c<0x02af ){
+ if( c<0x02af && (c>=0x80 || midClass[c&0x7f]<CCLASS_DIGIT) ){
scriptMask |= SCRIPT_LATIN;
}else if( c>=0x0400 && c<=0x04ff ){
scriptMask |= SCRIPT_CYRILLIC;
}else if( c>=0x0386 && c<=0x03ce ){
scriptMask |= SCRIPT_GREEK;
+ }else if( c>=0x0590 && c<=0x05ff ){
+ scriptMask |= SCRIPT_HEBREW;
+ }else if( c>=0x0600 && c<=0x06ff ){
+ scriptMask |= SCRIPT_ARABIC;
}
}
switch( scriptMask ){
@@ -1735,6 +1741,8 @@ static void scriptCodeSqlFunc(
case SCRIPT_LATIN: res = 215; break;
case SCRIPT_CYRILLIC: res = 220; break;
case SCRIPT_GREEK: res = 200; break;
+ case SCRIPT_HEBREW: res = 125; break;
+ case SCRIPT_ARABIC: res = 160; break;
default: res = 998; break;
}
sqlite3_result_int(context, res);