php-doc-en/reference/intl/collator-constants.xml
Christoph Michael Becker 86e6094e86 Use canonical type names
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351133 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-02 15:39:04 +00:00

447 lines
14 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="intl.collator-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.constants;
<para>
<variablelist>
<varlistentry xml:id="collator.constants.french-collation">
<term>
<constant>Collator::FRENCH_COLLATION</constant>
(<type>int</type>)
</term>
<listitem>
<para>
Sort strings with different accents from the back of the string. This
attribute is automatically set to
<emphasis>On</emphasis>
for the French locales and a few others. Users normally would not need
to explicitly set this attribute. There is a string comparison
performance cost when it is set <emphasis>On</emphasis>,
but sort key length is unaffected. Possible values are:
<simplelist>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>FRENCH_COLLATION rules</title>
<para>
<simplelist>
<member>F=OFF cote &lt; coté &lt; côte &lt; côté </member>
<member>F=ON cote &lt; côte &lt; coté &lt; côté</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.alternate-handling">
<term>
<constant>Collator::ALTERNATE_HANDLING</constant>
(<type>int</type>)
</term>
<listitem>
<para>
The Alternate attribute is used to control the handling of the so called
variable characters in the UCA: whitespace, punctuation and symbols. If
Alternate is set to <emphasis>NonIgnorable</emphasis>
(N), then differences among these characters are of the same importance
as differences among letters. If Alternate is set to
<emphasis>Shifted</emphasis>
(S), then these characters are of only minor importance. The
<emphasis>Shifted</emphasis> value is often used in combination with
<emphasis>Strength</emphasis>
set to Quaternary. In such a case, whitespace, punctuation, and symbols
are considered when comparing strings, but only if all other aspects of
the strings (base letters, accents, and case) are identical. If
Alternate is not set to Shifted, then there is no difference between a
Strength of 3 and a Strength of 4. For more information and examples,
see Variable_Weighting in the
<link xlink:href="&url.icu.uca;">UCA</link>.
The reason the Alternate values are not simply
<emphasis>On</emphasis> and <emphasis>Off</emphasis>
is that additional Alternate values may be added in the future. The UCA
option Blanked is expressed with Strength set to 3, and Alternate set to
Shifted. The default for most locales is NonIgnorable. If Shifted is
selected, it may be slower if there are many strings that are the same
except for punctuation; sort key length will not be affected unless the
strength level is also increased.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::NON_IGNORABLE</constant>(default)</member>
<member><constant>Collator::SHIFTED</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>ALTERNATE_HANDLING rules</title>
<para>
<simplelist>
<member>
S=3, A=N di Silva &lt; Di Silva &lt; diSilva &lt; U.S.A. &lt; USA
</member>
<member>
S=3, A=S di Silva = diSilva &lt; Di Silva &lt; U.S.A. = USA
</member>
<member>
S=4, A=S di Silva &lt; diSilva &lt; Di Silva &lt; U.S.A. &lt; USA
</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.case-first">
<term>
<constant>Collator::CASE_FIRST</constant>
(<type>int</type>)
</term>
<listitem>
<para>
The Case_First attribute is used to control whether uppercase letters
come before lowercase letters or vice versa, in the absence of other
differences in the strings. The possible values are
<emphasis>Uppercase_First</emphasis>
(U) and <emphasis>Lowercase_First</emphasis>
(L), plus the standard <emphasis>Default</emphasis>
and <emphasis>Off</emphasis>.
There is almost no difference between the Off and Lowercase_First
options in terms of results, so typically users will not use
Lowercase_First: only Off or Uppercase_First. (People interested in the
detailed differences between X and L should consult the <literal>Collation
Customization</literal>). Specifying either L or U won't affect string comparison
performance, but will affect the sort key length.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::LOWER_FIRST</constant></member>
<member><constant>Collator::UPPER_FIRST</constant></member>
<member><constant>Collator:DEFAULT</constant></member>
</simplelist>
</para>
<para>
<example>
<title>CASE_FIRST rules</title>
<para>
<simplelist>
<member>C=X or C=L "china" &lt; "China" &lt; "denmark" &lt; "Denmark"</member>
<member>C=U "China" &lt; "china" &lt; "Denmark" &lt; "denmark"</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.case-level">
<term>
<constant>Collator::CASE_LEVEL</constant>
(<type>int</type>)
</term>
<listitem>
<para>
The Case_Level attribute is used when ignoring accents but not case. In
such a situation, set Strength to be <emphasis>Primary</emphasis>,
and Case_Level to be <emphasis>On</emphasis>.
In most locales, this setting is Off by default. There is a small
string comparison performance and sort key impact if this attribute is
set to be <emphasis>On</emphasis>.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>CASE_LEVEL rules</title>
<para>
<simplelist>
<member>S=1, E=X role = Role = rôle</member>
<member>S=1, E=O role = rôle &lt; Role</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.normalization-mode">
<term>
<constant>Collator::NORMALIZATION_MODE</constant>
(<type>int</type>)
</term>
<listitem>
<para>
The Normalization setting determines whether text is thoroughly
normalized or not in comparison. Even if the setting is off (which is
the default for many locales), text as represented in common usage will
compare correctly (for details, see UTN #5). Only if the accent marks
are in noncanonical order will there be a problem. If the setting is
<emphasis>On</emphasis>,
then the best results are guaranteed for all possible text input.
There is a medium string comparison performance cost if this attribute
is <emphasis>On</emphasis>,
depending on the frequency of sequences that require normalization.
There is no significant effect on sort key length. If the input text is
known to be in NFD or NFKD normalization forms, there is no need to
enable this Normalization option.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.strength">
<term>
<constant>Collator::STRENGTH</constant>
(<type>int</type>)
</term>
<listitem>
<para>
The ICU Collation Service supports many levels of comparison (named
"Levels", but also known as "Strengths"). Having these categories
enables ICU to sort strings precisely according to local conventions.
However, by allowing the levels to be selectively employed, searching
for a string in text can be performed with various matching conditions.
For more detailed information, see
<function>collator_set_strength</function> chapter.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::PRIMARY</constant></member>
<member><constant>Collator::SECONDARY</constant></member>
<member><constant>Collator::TERTIARY</constant>(default)</member>
<member><constant>Collator::QUATERNARY</constant></member>
<member><constant>Collator::IDENTICAL</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.hiragana-quaternary-mode">
<term>
<constant>Collator::HIRAGANA_QUATERNARY_MODE</constant>
(<type>int</type>)
</term>
<listitem>
<para>
Compatibility with JIS x 4061 requires the introduction of an additional
level to distinguish Hiragana and Katakana characters. If compatibility
with that standard is required, then this attribute should be set
<emphasis>On</emphasis>,
and the strength set to Quaternary. This will affect sort key length
and string comparison string comparison performance.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.numeric-collation">
<term>
<constant>Collator::NUMERIC_COLLATION</constant>
(<type>int</type>)
</term>
<listitem>
<para>
When turned on, this attribute generates a collation key for the numeric
value of substrings of digits. This is a way to get '100' to sort AFTER
'2'.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.default-value">
<term>
<constant>Collator::DEFAULT_VALUE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.primary">
<term>
<constant>Collator::PRIMARY</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.secondary">
<term>
<constant>Collator::SECONDARY</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.tertiary">
<term>
<constant>Collator::TERTIARY</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.default-strength">
<term>
<constant>Collator::DEFAULT_STRENGTH</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.quaternary">
<term>
<constant>Collator::QUATERNARY</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.identical">
<term>
<constant>Collator::IDENTICAL</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.off">
<term>
<constant>Collator::OFF</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.on">
<term>
<constant>Collator::ON</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.shifted">
<term>
<constant>Collator::SHIFTED</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.non-ignorable">
<term>
<constant>Collator::NON_IGNORABLE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.lower-first">
<term>
<constant>Collator::LOWER_FIRST</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.upper-first">
<term>
<constant>Collator::UPPER_FIRST</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>