Index: ext/fts1/fts1.c ================================================================== --- ext/fts1/fts1.c +++ ext/fts1/fts1.c @@ -11,10 +11,14 @@ ** ** * The FTS1 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS1 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) + +#if defined(SQLITE_ENABLE_FTS1) && !defined(SQLITE_CORE) +# define SQLITE_CORE 1 +#endif #include #if !defined(__APPLE__) #include #else @@ -178,19 +182,18 @@ DL_POSITIONS, /* docids + positions */ DL_POSITIONS_OFFSETS /* docids + positions + offsets */ } DocListType; /* -** By default, positions and offsets are stored in the doclists. -** To change this so that only positions are stored, compile -** with +** By default, only positions and not offsets are stored in the doclists. +** To change this so that offsets are stored too, compile with ** -** -DDL_DEFAULT=DL_POSITIONS +** -DDL_DEFAULT=DL_POSITIONS_OFFSETS ** */ #ifndef DL_DEFAULT -# define DL_DEFAULT DL_POSITIONS_OFFSETS +# define DL_DEFAULT DL_POSITIONS #endif typedef struct DocList { char *pData; int nData; @@ -1910,13 +1913,13 @@ if( spec->azTokenizer==0 ){ return SQLITE_NOMEM; } /* TODO(shess) For now, add new tokenizers as else if clauses. */ - if( spec->azTokenizer[0]==0 || !strcmp(spec->azTokenizer[0], "simple") ){ + if( spec->azTokenizer[0]==0 || startsWith(spec->azTokenizer[0], "simple") ){ sqlite3Fts1SimpleTokenizerModule(&m); - }else if( strcmp(spec->azTokenizer[0], "porter")==0 ){ + }else if( startsWith(spec->azTokenizer[0], "porter") ){ sqlite3Fts1PorterTokenizerModule(&m); }else{ *pzErr = sqlite3_mprintf("unknown tokenizer: %s", spec->azTokenizer[0]); rc = SQLITE_ERROR; goto err; Index: test/fts1porter.test ================================================================== --- test/fts1porter.test +++ test/fts1porter.test @@ -10,11 +10,11 @@ #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS1 module, and in particular # the Porter stemmer. # -# $Id: fts1porter.test,v 1.4 2006/10/01 20:41:03 drh Exp $ +# $Id: fts1porter.test,v 1.5 2006/10/03 19:37:37 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -23571,11 +23571,11 @@ # Create a full-text index to use for testing the stemmer. # db close sqlite3 db :memory: db eval { - CREATE VIRTUAL TABLE t1 USING fts1(word, tokenize porter); + CREATE VIRTUAL TABLE t1 USING fts1(word, tokenize Porter); } foreach {pfrom pto} $porter_test_data { do_test fts1porter-$pfrom { execsql {