Subject: | Lingua::Stardict::Gen generates wrong .idx file |
Date: | Fri, 15 Oct 2010 10:27:36 +0400 |
To: | bug-Lingua-StarDict-Gen [...] rt.cpan.org |
From: | Nikolay Shaplov <n [...] shaplov.ru> |
See two attached examples:
In dictionary generated by wrong_dict1.pl you won't be able to view any
of aaa** articles.
In dictionary generated by wrong_dic21.pl you will not see B00
That's because of
my @keys =();
{ no locale;
@keys = sort (keys %{$hash});
}
which sorts list not in the way StarDict expects...
I've reimplemented in pure perl all the functions that StarDict uses
for comparing entry titles, they are in sort_functions attached file.
After including these functions in your module sorting code should be something like this:
my @keys =();
@keys = sort {stardict_strcmp($a,$b)} (keys %{$hash});
May be you will be also interested in looking at
svn://svn.nataraj.su/wiktionary-export/trunk/StarDict
This is StarDict writer module I've written inspired by
Lingua::Stardict::Gen (I needed some capabilities that
Lingua::Stardict::Gen did not provide). I've made some code improvement
like changing { use bytes; length($string) } into bytes::length($string) and some others.
May be it would be also useful...
Message body not shown because it is not plain text.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.