3 Snowball-Based Stemming
4 =======================
6 This module uses the word stemming code developed by the Snowball project,
7 http://snowball.tartarus.org/
8 which is released by them under a BSD-style license.
10 The files under src/backend/snowball/libstemmer/ and
11 src/include/snowball/libstemmer/ are taken directly from their libstemmer_c
12 distribution, with only some minor adjustments of file inclusions. Note
13 that most of these files are in fact derived files, not master source.
14 The master sources are in the Snowball language, and are available along
15 with the Snowball-to-C compiler from the Snowball project. We choose to
16 include the derived files in the PostgreSQL distribution because most
17 installations will not have the Snowball compiler available.
19 To update the PostgreSQL sources from a new Snowball libstemmer_c
22 1. Copy the *.c files in libstemmer_c/src_c/ to src/backend/snowball/libstemmer
23 with replacement of "../runtime/header.h" by "header.h", for example
25 for f in libstemmer_c/src_c/*.c
27 sed 's|\.\./runtime/header\.h|header.h|' $f >libstemmer/`basename $f`
30 (Alternatively, if you rebuild the stemmer files from the master Snowball
31 sources, just omit "-r ../runtime" from the Snowball compiler switches.)
33 2. Copy the *.c files in libstemmer_c/runtime/ to
34 src/backend/snowball/libstemmer, and edit them to remove direct inclusions
35 of system headers such as <stdio.h> --- they should only include "header.h".
36 (This removal avoids portability problems on some platforms where <stdio.h>
37 is sensitive to largefile compilation options.)
39 3. Copy the *.h files in libstemmer_c/src_c/ and libstemmer_c/runtime/
40 to src/include/snowball/libstemmer. At this writing the header files
41 do not require any changes.
43 4. Check whether any stemmer modules have been added or removed. If so, edit
44 the OBJS list in Makefile, the list of #include's in dict_snowball.c, and the
45 stemmer_modules[] table in dict_snowball.c.
47 5. The various stopword files in stopwords/ must be downloaded
48 individually from pages on the snowball.tartarus.org website.
49 Be careful that these files must be stored in UTF-8 encoding.