This project has retired. For details please refer to its Attic page.
Lucy::Analysis::SnowballStemmer – C API Documentation
Apache Lucy™

Lucy::Analysis::SnowballStemmer

parcel Lucy
class variable LUCY_SNOWBALLSTEMMER
struct symbol lucy_SnowballStemmer
class nickname lucy_SnowStemmer
header file Lucy/Analysis/SnowballStemmer.h

Name

Lucy::Analysis::SnowballStemmer – Reduce related words to a shared root.

Description

SnowballStemmer is an Analyzer which reduces related words to a root form (using the “Snowball” stemming library). For instance, “horse”, “horses”, and “horsing” all become “hors” – so that a search for ‘horse’ will also match documents containing ‘horses’ and ‘horsing’.

Functions

new
lucy_SnowballStemmer* // incremented
lucy_SnowStemmer_new(
    cfish_String *language
);

Create a new SnowballStemmer.

language

A two-letter ISO code identifying a language supported by Snowball.

init
lucy_SnowballStemmer*
lucy_SnowStemmer_init(
    lucy_SnowballStemmer *self,
    cfish_String *language
);

Initialize a SnowballStemmer.

language

A two-letter ISO code identifying a language supported by Snowball.

Methods

Transform
lucy_Inversion* // incremented
lucy_SnowStemmer_Transform(
    lucy_SnowballStemmer *self,
    lucy_Inversion *inversion
);

Take a single Inversion as input and returns an Inversion, either the same one (presumably transformed in some way), or a new one.

inversion

An inversion.

Dump
cfish_Hash* // incremented
lucy_SnowStemmer_Dump(
    lucy_SnowballStemmer *self
);

Dump the analyzer as hash.

Subclasses should call Dump() on the superclass. The returned object is a hash which should be populated with parameters of the analyzer.

Returns: A hash containing a description of the analyzer.

Load
lucy_SnowballStemmer* // incremented
lucy_SnowStemmer_Load(
    lucy_SnowballStemmer *self,
    cfish_Obj *dump
);

Reconstruct an analyzer from a dump.

Subclasses should first call Load() on the superclass. The returned object is an analyzer which should be reconstructed by setting the dumped parameters from the hash contained in dump.

Note that the invocant analyzer is unused.

dump

A hash.

Returns: An analyzer.

Equals
bool
lucy_SnowStemmer_Equals(
    lucy_SnowballStemmer *self,
    cfish_Obj *other
);

Indicate whether two objects are the same. By default, compares the memory address.

other

Another Obj.

Methods inherited from Lucy::Analysis::Analyzer

Transform_Text
lucy_Inversion* // incremented
lucy_SnowStemmer_Transform_Text(
    lucy_SnowballStemmer *self,
    cfish_String *text
);

Kick off an analysis chain, creating an Inversion from string input. The default implementation simply creates an initial Inversion with a single Token, then calls Transform(), but occasionally subclasses will provide an optimized implementation which minimizes string copies.

text

A string.

Split
cfish_Vector* // incremented
lucy_SnowStemmer_Split(
    lucy_SnowballStemmer *self,
    cfish_String *text
);

Analyze text and return an array of token texts.

text

A string.

Inheritance

Lucy::Analysis::SnowballStemmer is a Lucy::Analysis::Analyzer is a Clownfish::Obj.