SQLite

Check-in [0934d220b3]
Login

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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0934d220b33c52024f42c89fa13326bd52333f39
User & Date: drh 2006-09-28 18:58:00.000
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: 8cdf1d6ae0 user: drh tags: trunk)
18:58
More snippet generator improvements and test cases. (CVS 3449) (check-in: 0934d220b3 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: d3f4ae8275 user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to ext/fts1/fts1.c.
2387
2388
2389
2390
2391
2392
2393

2394
2395
2396
2397
2398
2399
2400
    }
    if( iCol==tailCol && iStart<=tailOffset+20 ){
      iStart = tailOffset;
      wantEllipsis = 0;
      tailEllipsis = 0;
    }
    if( iCol!=tailCol || iStart!=tailOffset ){

      appendWhiteSpace(&sb);
    }
    if( wantEllipsis || tailEllipsis ){
      append(&sb, zEllipsis);
      appendWhiteSpace(&sb);
    }
    iEnd = aMatch[i].iStart + aMatch[i].nByte + 40;







>







2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
    }
    if( iCol==tailCol && iStart<=tailOffset+20 ){
      iStart = tailOffset;
      wantEllipsis = 0;
      tailEllipsis = 0;
    }
    if( iCol!=tailCol || iStart!=tailOffset ){
      trimWhiteSpace(&sb);
      appendWhiteSpace(&sb);
    }
    if( wantEllipsis || tailEllipsis ){
      append(&sb, zEllipsis);
      appendWhiteSpace(&sb);
    }
    iEnd = aMatch[i].iStart + aMatch[i].nByte + 40;
Changes to test/fts1c.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2006 September 14
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is testing the FTS1 module.
#
# $Id: fts1c.test,v 1.8 2006/09/28 18:37:16 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# If SQLITE_ENABLE_FTS1 is defined, omit this file.
ifcapable !fts1 {













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2006 September 14
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is testing the FTS1 module.
#
# $Id: fts1c.test,v 1.9 2006/09/28 18:58:00 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# If SQLITE_ENABLE_FTS1 is defined, omit this file.
ifcapable !fts1 {
1153
1154
1155
1156
1157
1158
1159




1160























1161
     Contract negotiations  }}
do_test fts1c-4.5 {
  execsql {
    SELECT snippet(email,'<<<','>>>',' ') FROM email
     WHERE email MATCH 'first things'
  }
} {{Re: <<<First>>> Polish Deal! Congrats!  <<<Things>>> seem to be building rapidly now on the  }}




























finish_test







>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
     Contract negotiations  }}
do_test fts1c-4.5 {
  execsql {
    SELECT snippet(email,'<<<','>>>',' ') FROM email
     WHERE email MATCH 'first things'
  }
} {{Re: <<<First>>> Polish Deal! Congrats!  <<<Things>>> 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'
  }
} {{<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 
eve?? They have an 11:00 a.m. <b>...</b>}}
do_test fts1c-4.7 {
  execsql {
    SELECT snippet(email) FROM email
     WHERE email MATCH '"pursuant to"'
  }
} {{Erin:

<b>Pursuant</b> <b>to</b> your request, attached are the Schedule to <b>...</b>}}
do_test fts1c-4.8 {
  execsql {
    SELECT snippet(email) FROM email
     WHERE email MATCH 'ancillary load davis'
  }
} {{pete.<b>davis</b>@enron.com Start Date: 4/22/01; HourAhead hour: 3;  No <b>ancillary</b> schedules awarded.  
Variances detected.
Variances detected in <b>Load</b> schedule.

    LOG MESSAGES:

PARSING <b>...</b>}}

finish_test