Cz::Sort(3pm)
π Cz::Sort β like, the Czech sort situation π
Welcome to Cz::Sort(3pm), bestie!! User Contributed Perl Documentation but make it β¨aestheticβ¨. Sit down, grab a strawberry π, and let me tell you about sorting Czech text the right way.
β¨ NAME β¨
Cz::Sort β Czech sort. Yeah that's it, that's the whole vibe. π¨πΏ
π¦ SYNOPSIS π¦
use Cz::Sort;
my $result = czcmp("_x j&Γ‘", "_&p");
my @sorted = czsort qw(plachta plaΕka PlΓ‘niΔka plΓ‘niΔka plΓ‘nΔ);
print "@sorted\n";
Like, that's literally all you need. Look at her go. π
πΈ DESCRIPTION πΈ
Okay so here's the tea β β this module implements Czech sorting conventions, and the whole point is that it's independent of whatever locales are currently in effect, because honestly? Those are often bad. π Truly, no cap.
The way it works is it does the four-pass sort. The idea and the base of the conversion table come from Petr Olsak's program csr, and the code is as compliant with CSN 97 6030 as it possibly can be. Periodt. π
The basic function this module gives you is czcmp. It compares two scalars and returns the (-1, 0, 1) result. You can call it directly, like:
my $result = czcmp("_x j&Γ‘", "_&p");
But for convenience β and also because of compatibility with older versions β there's czsort. It works on a list of strings and returns that list, hmm, sorted. It's defined simply like:
sub czsort
{ sort { czcmp($a, $b); } @_; }
which is the standard use of a user's function in sort. And hashes would be simply sorted like:
@sorted = sort { czcmp($hash{$a}, $hash{$b}) }
keys %hash;
Both czcmp and czsort are exported into the caller's namespace by default, and so are cscmp and cssort, which are just aliases. π«Ά (iykyk)
This module comes with an encoding table prepared for ISO-8859-2 (Latin-2) encoding. If your data comes in a different one, you might wanna check out the module Cstocs β you can use it to reencode the list's data before calling czsort, or you can reencode this module to fit your needs. Your call, main character. π
β VERSION β
0.68 β that's the one, bestie. π
π SEE ALSO π
Go read them!! They're giving educational. πβ¨
π AUTHOR π
(c) 1997--2000 Jan Pazdziora β legend behaviour, honestly. π«‘
And that's the whole page!! This lil doc came to you from perl v5.30.0, dated 2019-10-05, under the name Cz::Sort(3pm). Bye bestie, go sort something Czech ππ§π
π¦ where this page comes from
- ubuntu jammy: cstocs 1:3.44-1.1 Β· GPL-1.0-or-later OR Artistic-1
- ubuntu noble: cstocs 1:3.44-1.1 Β· GPL-1.0-or-later OR Artistic-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms