<refentry id="TrackerLanguage">
<refmeta>
<refentrytitle role="top_of_page" id="TrackerLanguage.top_of_page">TrackerLanguage</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBTRACKER-COMMON Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>TrackerLanguage</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="TrackerLanguage.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="TrackerLanguage-struct">TrackerLanguage</link>;
                    <link linkend="TrackerLanguageClass">TrackerLanguageClass</link>;
<link linkend="TrackerLanguage">TrackerLanguage</link> *   <link linkend="tracker-language-new">tracker_language_new</link>                (const <link linkend="gchar">gchar</link> *language_code);
<link linkend="gboolean">gboolean</link>            <link linkend="tracker-language-get-enable-stemmer">tracker_language_get_enable_stemmer</link> (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);
<link linkend="GHashTable">GHashTable</link> *        <link linkend="tracker-language-get-stop-words">tracker_language_get_stop_words</link>     (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);
const <link linkend="gchar">gchar</link> *       <link linkend="tracker-language-get-language-code">tracker_language_get_language_code</link>  (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);
<link linkend="void">void</link>                <link linkend="tracker-language-set-enable-stemmer">tracker_language_set_enable_stemmer</link> (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         <link linkend="gboolean">gboolean</link> value);
<link linkend="void">void</link>                <link linkend="tracker-language-set-language-code">tracker_language_set_language_code</link>  (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *language_code);
<link linkend="gchar">gchar</link> *             <link linkend="tracker-language-stem-word">tracker_language_stem_word</link>          (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *word,
                                                         <link linkend="gint">gint</link> word_length);
const <link linkend="gchar">gchar</link> *       <link linkend="tracker-language-get-name-by-code">tracker_language_get_name_by_code</link>   (const <link linkend="gchar">gchar</link> *language_code);
</synopsis>
</refsynopsisdiv>

<refsect1 id="TrackerLanguage.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----TrackerLanguage
</synopsis>
</refsect1>





<refsect1 id="TrackerLanguage.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="TrackerLanguage--enable-stemmer">enable-stemmer</link>&quot;           <link linkend="gboolean">gboolean</link>              : Write / Construct
  &quot;<link linkend="TrackerLanguage--language-code">language-code</link>&quot;            <link linkend="gchar">gchar</link>*                : Write / Construct
  &quot;<link linkend="TrackerLanguage--stop-words">stop-words</link>&quot;               <link linkend="GHashTable">GHashTable</link>*           : Read
</synopsis>
</refsect1>



<refsect1 id="TrackerLanguage.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="TrackerLanguage.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="TrackerLanguage-struct" role="struct">
<title>TrackerLanguage</title>
<indexterm zone="TrackerLanguage-struct"><primary sortas="TrackerLanguage">TrackerLanguage</primary></indexterm><programlisting>typedef struct _TrackerLanguage TrackerLanguage;</programlisting>
<para>
</para></refsect2>
<refsect2 id="TrackerLanguageClass" role="struct">
<title>TrackerLanguageClass</title>
<indexterm zone="TrackerLanguageClass"><primary sortas="TrackerLanguageClass">TrackerLanguageClass</primary></indexterm><programlisting>typedef struct {
	GObjectClass parent_class;
} TrackerLanguageClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="tracker-language-new" role="function">
<title>tracker_language_new ()</title>
<indexterm zone="tracker-language-new"><primary sortas="tracker_language_new">tracker_language_new</primary></indexterm><programlisting><link linkend="TrackerLanguage">TrackerLanguage</link> *   tracker_language_new                (const <link linkend="gchar">gchar</link> *language_code);</programlisting>
<para>
Creates a new <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link> instance for the passed language code.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language_code</parameter>&#160;:</term>
<listitem><simpara> language code in ISO 639-1 format
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly created <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-get-enable-stemmer" role="function">
<title>tracker_language_get_enable_stemmer ()</title>
<indexterm zone="tracker-language-get-enable-stemmer"><primary sortas="tracker_language_get_enable_stemmer">tracker_language_get_enable_stemmer</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            tracker_language_get_enable_stemmer (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);</programlisting>
<para>
Returns whether words stemming is enabled for <parameter>language</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if word stemming is enabled.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-get-stop-words" role="function">
<title>tracker_language_get_stop_words ()</title>
<indexterm zone="tracker-language-get-stop-words"><primary sortas="tracker_language_get_stop_words">tracker_language_get_stop_words</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link> *        tracker_language_get_stop_words     (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);</programlisting>
<para>
Returns the stop words for <parameter>language</parameter>. Stop words are really common
words that are not worth to index for the language handled by <parameter>language</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A <link linkend="GHashTable"><type>GHashTable</type></link> with the stop words as the value, this memory
         is owned by <parameter>language</parameter> and should not be modified nor freed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-get-language-code" role="function">
<title>tracker_language_get_language_code ()</title>
<indexterm zone="tracker-language-get-language-code"><primary sortas="tracker_language_get_language_code">tracker_language_get_language_code</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       tracker_language_get_language_code  (<link linkend="TrackerLanguage">TrackerLanguage</link> *language);</programlisting>
<para>
Returns the language code in ISO 639-1 handled by <parameter>language</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the language code.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-set-enable-stemmer" role="function">
<title>tracker_language_set_enable_stemmer ()</title>
<indexterm zone="tracker-language-set-enable-stemmer"><primary sortas="tracker_language_set_enable_stemmer">tracker_language_set_enable_stemmer</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_language_set_enable_stemmer (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         <link linkend="gboolean">gboolean</link> value);</programlisting>
<para>
Enables or disables word stemming for <parameter>language</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to enable word stemming
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-set-language-code" role="function">
<title>tracker_language_set_language_code ()</title>
<indexterm zone="tracker-language-set-language-code"><primary sortas="tracker_language_set_language_code">tracker_language_set_language_code</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_language_set_language_code  (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *language_code);</programlisting>
<para>
Sets the <parameter>language</parameter> to <parameter>language_code</parameter>, a <link linkend="NULL--CAPS"><literal>NULL</literal></link> value will reset this
to "en" (English).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>language_code</parameter>&#160;:</term>
<listitem><simpara> an ISO 639-1 language code
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-stem-word" role="function">
<title>tracker_language_stem_word ()</title>
<indexterm zone="tracker-language-stem-word"><primary sortas="tracker_language_stem_word">tracker_language_stem_word</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             tracker_language_stem_word          (<link linkend="TrackerLanguage">TrackerLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *word,
                                                         <link linkend="gint">gint</link> word_length);</programlisting>
<para>
If the stemmer is enabled, it will return the stem word for <parameter>word</parameter>.
If it's disabled, it will return the passed word.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>word</parameter>&#160;:</term>
<listitem><simpara> string pointing to a word
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>word_length</parameter>&#160;:</term>
<listitem><simpara> word ascii length
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string with the processed word. This string must be
         freed with <link linkend="g-free"><function>g_free()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-language-get-name-by-code" role="function">
<title>tracker_language_get_name_by_code ()</title>
<indexterm zone="tracker-language-get-name-by-code"><primary sortas="tracker_language_get_name_by_code">tracker_language_get_name_by_code</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       tracker_language_get_name_by_code   (const <link linkend="gchar">gchar</link> *language_code);</programlisting>
<para>
Returns a human readable language name for the given
ISO 639-1 code, if supported by <link linkend="TrackerLanguage"><type>TrackerLanguage</type></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language_code</parameter>&#160;:</term>
<listitem><simpara> a ISO 639-1 language code.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the language name.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="TrackerLanguage.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="TrackerLanguage--enable-stemmer" role="property"><title>The <literal>&quot;enable-stemmer&quot;</literal> property</title>
<indexterm zone="TrackerLanguage--enable-stemmer"><primary sortas="TrackerLanguage:enable-stemmer">TrackerLanguage:enable-stemmer</primary></indexterm><programlisting>  &quot;enable-stemmer&quot;           <link linkend="gboolean">gboolean</link>              : Write / Construct</programlisting>
<para>Enable stemmer.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="TrackerLanguage--language-code" role="property"><title>The <literal>&quot;language-code&quot;</literal> property</title>
<indexterm zone="TrackerLanguage--language-code"><primary sortas="TrackerLanguage:language-code">TrackerLanguage:language-code</primary></indexterm><programlisting>  &quot;language-code&quot;            <link linkend="gchar">gchar</link>*                : Write / Construct</programlisting>
<para>Language code.</para><para>Default value: "en"</para>
</refsect2>
<refsect2 id="TrackerLanguage--stop-words" role="property"><title>The <literal>&quot;stop-words&quot;</literal> property</title>
<indexterm zone="TrackerLanguage--stop-words"><primary sortas="TrackerLanguage:stop-words">TrackerLanguage:stop-words</primary></indexterm><programlisting>  &quot;stop-words&quot;               <link linkend="GHashTable">GHashTable</link>*           : Read</programlisting>
<para>Stop words.</para></refsect2>
</refsect1>




</refentry>
