10
10
/* FIXME - should be able to get a version number for each stemming
11
11
* algorithm (which will be incremented each time the output changes). */
12
/* FIXME - should be able to get a list of available stemmers. */
13
/** Returns an array of the names of the available stemming algorithms.
14
* Note that these are the canonical names - aliases (ie, other names for
15
* the same algorithm) will not be included in the list.
16
* The list is terminated with a null pointer.
18
* The list must not be modified in any way.
20
const char ** sb_stemmer_list();
22
/** Create a new stemmer object, using the specified algorithm.
24
* @return If the specified algorithm is not recognised, 0 will be
25
* returned; otherwise a pointer to a newly created stemmer for that
26
* algorithm will be returned.
13
28
struct sb_stemmer * sb_stemmer_new(const char * algorithm);
30
/** Delete a stemmer object.
32
* This frees all resources allocated for the stemmer. After calling
33
* this function, the supplied stemmer may no longer be used in any way.
35
* It is safe to pass a null pointer to this function - this will have
14
38
void sb_stemmer_delete(struct sb_stemmer * stemmer);
16
/* FIXME - this should return the length of the stemmed word. */
42
* The return value is owned by the stemmer - it must not be freed or
43
* modified, and it will become invalid when the stemmer is called again,
44
* or if the stemmer is freed.
46
* The length of the return value can be obtained using sb_stemmer_length()
17
48
const sb_symbol * sb_stemmer_stem(struct sb_stemmer * stemmer,
18
49
const sb_symbol * word, int size);
51
/** Get the length of the result of the last stemmed word.
52
* This should not be called before sb_stemmer_stem() has been called.
54
int sb_stemmer_length(struct sb_stemmer * stemmer);