Lingua::StarDict::Gen - Stardict dictionary generator
use Lingua::StarDict::Gen; $dic = { word1 => ... word2 => ... } Lingua::StarDict::Gen::writeDict($dic,"dicname" [,"dirpath"]); Lingua::StarDict::Gen::escreveDic($dic,"dicname" [,"dirpath"]); $dic=Lingua::StarDict::Gen::loadDict("file"); $dic=Lingua::StarDict::Gen::carregaDic("file");
This module generates StarDict dictionaries from HASH references (function escreveDic).
escreveDic
This module also imports a simple dictionary (lines with word {def1; def2...})(function carragaDic).
word {def1; def2...}
carragaDic
Lingua::StarDict::Gen is a perl module for building Stardict dictionaries from perl Hash.
Lingua::StarDict::Gen
Also included perl script for making stardicts form term-format and thesaurus-format.
Lingua::StarDict::Gen::writeDict($dic,"dicname"); Lingua::StarDict::Gen::writeDict($dic,"dicname", dir);
Write the necessary files StarDict files for dictionary in $dic HASH reference.
dir is the directory where the StarDict files are written.
dir
If no dir is provided, Lingua::StarDict::Gen will try to write it in /usr/share/stardict/dic/... (the default path for StarDict dictionaries). In this case the dictionary will be automatically installed.
/usr/share/stardict/dic/...
This function loads a simple dictionary to a HASH reference.
$dic=Lingua::StarDict::Gen::loadDict("file");
Where file has the following sintax:
word{def 1; def 2;... ;def n}
Example (default format):
%encoding utf8 cat{gato; tareco; animal com quatros patas e mia} dog{...}
Example2 (terminology format):
%encoding utf8 EN cat ; feline PT gato ; tareco DEF animal com 4 patas e que mia EN house; building; appartment PT house FR maison ...
In this case we must say the type used:
$dic=Lingua::StarDict::Gen::loadDict({type=>"term"},"file");
or even specify the language:
$dic=Lingua::StarDict::Gen::loadDict( {type=>"term", lang=>"PT"},"file");
See also the script term2stardic in the destribution.
term2stardic
showDict($hash);
Prints to stdio the information in the hash in the form
word -> definition
José João Almeida
Alberto Simões
Paulo Silva
Paulo Soares
Nicolav Shaplov
stardict
perl
wiktionary-export/trunk/StarDict
Copyright 2008 J.Joao, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Lingua::StarDict::Gen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::StarDict::Gen
CPAN shell
perl -MCPAN -e shell install Lingua::StarDict::Gen
For more information on module installation, please visit the detailed CPAN module installation guide.