Suhanov Vadim > Lingua-StarDict > Lingua::StarDict

Download:
Lingua-StarDict-1.00.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.00   Source  

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.

syntax highlighting: