The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lingua::StarDict - Perl interface to the StarDict

SYNOPSIS

  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");
  
  

DESCRIPTION

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

Methods

dictionaries

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'
      },
      ...
    ];
search(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'
      },
      ...
    ];

SEE ALSO

StarDict http://stardict.sourceforge.net/

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

AUTHOR

Suhanov Vadim <suhanov_vadim@mail.ru>

COPYRIGHT AND LICENSE

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.

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 54:

You forgot a '=back' before '=head2'

Around line 57:

'=item' outside of any '=over'

Around line 96:

You forgot a '=back' before '=head1'