tsexample
tsexample · Example C extension that defines a custom full-text parser, dictionary template, dictionary, and text-search configuration.
Overview
Usage
Sources:
- Extension control file
- Version 1.0 installation SQL
- C parser and dictionary implementation
- Regression example SQL
tsexample 1.0 is a compact C example of PostgreSQL’s extensible full-text-search interfaces. It installs the sample_parser parser, the cutdict dictionary template, a cut3 dictionary, and the sample text-search configuration.
Inspect parsing and lexemes
sample_parser groups letters, digits, and underscore characters into tokens, classifying an all-digit token as number and any token containing a non-digit as word. The sample configuration maps numbers through PostgreSQL’s simple dictionary and words through cut3. cut3 lowercases a word and, for longer inputs, emits lexemes made from its first three and last three characters.
Example status
This project is instructional code, not a general linguistic analyzer. Its fixed object names and three-character dictionary settings are examples to adapt rather than a complete search design. The repository supplies no README, explicit license file, release history, or compatibility matrix. Build and test the C module against the exact PostgreSQL major version, and use distinct object names if incorporating the pattern into another extension.