function apachesolr_multilingual_get_stemmer in Apache Solr Multilingual 6.2
Same name and namespace in other branches
- 6 apachesolr_multilingual.module \apachesolr_multilingual_get_stemmer()
Helper funktion that returns the name of a stemmer if available
Parameters
string: the language id
Return value
string the name of the stemmer
3 calls to apachesolr_multilingual_get_stemmer()
- apachesolr_multilingual_admin_form in ./
apachesolr_multilingual.admin.inc - @file Admin settings for Apache Solr Multilingual.
- apachesolr_multilingual_schema_generator_form_do_validate in ./
apachesolr_multilingual.schema_generator.inc - Implements hook_form_validate.
- apachesolr_multilingual_textfile_admin_form_submit in apachesolr_multilingual_textfile/
apachesolr_multilingual_textfile.module
File
- ./
apachesolr_multilingual.module, line 335 - Multilingual search using Apache Solr.
Code
function apachesolr_multilingual_get_stemmer($language_id = NULL) {
static $available_stemmers = array(
'da' => 'Danish',
'nl' => 'Dutch',
'en' => 'English',
'fi' => 'Finnish',
'fr' => 'French',
'de' => 'German',
'it' => 'Italian',
'nn' => 'Norwegian',
'nb' => 'Norwegian',
'pt-br' => 'Portuguese',
'pt-pt' => 'Portuguese',
'ro' => 'Romanian',
'ru' => 'Russian',
'es' => 'Spanish',
'sv' => 'Swedish',
'tr' => 'Turkish',
);
if (is_null($language_id)) {
return $available_stemmers;
}
if (array_key_exists($language_id, $available_stemmers)) {
return $available_stemmers[$language_id];
}
return variable_get('apachesolr_multilingual_stemmer_' . $language_id, '');
}