## TrackerLanguage

TrackerLanguage

## Synopsis

                        TrackerLanguage;
                        TrackerLanguageClass;
    TrackerLanguage *   tracker_language_new                (const gchar *language_code);
    gboolean            tracker_language_get_enable_stemmer (TrackerLanguage *language);
    GHashTable *        tracker_language_get_stop_words     (TrackerLanguage *language);
    const gchar *       tracker_language_get_language_code  (TrackerLanguage *language);
    void                tracker_language_set_enable_stemmer (TrackerLanguage *language,
                                                             gboolean value);
    void                tracker_language_set_language_code  (TrackerLanguage *language,
                                                             const gchar *language_code);
    gchar *             tracker_language_stem_word          (TrackerLanguage *language,
                                                             const gchar *word,
                                                             gint word_length);
    const gchar *       tracker_language_get_name_by_code   (const gchar *language_code);

## Object Hierarchy

      GObject
       +----TrackerLanguage

## Properties

      "enable-stemmer"           gboolean              : Write / Construct
      "language-code"            gchar*                : Write / Construct
      "stop-words"               GHashTable*           : Read

## Description

## Details

### TrackerLanguage

    typedef struct _TrackerLanguage TrackerLanguage;

### TrackerLanguageClass

    typedef struct {
    	GObjectClass parent_class;
    } TrackerLanguageClass;

### tracker_language_new ()

    TrackerLanguage *   tracker_language_new                (const gchar *language_code);

Creates a new TrackerLanguage instance for the passed language code.

`language_code` : | language code in ISO 639-1 format
Returns : | a newly created TrackerLanguage

### tracker_language_get_enable_stemmer ()

    gboolean            tracker_language_get_enable_stemmer (TrackerLanguage *language);

Returns whether words stemming is enabled for `language`.

`language` : | a TrackerLanguage
Returns : | `TRUE` if word stemming is enabled.

### tracker_language_get_stop_words ()

    GHashTable *        tracker_language_get_stop_words     (TrackerLanguage *language);

Returns the stop words for `language`. Stop words are really common words that are not worth to index for the language handled by `language`.

`language` : | a TrackerLanguage
Returns : | A GHashTable with the stop words as the value, this memory is owned by `language` and should not be modified nor freed.

### tracker_language_get_language_code ()

    const gchar *       tracker_language_get_language_code  (TrackerLanguage *language);

Returns the language code in ISO 639-1 handled by `language`.

`language` : | a TrackerLanguage
Returns : | the language code.

### tracker_language_set_enable_stemmer ()

    void                tracker_language_set_enable_stemmer (TrackerLanguage *language,
                                                             gboolean value);

Enables or disables word stemming for `language`.

`language` : | a TrackerLanguage
`value` : | `TRUE` to enable word stemming

### tracker_language_set_language_code ()

    void                tracker_language_set_language_code  (TrackerLanguage *language,
                                                             const gchar *language_code);

Sets the `language` to `language_code`, a `NULL` value will reset this to "en" (English).

`language` : | a TrackerLanguage
`language_code` : | an ISO 639-1 language code

### tracker_language_stem_word ()

    gchar *             tracker_language_stem_word          (TrackerLanguage *language,
                                                             const gchar *word,
                                                             gint word_length);

If the stemmer is enabled, it will return the stem word for `word`. If it's disabled, it will return the passed word.

`language` : | a TrackerLanguage
`word` : | string pointing to a word
`word_length` : | word ascii length
Returns : | a string with the processed word. This string must be freed with `g_free()`

### tracker_language_get_name_by_code ()

    const gchar *       tracker_language_get_name_by_code   (const gchar *language_code);

Returns a human readable language name for the given ISO 639-1 code, if supported by TrackerLanguage

`language_code` : | a ISO 639-1 language code.
Returns : | the language name.

## Property Details

### The `"enable-stemmer"` property

      "enable-stemmer"           gboolean              : Write / Construct

Enable stemmer.

Default value: TRUE

### The `"language-code"` property

      "language-code"            gchar*                : Write / Construct

Language code.

Default value: "en"

### The `"stop-words"` property

      "stop-words"               GHashTable*           : Read

Stop words.