From: drh Date: Wed, 4 Oct 2006 17:35:28 +0000 (+0000) Subject: The snippet generator adds ellipsis between text from different columns. (CVS 3465) X-Git-Tag: version-3.6.10~2702 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53c36d544448f2e813fb248ba2a522a51279313b;p=thirdparty%2Fsqlite.git The snippet generator adds ellipsis between text from different columns. (CVS 3465) FossilOrigin-Name: 6cf1fb9f801dc1b2865c0d1f9afb1b2076d4246e --- diff --git a/ext/fts1/fts1.c b/ext/fts1/fts1.c index c13f7647aa..a099c17eea 100644 --- a/ext/fts1/fts1.c +++ b/ext/fts1/fts1.c @@ -2366,13 +2366,12 @@ static void snippetText( int nMatch; int nDesired; StringBuffer sb; - int tailCol = -1; - int tailOffset = -1; + int tailCol; + int tailOffset; int iCol; int nDoc; const char *zDoc; int iStart, iEnd; - int wantEllipsis; int tailEllipsis = 0; int iMatch; @@ -2398,6 +2397,8 @@ static void snippetText( } iMatch = 0; + tailCol = -1; + tailOffset = 0; for(i=0; i0; i++){ if( aMatch[i].snStatus!=SNIPPET_DESIRED ) continue; nDesired--; @@ -2408,20 +2409,13 @@ static void snippetText( iStart = wordBoundary(iStart, zDoc, nDoc, aMatch, nMatch, iCol); if( iStart<=10 ){ iStart = 0; - wantEllipsis = 0; - }else{ - wantEllipsis = 1; } if( iCol==tailCol && iStart<=tailOffset+20 ){ iStart = tailOffset; - wantEllipsis = 0; - tailEllipsis = 0; } - if( iCol!=tailCol || iStart!=tailOffset ){ + if( (iCol!=tailCol && tailCol>=0) || iStart!=tailOffset ){ trimWhiteSpace(&sb); appendWhiteSpace(&sb); - } - if( wantEllipsis || tailEllipsis ){ append(&sb, zEllipsis); appendWhiteSpace(&sb); } diff --git a/manifest b/manifest index 2d8c7fd138..d4d4e9f04c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sUTF\sconversions\sfor\s-O2\son\sgcc\s4.1.1.\s\sTicket\s#2008.\s(CVS\s3464) -D 2006-10-04T15:23:22 +C The\ssnippet\sgenerator\sadds\sellipsis\sbetween\stext\sfrom\sdifferent\scolumns.\s(CVS\s3465) +D 2006-10-04T17:35:28 F Makefile.in 4379c909d46b38b8c5db3533084601621d4f14b2 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -21,7 +21,7 @@ F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1 F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b F ext/fts1/ft_hash.h 1a35e654a235c2c662d3ca0dfc3138ad60b8b7d5 -F ext/fts1/fts1.c 6eca4867e4c4288747534e548ea0c8a7026afbfa +F ext/fts1/fts1.c 37ba4a1cf2489e98491fa2767f9e75d87dbc318e F ext/fts1/fts1.h 6060b8f62c1d925ea8356cb1a6598073eb9159a6 F ext/fts1/fts1_hash.c 3196cee866edbebb1c0521e21672e6d599965114 F ext/fts1/fts1_hash.h 957d378355ed29f672cd5add012ce8b088a5e089 @@ -193,7 +193,7 @@ F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7 F test/fts1b.test 5d8a01aefbecc8b7442b36c94c05eb7a845462d5 -F test/fts1c.test 8790cc74bfc3141772f5cc0252dcdef20832f755 +F test/fts1c.test 85a525ce7428907469b4cce13d5563ce542ce64c F test/fts1d.test a73deace5c18df4a549b12908bade4f05dcf1a2f F test/fts1porter.test d86e9c3e0c7f8ff95add6582b4b585fb4e02b96d F test/func.test 0ed54b5aeaad319f68016c033acfebef56f5874a @@ -402,7 +402,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P eef0ec0d7ae0743d29454567f539e46ad2d5008e -R d5b9f813970a158cf400394eee3842a8 +P 86a08bb7c5da42fbeb5a026287d67912a2ffb7f1 +R c71cdbdbaa74de712bb1ae9465bd527d U drh -Z 59839b6801d726e2458ae7f941423cf8 +Z f00b4a0381f58882003326222b2c2698 diff --git a/manifest.uuid b/manifest.uuid index 944c08480e..8154076cc4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -86a08bb7c5da42fbeb5a026287d67912a2ffb7f1 \ No newline at end of file +6cf1fb9f801dc1b2865c0d1f9afb1b2076d4246e \ No newline at end of file diff --git a/test/fts1c.test b/test/fts1c.test index 3c5ff7ef0c..a12469593a 100644 --- a/test/fts1c.test +++ b/test/fts1c.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS1 module. # -# $Id: fts1c.test,v 1.10 2006/09/28 19:43:32 drh Exp $ +# $Id: fts1c.test,v 1.11 2006/10/04 17:35:28 drh Exp $ # set testdir [file dirname $argv0] @@ -1156,13 +1156,13 @@ do_test fts1c-4.5 { SELECT snippet(email,'<<<','>>>',' ') FROM email WHERE email MATCH 'first things' } -} {{Re: <<>> Polish Deal! Congrats! <<>> seem to be building rapidly now on the }} +} {{Re: <<>> Polish Deal! Congrats! <<>> seem to be building rapidly now on the }} do_test fts1c-4.6 { execsql { SELECT snippet(email) FROM email WHERE email MATCH 'chris is here' } -} {{chris.germany@enron.com Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas +} {{chris.germany@enron.com ... Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas eve?? They have an 11:00 a.m. ...}} do_test fts1c-4.7 { execsql { @@ -1177,7 +1177,7 @@ do_test fts1c-4.8 { SELECT snippet(email) FROM email WHERE email MATCH 'ancillary load davis' } -} {{pete.davis@enron.com Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +} {{pete.davis@enron.com ... Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule.