словарь Ожегова (2479 кб)
Большой энциклопедический словарь (13321 кб)
У меня нет постоянного хостинга, поэтому выкладываю на webfile. Поэтому все, кому нужны эти словари, пожалуйста, заберите их поскорее.
В выходные почитаю, как делать .ipk и постараюсь выложить также и в этом формате, чтобы можно было в feed его положить.
На всякий случай, выкладываю и скрипт для трансформации из stardict'овских словарей.
dict2zbedic.pl
Usage:
Код: Выделить всё
./dict2zbedic.pl <unzipped input dictionary> <unzipped output dictionary> -x <full path to xerox executable> [-s <split size>] [-n <name>]
Example:
Код: Выделить всё
./dict2zbedic.pl ozhegov myozh.dic -x '../zbedic/libbedic/objs.x86/xerox' -s 7000 -n Ozhegov
- split size не должен превышать 16000
- name лучше присвоить английское, по крайней мере, utf-8 zbedic в списке не отображает.
- Полученный .dic файл лучше ужать dictzip'ом (dictzip myozh.dic)
- И это... код писан на коленке, не судите строго
Код: Выделить всё
#!/usr/bin/perl -w
# author: Pavel Gurevich aka fAX
# license: GPL v2.
use strict;
use Getopt::Long;
use vars qw ( $opt_xerox
$opt_name
$opt_counter
$opt_split
$opt_cut
);
&GetOptions ("-xerox|x=s",
"-name|n=s",
"-split|s=i",
"-counter|c=i",
"-cut"
);
my $begin = 0;
my $input = shift @ARGV;
my $output = shift @ARGV || 'output.dict.dz';
my $lfcounter = 0;
my $tmp = "/tmp/dic2zbedic";
my $name = $opt_name || "generated dictionary";
my $prev_word = '';
my $desclen = 0;
my $counter = 0;
my $word_cnt = 1;
$opt_counter ||= 5000000;
my $split = $opt_split || 15000;
my ($word, $description);
open ( INPUT, $input ) || die "Cannot open input file '$input': $!\n";
open ( TMP, ">$tmp" );
input: while ( <INPUT> ) {
chop;
m/^$/ && do {
++ $lfcounter;
if ( $word && $description ) {
# $word =~ m/^#/ && do { last; };
if ( $word ne $prev_word ) {
# print TMP "{/s}\000" if ( $prev_word );
print TMP "\000$word\012";
$desclen = 0;
$word_cnt = 1;
} elsif ( $opt_cut ) {
next;
}
$desclen += length $description;
if ( $desclen > $split ) {
if ( $opt_cut ) {
print TMP "{s}{ss}" . substr ( $description, 0, $split ) . "...{/ss}{/s}";
$description = '';
$desclen = 0;
next input;
} else {
print TMP "\000$word ($word_cnt )\012";
++ $word_cnt;
}
$desclen = 0;
}
while ( length $description > $split ) {
my ( $desc ) = substr ($description,0,$split,'') . "...";
print "Splitted $word\n";
$description = "..." . $description;
print TMP "\000$word ($word_cnt )\012";
print TMP "{s}{ss}$desc\{/ss}{/s}";
++ $word_cnt;
if ( $opt_cut ) {
$description = '';
$desclen = 0;
}
}
print TMP "{s}{ss}$description\{/ss}{/s}";
$prev_word = $word;
$word = '';
$description = '';
++$ counter;
last if ( $counter > $opt_counter );
}
next;
};
if ( $lfcounter >= 4 ) {
$begin = 1;
print TMP "id=$name\012";
print TMP "description=This dictionary was created using dict2zbedic.pl from file '$input'\012";
}
if ( !$begin ) {
$lfcounter = 0;
next;
}
if ( $lfcounter > 0 ) { # Word
$lfcounter = 0;
s/^\s*//;
$word = $_;
next;
} else {
$description .= $_;
next;
}
}
print TMP "\000";
close ( TMP );
my $command = "$opt_xerox $tmp $output";
( system( $command ) >> 8 ) && die "Error running '$command': $!\n";
unlink $tmp;
[/list][/url]
Sharp Zaurus SL-C750.