DiaColloDB::Relation::Unigrams - diachronic collocation db, profiling relation: native unigram index
##======================================================================== ## PRELIMINARIES use DiaColloDB::Relation::Unigrams; ##======================================================================== ## Constructors etc. $ug = $CLASS_OR_OBJECT->new(%args); ##======================================================================== ## API: disk usage @files = $obj->diskFiles(); ##======================================================================== ## Relation API: create $ug = $CLASS_OR_OBJECT->create($coldb,$tokdat_file,%opts); ##======================================================================== ## Relation API: union $ug = $CLASS_OR_OBJECT->union($coldb, \@pairs, %opts); ##======================================================================== ## Relation API: default: profiling $prf = $ug->subprofile(\@xids, %opts); ##======================================================================== ## Relation API: default: query info \%qinfo = $rel->qinfo($coldb, %opts);
DiaColloDB::Relation::Unigrams is a DiaColloDB::Relation subclass for native indices over attribute-tuple unigrams using the DiaColloDB::PackedFile API for low-level index data.
DiaColloDB::Relation::Unigrams inherits from DiaColloDB::Relation and DiaColloDB::PackedFile.
$ug = $CLASS_OR_OBJECT->new(%args);
%args, object structure:
##-- PackedFile: user options file => $filename, ##-- default: undef (none) flags => $flags, ##-- fcntl flags or open-mode (default='r') perms => $perms, ##-- creation permissions (default=(0666 &~umask)) reclen => $reclen, ##-- record-length in bytes: (default: guess from pack format if available) packas => $packas, ##-- pack-format or array; see DiaColloDB::Utils::packFilterStore(); ##-- OVERRIDE default='N' ## ##-- PackedFile: filters filter_fetch => $filter, ##-- DB_File-style filter for fetch filter_store => $filter, ##-- DB_File-style filter for store ## ##-- PackedFile: low-level data fh => $fh, ##-- underlying filehandle ## ##-- Unigrams: high-level data N => $N, ##-- total frequency
@files = $obj->diskFiles();
returns disk storage files, used by du() and timestamp()
$ug = $CLASS_OR_OBJECT->create($coldb,$tokdat_file,%opts);
populates current database from $tokdat_file, a tt-style text file containing 1 token-id perl line with optional blank lines.
%opts: clobber %$ug, also:
size=>$size, ##-- set initial size
$ug = $CLASS_OR_OBJECT->union($coldb, \@pairs, %opts);
merge multiple unigram indices into new object. @pairs is an array of pairs ([$ug,\@xi2u],...) of unigram-objects $ug and tuple-id maps \@xi2u for $ug. implicitly flushes the new index.
%opts: clobber %$ug
$prf = $ug->subprofile(\@xids, %opts);
get frequency profile for @xids (index must be opened). %opts:
groupby => \&gbsub, ##-- key-extractor $key2_or_undef = $gbsub->($i2)
\%qinfo = $rel->qinfo($coldb, %opts);
get query-info hash for profile administrivia (ddc hit links) %opts: as for profile(), additionally:
qreqs => \@qreqs, ##-- as returned by $coldb->parseRequest($opts{query}) gbreq => \%groupby, ##-- as returned by $coldb->groupby($opts{groupby})
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2015 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
dcdb-create.per(1), dcdb-query.perl(1), dcdb-info.perl(1), dcdb-export.perl(1), dcdb-dump.perl(1), DiaColloDB(3pm), perl(1), ...
To install DiaColloDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DiaColloDB
CPAN shell
perl -MCPAN -e shell install DiaColloDB
For more information on module installation, please visit the detailed CPAN module installation guide.