PDIC::Writer - A Perl module for creating PDIC file |
PDIC::Writer - A Perl module for creating PDIC (.dic) file
use PDIC::Writer;
# Create a PDIC file called 'sample.dic', which has 100 entries # and headwords with a length of 10 bytes on average. my $writer = new PDIC::Writer('sample.dic', 100, 10);
$writer->prepare();
my $entry = { headword => 'apple', pronunciation => '', definition => 'firm round fruit with a central core', example => 'An apple a day keeps a doctor away', level => 3, marked => 0, revised => 0, };
$writer->add_entry($entry);
$writer->finish();
The PDIC::Writer
module for creating a .dic
file of PDIC,
a Win32 electronic dictionary application developed by TaN
<sgm00353@nifty.ne.jp>.
.dic
file and initializes it.
headword, pronunciation, definition,
example, level, marked, revised
.
headword
, pronunciation
, definition
and example
are
strings. level
is a number between 0 and 15. marked
and
revised
are 0 or 1.
Entries are stored in a queue and are written down to the file periodically.
.dic
file,
updates the header and indices, and closes the .dic
file.
Copyright 2002 Tsutomu Kuroda.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
PDIC::Writer - A Perl module for creating PDIC file |