Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Move the test_spellfix.c module to ext/misc/spellfix.c. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | std-ext |
Files: | files | file ages | folders |
SHA1: |
de556add10150140981a2e34b3712e96 |
User & Date: | drh 2013-04-25 14:59:01.366 |
Context
2013-04-25
| ||
16:42 | Added the transitive_closure, ieee754, and amatch extensions. (Closed-Leaf check-in: 84018099c8 user: drh tags: std-ext) | |
14:59 | Move the test_spellfix.c module to ext/misc/spellfix.c. (check-in: de556add10 user: drh tags: std-ext) | |
14:36 | Fix the MSVC makefile so that it works with the ext/misc/*.c extensions. (check-in: 680822e892 user: drh tags: std-ext) | |
Changes
Changes to Makefile.in.
︙ | ︙ | |||
386 387 388 389 390 391 392 393 394 395 396 397 398 399 | $(TOP)/ext/fts3/fts3_test.c # Statically linked extensions # TESTSRC += \ $(TOP)/ext/misc/fuzzer.c \ $(TOP)/ext/misc/regexp.c \ $(TOP)/ext/misc/wholenumber.c # Source code to the library files needed by the test fixture # TESTSRC2 = \ $(TOP)/src/attach.c \ $(TOP)/src/backup.c \ | > | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | $(TOP)/ext/fts3/fts3_test.c # Statically linked extensions # TESTSRC += \ $(TOP)/ext/misc/fuzzer.c \ $(TOP)/ext/misc/regexp.c \ $(TOP)/ext/misc/spellfix.c \ $(TOP)/ext/misc/wholenumber.c # Source code to the library files needed by the test fixture # TESTSRC2 = \ $(TOP)/src/attach.c \ $(TOP)/src/backup.c \ |
︙ | ︙ |
Changes to Makefile.msc.
︙ | ︙ | |||
706 707 708 709 710 711 712 713 714 715 716 717 718 719 | $(TOP)\ext\fts3\fts3_test.c # Statically linked extensions # TESTEXT = \ $(TOP)\ext\misc\fuzzer.c \ $(TOP)\ext\misc\regexp.c \ $(TOP)\ext\misc\wholenumber.c # Source code to the library files needed by the test fixture # TESTSRC2 = \ $(TOP)\src\attach.c \ | > | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | $(TOP)\ext\fts3\fts3_test.c # Statically linked extensions # TESTEXT = \ $(TOP)\ext\misc\fuzzer.c \ $(TOP)\ext\misc\regexp.c \ $(TOP)\ext\misc\spellfix.c \ $(TOP)\ext\misc\wholenumber.c # Source code to the library files needed by the test fixture # TESTSRC2 = \ $(TOP)\src\attach.c \ |
︙ | ︙ |
Name change from src/test_spellfix.c to ext/misc/spellfix.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** ** This module implements the spellfix1 VIRTUAL TABLE that can be used ** to search a large vocabulary for close matches. See separate ** documentation files (spellfix1.wiki and editdist3.wiki) for details. */ | < | > | | | | < | | | | | < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ** ************************************************************************* ** ** This module implements the spellfix1 VIRTUAL TABLE that can be used ** to search a large vocabulary for close matches. See separate ** documentation files (spellfix1.wiki and editdist3.wiki) for details. */ #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #include <string.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> #define ALWAYS(X) 1 #define NEVER(X) 0 typedef unsigned char u8; typedef unsigned short u16; #include <ctype.h> /* ** Character classes for ASCII characters: ** ** 0 '' Silent letters: H W ** 1 'A' Any vowel: A E I O U (Y) |
︙ | ︙ | |||
2818 2819 2820 2821 2822 2823 2824 | for(i=0; i<sizeof(translit)/sizeof(translit[0])-1; i++){ assert( translit[i].cFrom<translit[i+1].cFrom ); } return rc; } | < < < < < < < < < < < > > > | < | 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 | for(i=0; i<sizeof(translit)/sizeof(translit[0])-1; i++){ assert( translit[i].cFrom<translit[i+1].cFrom ); } return rc; } /* ** Extension load function. */ #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_spellfix_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi); return spellfix1Register(db); } |
Changes to main.mk.
︙ | ︙ | |||
268 269 270 271 272 273 274 275 276 277 278 279 280 281 | $(TOP)/src/test_wsd.c # Extensions to be statically loaded. # TESTSRC += \ $(TOP)/ext/misc/fuzzer.c \ $(TOP)/ext/misc/regexp.c \ $(TOP)/ext/misc/wholenumber.c #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c TESTSRC2 = \ | > | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | $(TOP)/src/test_wsd.c # Extensions to be statically loaded. # TESTSRC += \ $(TOP)/ext/misc/fuzzer.c \ $(TOP)/ext/misc/regexp.c \ $(TOP)/ext/misc/spellfix.c \ $(TOP)/ext/misc/wholenumber.c #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c TESTSRC2 = \ |
︙ | ︙ |
Changes to src/shell.c.
︙ | ︙ | |||
1476 1477 1478 1479 1480 1481 1482 | if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){ fprintf(stderr,"Error: unable to open database \"%s\": %s\n", p->zDbFilename, sqlite3_errmsg(db)); exit(1); } #ifndef SQLITE_OMIT_LOAD_EXTENSION sqlite3_enable_load_extension(p->db, 1); | < < < < < < < < < < < < | 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 | if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){ fprintf(stderr,"Error: unable to open database \"%s\": %s\n", p->zDbFilename, sqlite3_errmsg(db)); exit(1); } #ifndef SQLITE_OMIT_LOAD_EXTENSION sqlite3_enable_load_extension(p->db, 1); #endif } } /* ** Do C-language style dequoting. ** |
︙ | ︙ |
Changes to src/test1.c.
︙ | ︙ | |||
6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 | void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ extern int sqlite3_fuzzer_init(sqlite3*,char**,const sqlite3_api_routines*); extern int sqlite3_regexp_init(sqlite3*,char**,const sqlite3_api_routines*); extern int sqlite3_wholenumber_init(sqlite3*,char**,const sqlite3_api_routines*); static const struct { const char *zExtName; int (*pInit)(sqlite3*,char**,const sqlite3_api_routines*); } aExtension[] = { { "fuzzer", sqlite3_fuzzer_init }, { "regexp", sqlite3_regexp_init }, { "wholenumber", sqlite3_wholenumber_init }, }; sqlite3 *db; const char *zName; int i, rc; char *zErrMsg = 0; if( objc!=3 ){ | > > | 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 | void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ extern int sqlite3_fuzzer_init(sqlite3*,char**,const sqlite3_api_routines*); extern int sqlite3_regexp_init(sqlite3*,char**,const sqlite3_api_routines*); extern int sqlite3_spellfix_init(sqlite3*,char**,const sqlite3_api_routines*); extern int sqlite3_wholenumber_init(sqlite3*,char**,const sqlite3_api_routines*); static const struct { const char *zExtName; int (*pInit)(sqlite3*,char**,const sqlite3_api_routines*); } aExtension[] = { { "fuzzer", sqlite3_fuzzer_init }, { "regexp", sqlite3_regexp_init }, { "spellfix", sqlite3_spellfix_init }, { "wholenumber", sqlite3_wholenumber_init }, }; sqlite3 *db; const char *zName; int i, rc; char *zErrMsg = 0; if( objc!=3 ){ |
︙ | ︙ |
Changes to src/test8.c.
︙ | ︙ | |||
1366 1367 1368 1369 1370 1371 1372 | if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char *)sqlite3_errmsg(db), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } | < < < < < < < < < < < < < < < < < < < < < < < < | 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 | if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char *)sqlite3_errmsg(db), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ /* ** Register commands with the TCL interpreter. */ int Sqlitetest8_Init(Tcl_Interp *interp){ #ifndef SQLITE_OMIT_VIRTUALTABLE static struct { char *zName; Tcl_ObjCmdProc *xProc; void *clientData; } aObjCmd[] = { { "register_echo_module", register_echo_module, 0 }, { "sqlite3_declare_vtab", declare_vtab, 0 }, }; int i; for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){ Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, aObjCmd[i].clientData, 0); } |
︙ | ︙ |
Changes to test/spellfix.test.
︙ | ︙ | |||
12 13 14 15 16 17 18 | set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix spellfix ifcapable !vtab { finish_test ; return } | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix spellfix ifcapable !vtab { finish_test ; return } load_static_extension db spellfix set vocab { rabbi rabbit rabbits rabble rabid rabies raccoon raccoons race raced racer racers races racetrack racial racially racing rack racked racket racketeer racketeering racketeers rackets racking racks radar radars radial radially radian radiance radiant radiantly radiate radiated radiates radiating radiation radiations radiator radiators radical radically radicals radices radii radio |
︙ | ︙ |