From: drh Date: Fri, 11 Mar 2016 14:30:18 +0000 (+0000) Subject: Update spellfix1_scriptcode() to output 215 (latin) for pure numeric text. X-Git-Tag: version-3.12.0~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=811f17bac031aec31626304edb95313ba3a0217b;p=thirdparty%2Fsqlite.git Update spellfix1_scriptcode() to output 215 (latin) for pure numeric text. FossilOrigin-Name: df44308b862e932ff0ad25b6328d13be22047b96 --- diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c index 5734d04f41..b5859ea2c8 100644 --- a/ext/misc/spellfix.c +++ b/ext/misc/spellfix.c @@ -1734,6 +1734,7 @@ static void scriptCodeSqlFunc( int c, sz; int scriptMask = 0; int res; + int seenDigit = 0; # define SCRIPT_LATIN 0x0001 # define SCRIPT_CYRILLIC 0x0002 # define SCRIPT_GREEK 0x0004 @@ -1744,8 +1745,12 @@ static void scriptCodeSqlFunc( c = utf8Read(zIn, nIn, &sz); zIn += sz; nIn -= sz; - if( c<0x02af && (c>=0x80 || midClass[c&0x7f]=0x80 || midClass[c&0x7f]='0' && c<='9' ){ + seenDigit = 1; + } }else if( c>=0x0400 && c<=0x04ff ){ scriptMask |= SCRIPT_CYRILLIC; }else if( c>=0x0386 && c<=0x03ce ){ @@ -1756,6 +1761,7 @@ static void scriptCodeSqlFunc( scriptMask |= SCRIPT_ARABIC; } } + if( scriptMask==0 && seenDigit ) scriptMask = SCRIPT_LATIN; switch( scriptMask ){ case 0: res = 999; break; case SCRIPT_LATIN: res = 215; break; diff --git a/manifest b/manifest index 5ec513ed1c..b0746bb445 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Check\sfor\sPDB\sfiles\sprior\sto\sattempting\sto\scopy\sthem\sin\sthe\sMSVC\sbatch\sbuild\stool. -D 2016-03-10T19:08:44.973 +C Update\sspellfix1_scriptcode()\sto\soutput\s215\s(latin)\sfor\spure\snumeric\stext. +D 2016-03-11T14:30:18.667 F Makefile.in f53429fb2f313c099283659d0df6f20f932c861f F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc df0bf9ff7f8b3f4dd9fb4cc43f92fe58f6ec5c66 @@ -214,7 +214,7 @@ F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a F ext/misc/series.c e11e534ada797d5b816d7e7a93c022306563ca35 F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52 -F ext/misc/spellfix.c 194b5fc3a9a63cb6c5680d8f713800012bddca7c +F ext/misc/spellfix.c 598bbc45516227701558becdd38f4e6fe8e97cc2 F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512 F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e @@ -1059,7 +1059,7 @@ F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b F test/speedtest1.c 1478cb3fb64ad30f291ddca87ca9dbd72ff552aa F test/spellfix.test f9c1f431e2c096c8775fec032952320c0e4700db F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 -F test/spellfix3.test f7bf7b3482971473d32b6b00f6944c5c066cff97 +F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 F test/sqldiff1.test 8f6bc7c6a5b3585d350d779c6078869ba402f8f5 F test/sqllimits1.test a74ee2a3740b9f9c2437c246d8fb77354862a142 F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a @@ -1455,7 +1455,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P fa0033edf6ddf3c6631fa95b343225dbc8ac9429 -R 306b8c821d3092af90856b15d0070f67 -U mistachkin -Z c66ddc08ff47a327984a1b8fcbda8cec +P d7c20f04e69fb1848b2e2f3b04fbd56e06c7c854 +R 6aa12144d3c644bf9edbd83316218d69 +U drh +Z c13ed9f7b14004f5942c430b85f3af01 diff --git a/manifest.uuid b/manifest.uuid index b9cc10f12d..12423c25d8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d7c20f04e69fb1848b2e2f3b04fbd56e06c7c854 \ No newline at end of file +df44308b862e932ff0ad25b6328d13be22047b96 \ No newline at end of file diff --git a/test/spellfix3.test b/test/spellfix3.test index ce002edd4f..e24ea31ee7 100644 --- a/test/spellfix3.test +++ b/test/spellfix3.test @@ -35,9 +35,18 @@ do_execsql_test 140 { } {160} do_execsql_test 200 { SELECT spellfix1_scriptcode('+3.14159'); -} {999} +} {215} do_execsql_test 210 { SELECT spellfix1_scriptcode('And God said: "Да будет свет"'); } {998} +do_execsql_test 220 { + SELECT spellfix1_scriptcode('+3.14159 light'); +} {215} +do_execsql_test 230 { + SELECT spellfix1_scriptcode('+3.14159 свет'); +} {220} +do_execsql_test 240 { + SELECT spellfix1_scriptcode('וַיֹּ֥אמֶר +3.14159'); +} {125} finish_test