Dave Rolsky > Lingua-ZH-CCDICT-0.05 > Lingua::ZH::CCDICT::Storage::BerkeleyDB

Download:
Lingua-ZH-CCDICT-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

Lingua::ZH::CCDICT::Storage::BerkeleyDB - Store the dictionary in BerkeleyDB files

USAGE ^

  use Lingua::ZH::CCDICT;

  my $dict = Lingua::ZH::CCDICT->new( storage  => 'BerkeleyDB',
                                      work_dir => '/path/to/work/dir',
                                    );

DESCRIPTION ^

This module stores the CCDICT dictionary in a set of BerkeleyDB files. There is one file for the data and a number of other files used as indexes.

This storage implementation is quite fast and uses very little memory.

The only parameter it takes is "work_dir". This directory will be used when creating new files from a CCDICT source file, when parse_source_file() is called. Once these files exist, they can be re-used for future searches without parsing the source again.

This class is the most memory-efficient of all the storage classes, as it uses BerkeleyDB cursors for result sets. It is also quite fast.

METHODS ^

This class offers only one method not documented in the Lingua::ZH::CCDICT class.

$dict->files()

This returns a list of the files that make up the dictionary. This list includes files automatically created by BerkeleyDB for its own use.

AUTHOR ^

David Rolsky <autarch@urth.org>

COPYRIGHT ^

Copyright (c) 2002-2007 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

syntax highlighting: