parcel | Lucy |
class variable | LUCY_SNOWBALLSTEMMER |
struct symbol | lucy_SnowballStemmer |
class nickname | lucy_SnowStemmer |
header file | Lucy/Analysis/SnowballStemmer.h |
Lucy::Analysis::SnowballStemmer – Reduce related words to a shared root.
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’.
lucy_SnowballStemmer* // incremented
lucy_SnowStemmer_new(
cfish_String *language
);
Create a new SnowballStemmer.
A two-letter ISO code identifying a language supported by Snowball.
lucy_SnowballStemmer*
lucy_SnowStemmer_init(
lucy_SnowballStemmer *self,
cfish_String *language
);
Initialize a SnowballStemmer.
A two-letter ISO code identifying a language supported by Snowball.
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.
An inversion.
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.
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.
A hash.
Returns: An analyzer.
bool
lucy_SnowStemmer_Equals(
lucy_SnowballStemmer *self,
cfish_Obj *other
);
Indicate whether two objects are the same. By default, compares the memory address.
Another Obj.
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.
A string.
cfish_Vector* // incremented
lucy_SnowStemmer_Split(
lucy_SnowballStemmer *self,
cfish_String *text
);
Analyze text and return an array of token texts.
A string.
Lucy::Analysis::SnowballStemmer is a Lucy::Analysis::Analyzer is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.