fts3_porter.c File Reference

Go to the source code of this file.

Classes

struct  porter_tokenizer
struct  porter_tokenizer_cursor

Defines

#define isDelim(C)   (((ch=C)&0x80)==0 && (ch<0x30 || !porterIdChar[ch-0x30]))

Functions

static int porterCreate (int argc, const char *const *argv, sqlite3_tokenizer **ppTokenizer)
static int porterDestroy (sqlite3_tokenizer *pTokenizer)
static int porterOpen (sqlite3_tokenizer *pTokenizer, const char *zInput, int nInput, sqlite3_tokenizer_cursor **ppCursor)
static int porterClose (sqlite3_tokenizer_cursor *pCursor)
static int isVowel (const char *)
static int isConsonant (const char *z)
static int m_gt_0 (const char *z)
static int m_eq_1 (const char *z)
static int m_gt_1 (const char *z)
static int hasVowel (const char *z)
static int doubleConsonant (const char *z)
static int star_oh (const char *z)
static int stem (char **pz, const char *zFrom, const char *zTo, int(*xCond)(const char *))
static void copy_stemmer (const char *zIn, int nIn, char *zOut, int *pnOut)
static void porter_stemmer (const char *zIn, int nIn, char *zOut, int *pnOut)
static int porterNext (sqlite3_tokenizer_cursor *pCursor, const char **pzToken, int *pnBytes, int *piStartOffset, int *piEndOffset, int *piPosition)
void sqlite3Fts3PorterTokenizerModule (sqlite3_tokenizer_module const **ppModule)

Variables

static const
sqlite3_tokenizer_module 
porterTokenizerModule
static const char cType []
static const char porterIdChar []

Define Documentation

#define isDelim (  )     (((ch=C)&0x80)==0 && (ch<0x30 || !porterIdChar[ch-0x30]))

Definition at line 571 of file fts3_porter.c.


Function Documentation

static void copy_stemmer ( const char *  zIn,
int  nIn,
char *  zOut,
int *  pnOut 
) [static]

Definition at line 293 of file fts3_porter.c.

Referenced by porter_stemmer().

static int doubleConsonant ( const char *  z  )  [static]

Definition at line 236 of file fts3_porter.c.

References isConsonant().

Referenced by porter_stemmer().

static int hasVowel ( const char *  z  )  [static]

Definition at line 225 of file fts3_porter.c.

References isConsonant().

Referenced by porter_stemmer().

static int isConsonant ( const char *  z  )  [static]

Definition at line 149 of file fts3_porter.c.

References cType, and isVowel().

Referenced by doubleConsonant(), hasVowel(), isVowel(), m_eq_1(), m_gt_0(), m_gt_1(), and star_oh().

static int isVowel ( const char *  z  )  [static]

Definition at line 158 of file fts3_porter.c.

References cType, and isConsonant().

Referenced by isConsonant(), m_eq_1(), m_gt_0(), m_gt_1(), and star_oh().

static int m_eq_1 ( const char *  z  )  [static]

Definition at line 197 of file fts3_porter.c.

References isConsonant(), and isVowel().

Referenced by porter_stemmer().

static int m_gt_0 ( const char *  z  )  [static]

Definition at line 187 of file fts3_porter.c.

References isConsonant(), and isVowel().

Referenced by porter_stemmer().

static int m_gt_1 ( const char *  z  )  [static]

Definition at line 211 of file fts3_porter.c.

References isConsonant(), and isVowel().

Referenced by porter_stemmer().

static void porter_stemmer ( const char *  zIn,
int  nIn,
char *  zOut,
int *  pnOut 
) [static]

Definition at line 340 of file fts3_porter.c.

References copy_stemmer(), doubleConsonant(), hasVowel(), m_eq_1(), m_gt_0(), m_gt_1(), star_oh(), and stem().

Referenced by porterNext().

static int porterClose ( sqlite3_tokenizer_cursor pCursor  )  [static]

Definition at line 121 of file fts3_porter.c.

References sqlite3_free(), SQLITE_OK, and porter_tokenizer_cursor::zToken.

static int porterCreate ( int  argc,
const char *const *  argv,
sqlite3_tokenizer **  ppTokenizer 
) [static]

Definition at line 64 of file fts3_porter.c.

References porter_tokenizer::base, sqlite3_malloc(), SQLITE_NOMEM, and SQLITE_OK.

static int porterDestroy ( sqlite3_tokenizer pTokenizer  )  [static]

Definition at line 79 of file fts3_porter.c.

References sqlite3_free(), and SQLITE_OK.

static int porterNext ( sqlite3_tokenizer_cursor pCursor,
const char **  pzToken,
int *  pnBytes,
int *  piStartOffset,
int *  piEndOffset,
int *  piPosition 
) [static]
static int porterOpen ( sqlite3_tokenizer pTokenizer,
const char *  zInput,
int  nInput,
sqlite3_tokenizer_cursor **  ppCursor 
) [static]
void sqlite3Fts3PorterTokenizerModule ( sqlite3_tokenizer_module const **  ppModule  ) 

Definition at line 636 of file fts3_porter.c.

Referenced by sqlite3Fts3Init().

static int star_oh ( const char *  z  )  [static]

Definition at line 248 of file fts3_porter.c.

References isConsonant(), and isVowel().

Referenced by porter_stemmer().

static int stem ( char **  pz,
const char *  zFrom,
const char *  zTo,
int(*)(const char *)  xCond 
) [static]

Definition at line 268 of file fts3_porter.c.

Referenced by porter_stemmer().


Variable Documentation

const char cType[] [static]
Initial value:
 {
   0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0,
   1, 1, 1, 2, 1
}

Definition at line 130 of file fts3_porter.c.

Referenced by isConsonant(), and isVowel().

const char porterIdChar[] [static]
Initial value:
 {

    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,  
    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,  
    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,  
}

Definition at line 563 of file fts3_porter.c.

Initial value:

Definition at line 58 of file fts3_porter.c.


ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:59 2011 by Doxygen 1.6.1