It may be that I am outdated in my conceptions of Python and Ruby's current capabilities in this regard. (I use Python nearly every day, but not for this purpose). When I researched this for a project a few years ago, both - especially Ruby - were behind Perl in Unicode processing capabilities, and Perl did everything I needed it to do, with aplomb.Jonathan Robie wrote:Compared to Python or Ruby? What advantages do you see?caseyperkins wrote:I would say stick with Perl. This kind of thing is where Perl really excels. I was able to work with Perl for processing Unicode Greek texts with much greater ease than would have been possible with other programming languages.
My impression is that these languages are broadly similar in what they can do.
Unicode Greek friendly Unix tools
-
- Posts: 9
- Joined: January 23rd, 2015, 3:26 pm
Re: Unicode Greek friendly Unix tools
-
- Posts: 3353
- Joined: May 11th, 2011, 10:51 am
- Location: Melbourne
- Contact:
Re: Unicode Greek friendly Unix tools
I discovered that the Unicode::Collate module in Perl does the right thing.
I'm sure I'm not the prettiest coder, but here's something that sorts lines with Unicoded Greek text:
I'm sure I'm not the prettiest coder, but here's something that sorts lines with Unicoded Greek text:
Code: Select all
#!/usr/bin/perl -la
BEGIN {
use utf8;
use Encode;
use Unicode::Collate;
$Collator = Unicode::Collate->new();
}
push @x, decode_utf8($_);
END {
map { print encode_utf8($_) } $Collator->sort(@x);
}
Stephen C. Carlson, Ph.D.
Melbourne, Australia
Melbourne, Australia