Microsoft Store
 

Collation


 

:Alphabetical redirects here. For the alphabet, click here. For the meal, see Collations.

Collation systems

Numerical sorting

The simplest collation system is numerical sorting: ordering numbers by their magnitude.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, 4 17 3 5 collates to 3 4 5 17.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

While this might appear to work only for numbers, computers can use this method for any textual information since computers internally use character sets which assign a numeric code point to each letter or glyph.

Related Topics:
Computer - Character set - Glyph

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, a computer using ASCII code (or any of its supersets such as Unicode) and numerical sorting would collate a b C d $ to $ C a b d.

Related Topics:
ASCII - Superset - Unicode

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Why the curious "ASCIIbetical order"?

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The numerical values that ASCII uses are $ = 36, a = 97, b = 98, C = 67, and d = 100.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

This style of collation is commonly used, often with the refinement of converting uppercase letters to lowercase before comparing ASCII values, since most people do not expect capitalised words to jump the head of the list.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

This system fails to properly sort numbers written as text because a human-readable number stored in a computer text string is a sequence of numeric codes for numerals.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, 156.1 (a string) is represented by ASCII code as the five ordered numbers 49, 53, 54, 46, and 49; 35.29 corresponds to 51, 53, 46, 50, and 57; because 49 comes before 51, 156.1 comes before 35.29.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Alphabetical sorting

A more elaborate collation system is alphabetical sorting, which orders words or names based on the conventional order of letters in an alphabet or abjad (most of which have a single conventional order).

Related Topics:
Alphabet - Abjad

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Each nth letter is compared with the nth letter of other words in the list, starting at the first letter of each word and advancing to the second, third, fourth, etc until the order is established.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, foo bar bibble collates to bar bibble foo because (1) f comes after b so bar and bibble both precede foo and (2) a comes before i so bar precedes bibble.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Numeric sorting on a computer and alphabetical sorting often produce the same ordering for English.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The difference between computer-style numerical sorting and true alphabetical sorting becomes obvious in languages using an extended Latin alphabet.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, the thirty-letter alphabet of Spanish treats ñ as basic letter following n, and formerly treated ch and ll as basic letters following c, l, respectively. Ch and ll are still considered letters, but are alphabetized as digraphs. (The new alphabetization rule was issued by the Royal Spanish Academy in 1994.)

Related Topics:
Spanish - Royal Spanish Academy - 1994

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

(On the other hand, the letter rr follows rqu as expected.)

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

A numeric sort may order ñ incorrectly following z and treat ch as c + h, also incorrect.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Similar differences between computer numeric sorting and alphabetic sorting occur in Danish and Norwegian (aa is ordered as å at the end of the alphabet), German (ß is ordered as s + s), Icelandic (ð follows d), English (æ is ordered as a + e), and many other languages.

Related Topics:
Danish - Norwegian - German - Icelandic

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Usually the spaces or hyphens between words are ignored.

Related Topics:
Space - Hyphen

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

See also Latin alphabet for a list of collating rules for Latin based alphabets.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Languages that used a syllabary or abugida instead of an alphabet (for example, Cherokee) can use approximately the same system if there is a set ordering for the symbols.

Related Topics:
Syllabary - Abugida - Cherokee

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Radical-and-stroke sorting

Another form of collation is radical-and-stroke sorting, used for non-alphabetic writing systems such as Chinese logographs and Japanese kanji, whose thousands of symbols defy ordering by convention. In this system, common components of characters (radicals) are identified. Characters are then grouped by their primary radical, then ordered by number of pen strokes within radicals. When there is no obvious radical or more than one radical, convention governs which is used for collation. For example, the Chinese character for "mother" (媽) is sorted as a thirteen-stroke character under the three-stroke primary radical (女).

Related Topics:
Radical - Chinese - Japanese - Kanji

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The radical-and-stroke system is cumbersome compared to an alphabetical system in which there are a few characters, all unambiguous. As a result, logographic languages often supplement radical-and-stroke ordering with alphabetic sorting of a phonetic conversion of the logographs.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

For example, the kanji word Tokyo (東京) can be sorted as if it is spelled out in the Japanese alphabet sequence "to-u-ki-yo-u" (とうきょう).

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Nevertheless, the radical-and-stroke system is the only practical method for constructing dictionaries that someone may use to look up a logograph whose pronunciation is unknown.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Multilingual ordering

When lists of names or words need to be ordered, but the context does not define a particular single language or alphabet, the Unicode Collation Algorithm provides a way to put them in sequence.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~