class documentation

This class is the base class for search natural language preprocessors. If you want to add support for a new language, you should override the methods of this class. You should override `lang` class property too (e.g. 'en', 'fr' and so on). .. attribute:: stopwords This is a set of stop words of the target language. Default `stopwords` is empty. This word is used for building index and embedded in JS. .. attribute:: js_splitter_code Return splitter function of JavaScript version. The function should be named as ``splitQuery``. And it should take a string and return list of strings. .. versionadded:: 3.0 .. attribute:: js_stemmer_code Return stemmer class of JavaScript version. This class' name should be ``Stemmer`` and this class must have ``stemWord`` method. This string is embedded as-is in searchtools.js. This class is used to preprocess search word which Sphinx HTML readers type, before searching index. Default implementation does nothing.

Method __init__ Undocumented
Method init Initialize the class with the options the user has given.
Method split This method splits a sentence into words. Default splitter splits input at white spaces, which should be enough for most languages except CJK languages.
Method stem This method implements stemming algorithm of the Python version.
Method word_filter Return true if the target word should be registered in the search index. This method is called after stemming.
Class Variable js_splitter_code Undocumented
Class Variable js_stemmer_code Undocumented
Class Variable js_stemmer_rawcode Undocumented
Class Variable lang Undocumented
Class Variable language_name Undocumented
Class Variable stopwords Undocumented
Instance Variable options Undocumented
Class Variable _word_re Undocumented
def __init__(self, options): (source)

Undocumented

Parameters
options:dictUndocumented
def split(self, input): (source)

This method splits a sentence into words. Default splitter splits input at white spaces, which should be enough for most languages except CJK languages.

Parameters
input:strUndocumented
Returns
list[str]Undocumented
def stem(self, word): (source)

This method implements stemming algorithm of the Python version. Default implementation does nothing. You should implement this if the language has any stemming rules. This class is used to preprocess search words before registering them in the search index. The stemming of the Python version and the JS version (given in the js_stemmer_code attribute) must be compatible.

Parameters
word:strUndocumented
Returns
strUndocumented
def word_filter(self, word): (source)

Return true if the target word should be registered in the search index. This method is called after stemming.

Parameters
word:strUndocumented
Returns
boolUndocumented
js_splitter_code: str = (source)

Undocumented

js_stemmer_code: str = (source)

Undocumented

Undocumented

_word_re = (source)

Undocumented