
Lingua::StarDict - Perl interface to the StarDict

use Lingua::StarDict;
my $sd = new StarDict;
# or
my $sd = new StarDict( dict => "path_to_dictionary.ifo" );
my $dicts = $sd->dictionaries;
my $result = $sd->search("word");

Lingua::StarDict allows you to translate words via StarDict library and its dictionaries. This module is only an interface, so your should install the StarDict before. Full StarDict (with GUI and a lot of dependeces on GNOME libraries) can be found at http://stardict.sourceforge.net and the console version SDCV - StarDict console version (without depencies on GNOME) - here http://sdcv.sourceforge.net
returns the reference to an array of hashes.
use Lingua::StarDict;
use Data::Dumper;
my $sd = new Lingua::StarDict;
print Dump( $sd->dictionaries );
$VAR1 =
[
{
'wordcount' => 110339,
'ifofile' => '/usr/share/stardict/dic/en-ru-bars.ifo',
'bookname' => 'en-ru-bars'
},
...
];
some_word)Search an translation for the given word. Returns the reference to an array of hashes.
print Dump( $sd->search("some_word") );
$VAR1 =
[
{
'explanation' => 'some_word explanation',
'bookname' => 'dictionary name', # dictionary name where it was found
'definition' => 'some_word definition'
},
...
];

StarDict http://stardict.sourceforge.net/
SDCV StarDict console version without dependencies on a GNOME libraries. http://sdcv.sourceforge.net/

Suhanov Vadim <suhanov_vadim@mail.ru>

Copyright (C) 2004 by Suhanov Vadim
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.