class documentation

class SearchLanguage:

Known subclasses: sphinx.search.da.SearchDanish, sphinx.search.de.SearchGerman, sphinx.search.en.SearchEnglish, sphinx.search.es.SearchSpanish, sphinx.search.fi.SearchFinnish, sphinx.search.fr.SearchFrench, sphinx.search.hu.SearchHungarian, sphinx.search.it.SearchItalian, sphinx.search.ja.SearchJapanese, sphinx.search.nl.SearchDutch, sphinx.search.no.SearchNorwegian, sphinx.search.pt.SearchPortuguese, sphinx.search.ro.SearchRomanian, sphinx.search.ru.SearchRussian, sphinx.search.sv.SearchSwedish, sphinx.search.tr.SearchTurkish, sphinx.search.zh.SearchChinese

View In Hierarchy

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).

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 ​_word​_re Undocumented
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
def __init__(self, options):

Undocumented

Parameters
options:DictUndocumented
def split(self, input):
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):

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):
Return true if the target word should be registered in the search index. This method is called after stemming.
Parameters
word:strUndocumented
Returns
boolUndocumented
_word_re =

Undocumented

js_splitter_code: str =

Undocumented

js_stemmer_code: str =

Undocumented

stopwords: Set[str] =
options =

Undocumented