You are here

function apachesolr_multilingual_get_stemmer in Apache Solr Multilingual 6

Same name and namespace in other branches
  1. 6.2 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 301
Multilingual search using Apache Solr.

Code

function apachesolr_multilingual_get_stemmer($language_id) {
  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 (array_key_exists($language_id, $available_stemmers)) {
    return $available_stemmers[$language_id];
  }
  return FALSE;
}