/ Check-in [0934d220]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More snippet generator improvements and test cases. (CVS 3449)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0934d220b33c52024f42c89fa13326bd52333f39
User & Date: drh 2006-09-28 18:58:00
Context
2006-09-28
19:43
Fix a bug in the handling of the OR operator in FTS1. Test cases added to prevent a repeat. (CVS 3450) check-in: 8cdf1d6a user: drh tags: trunk
18:58
More snippet generator improvements and test cases. (CVS 3449) check-in: 0934d220 user: drh tags: trunk
18:37
Bug fix in the FTS1 snippet generator. Improvements in the way the snippet generator handles whitespace. (CVS 3448) check-in: d3f4ae82 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts1/fts1.c.

  2387   2387       }
  2388   2388       if( iCol==tailCol && iStart<=tailOffset+20 ){
  2389   2389         iStart = tailOffset;
  2390   2390         wantEllipsis = 0;
  2391   2391         tailEllipsis = 0;
  2392   2392       }
  2393   2393       if( iCol!=tailCol || iStart!=tailOffset ){
         2394  +      trimWhiteSpace(&sb);
  2394   2395         appendWhiteSpace(&sb);
  2395   2396       }
  2396   2397       if( wantEllipsis || tailEllipsis ){
  2397   2398         append(&sb, zEllipsis);
  2398   2399         appendWhiteSpace(&sb);
  2399   2400       }
  2400   2401       iEnd = aMatch[i].iStart + aMatch[i].nByte + 40;

Changes to test/fts1c.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the FTS1 module.
    13     13   #
    14         -# $Id: fts1c.test,v 1.8 2006/09/28 18:37:16 drh Exp $
           14  +# $Id: fts1c.test,v 1.9 2006/09/28 18:58:00 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # If SQLITE_ENABLE_FTS1 is defined, omit this file.
    21     21   ifcapable !fts1 {
................................................................................
  1153   1153        Contract negotiations  }}
  1154   1154   do_test fts1c-4.5 {
  1155   1155     execsql {
  1156   1156       SELECT snippet(email,'<<<','>>>',' ') FROM email
  1157   1157        WHERE email MATCH 'first things'
  1158   1158     }
  1159   1159   } {{Re: <<<First>>> Polish Deal! Congrats!  <<<Things>>> seem to be building rapidly now on the  }}
         1160  +do_test fts1c-4.6 {
         1161  +  execsql {
         1162  +    SELECT snippet(email) FROM email
         1163  +     WHERE email MATCH 'chris is here'
         1164  +  }
         1165  +} {{<b>chris</b>.germany@enron.com Sounds good to me.  I bet this <b>is</b> next to the Warick?? Hotel. <b>...</b> place.? What do you think about going <b>here</b> Christmas 
         1166  +eve?? They have an 11:00 a.m. <b>...</b>}}
         1167  +do_test fts1c-4.7 {
         1168  +  execsql {
         1169  +    SELECT snippet(email) FROM email
         1170  +     WHERE email MATCH '"pursuant to"'
         1171  +  }
         1172  +} {{Erin:
         1173  +
         1174  +<b>Pursuant</b> <b>to</b> your request, attached are the Schedule to <b>...</b>}}
         1175  +do_test fts1c-4.8 {
         1176  +  execsql {
         1177  +    SELECT snippet(email) FROM email
         1178  +     WHERE email MATCH 'ancillary load davis'
         1179  +  }
         1180  +} {{pete.<b>davis</b>@enron.com Start Date: 4/22/01; HourAhead hour: 3;  No <b>ancillary</b> schedules awarded.  
         1181  +Variances detected.
         1182  +Variances detected in <b>Load</b> schedule.
         1183  +
         1184  +    LOG MESSAGES:
         1185  +
         1186  +PARSING <b>...</b>}}
  1160   1187   
  1161   1188   finish_test