@ -45,9 +45,9 @@
<itemizedlist>
<itemizedlist>
<listitem>
<listitem>
<para>
<para>
Each line represents a pair, consisting of a character with accent
Each line represents one translation rule, consisting of a character with
followed by a character without accent. The first is translated into
accent followed by a character without accent. The first is translated
the second. For example,
into the second. For example,
<programlisting>
<programlisting>
À A
À A
Á A
Á A
@ -57,6 +57,27 @@
Å A
Å A
Æ A
Æ A
</programlisting>
</programlisting>
The two characters must be separated by whitespace, and any leading or
trailing whitespace on a line is ignored.
</para>
</listitem>
<listitem>
<para>
Alternatively, if only one character is given on a line, instances of
that character are deleted; this is useful in languages where accents
are represented by separate characters.
</para>
</listitem>
<listitem>
<para>
As with other <productname>PostgreSQL</> text search configuration files,
the rules file must be stored in UTF-8 encoding. The data is
automatically translated into the current database's encoding when
loaded. Any lines containing untranslatable characters are silently
ignored, so that rules files can contain rules that are not applicable in
the current encoding.
</para>
</para>
</listitem>
</listitem>
</itemizedlist>
</itemizedlist>
@ -132,8 +153,8 @@ mydb=# select ts_headline('fr','Hôtel de la Mer',to_tsquery('fr','Hotels')
<para>
<para>
The <function>unaccent()</> function removes accents (diacritic signs) from
The <function>unaccent()</> function removes accents (diacritic signs) from
a given string. Basically, it's a wrapper around the
a given string. Basically, it's a wrapper around
<filename>unaccent</> dictionary , but it can be used outside normal
<filename>unaccent</>-type dictionaries , but it can be used outside normal
text search contexts.
text search contexts.
</para>
</para>
@ -145,6 +166,11 @@ mydb=# select ts_headline('fr','Hôtel de la Mer',to_tsquery('fr','Hotels')
unaccent(<optional><replaceable class="PARAMETER">dictionary</replaceable>, </optional> <replaceable class="PARAMETER">string</replaceable>) returns <type>text</type>
unaccent(<optional><replaceable class="PARAMETER">dictionary</replaceable>, </optional> <replaceable class="PARAMETER">string</replaceable>) returns <type>text</type>
</synopsis>
</synopsis>
<para>
If the <replaceable class="PARAMETER">dictionary</replaceable> argument is
omitted, <literal>unaccent</> is assumed.
</para>
<para>
<para>
For example:
For example:
<programlisting>
<programlisting>