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

Lucy::Analysis::EasyAnalyzer

parcel Lucy
class variable LUCY_EASYANALYZER
struct symbol lucy_EasyAnalyzer
class nickname lucy_EasyAnalyzer
header file Lucy/Analysis/EasyAnalyzer.h

Name

Lucy::Analysis::EasyAnalyzer – A simple analyzer chain.

Description

EasyAnalyzer is an analyzer chain consisting of a StandardTokenizer, a Normalizer, and a SnowballStemmer.

Supported languages:

en => English,
da => Danish,
de => German,
es => Spanish,
fi => Finnish,
fr => French,
hu => Hungarian,
it => Italian,
nl => Dutch,
no => Norwegian,
pt => Portuguese,
ro => Romanian,
ru => Russian,
sv => Swedish,
tr => Turkish,

Functions

new
lucy_EasyAnalyzer* // incremented
lucy_EasyAnalyzer_new(
    cfish_String *language
);

Create a new EasyAnalyzer.

language

An ISO code from the list of supported languages.

init
lucy_EasyAnalyzer*
lucy_EasyAnalyzer_init(
    lucy_EasyAnalyzer *self,
    cfish_String *language
);

Initialize an EasyAnalyzer.

language

An ISO code from the list of supported languages.

Methods

Transform
lucy_Inversion* // incremented
lucy_EasyAnalyzer_Transform(
    lucy_EasyAnalyzer *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.

Transform_Text
lucy_Inversion* // incremented
lucy_EasyAnalyzer_Transform_Text(
    lucy_EasyAnalyzer *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.

Dump
cfish_Hash* // incremented
lucy_EasyAnalyzer_Dump(
    lucy_EasyAnalyzer *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_EasyAnalyzer* // incremented
lucy_EasyAnalyzer_Load(
    lucy_EasyAnalyzer *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_EasyAnalyzer_Equals(
    lucy_EasyAnalyzer *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

Split
cfish_Vector* // incremented
lucy_EasyAnalyzer_Split(
    lucy_EasyAnalyzer *self,
    cfish_String *text
);

Analyze text and return an array of token texts.

text

A string.

Inheritance

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