DTA::CAB::Analyzer::Dyn - generic analyzer API: dynamic code generation
use DTA::CAB::Analyzer::Dyn; ##======================================================================== ## Constructors etc. $obj = CLASS_OR_OBJ->new(%args); undef = $anl->dropClosures(); ##======================================================================== ## Methods: I/O $bool = $anl->prepare(); ##======================================================================== ## Methods: Dynamic Closures $bool = $anl->ensureDynSubs(); \&sub = $anl->compileDynSub($which); $code = $anl->dynSubCode($which); undef = dumpPackage(%opts); ##======================================================================== ## Methods: Analysis: API: Dyn $rc = $anl->analyzeDyn($which,@args); ##======================================================================== ## Methods: Analysis: API $doc = $anl->analyzeDocument($doc,\%opts); $doc = $anl->analyzeTypes($doc,\%types,\%opts); $doc = $anl->analyzeTokens($doc,\%opts); $doc = $anl->analyzeSentences($doc,\%opts); $doc = $anl->analyzeLocal($doc,\%opts); $doc = $anl->analyzeClean($doc,\%opts);
UNMAINTAINED
This module provides a DTA::CAB::Analyzer subclass using dynamically generated closures to implement the DTA::CAB::Analyzer analysis API. In theory, this should be faster than on-the-fly compilation of accessor strings, etc, but is a serious pain in the posterior to debug.
(undocumented)
$obj = CLASS_OR_OBJ->new(%args);
object structure, new
( ##-- code generation options analyze${Which}Code => $str, ##-- code for analyze${Which} method ##-- generated code analyze${Which}Sub => \&sub, ##-- compiled code for analyze${Which} method )
undef = $anl->dropClosures();
drops 'analyze${which}' closures
currently does nothing
$bool = $anl->prepare(); $bool = $anl->prepare(\%opts)
inherited: wrapper for ensureLoaded(), autoEnable(), initInfo()
override appends ensureDynSubs() call
$bool = $anl->ensureDynSubs();
ensures subs are defined for all analyze${Which} methods
\&sub = $anl->compileDynSub($which);
returns compiled analyze${Which} sub
$code = $anl->dynSubCode($which);
returns code for analyze${Which} sub
undef = dumpPackage(%opts);
%opts:
file => $file_or_handle, package => $pkgname,
$rc = $anl->analyzeDyn($which,@args);
wrapper for $anl->{"analyze${which}"}->(@args)
$doc = $anl->analyzeDocument($doc,\%opts);
analyze a DTA::CAB::Document $doc
$doc = $anl->analyzeTypes($doc,\%types,\%opts);
perform type-wise analysis of all (text) types in $doc->{types}
$doc = $anl->analyzeTokens($doc,\%opts);
perform token-wise analysis of all tokens $doc->{body}[$si]{tokens}[$wi]
$doc = $anl->analyzeSentences($doc,\%opts);
perform sentence-wise analysis of all sentences $doc->{body}[$si]
$doc = $anl->analyzeLocal($doc,\%opts);
perform analyzer-local document-level analysis of $doc
$doc = $anl->analyzeClean($doc,\%opts);
cleanup any temporary data associated with $doc
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2011-2019 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.24.1 or, at your option, any later version of Perl 5 you may have available.
dta-cab-analyze.perl(1), DTA::CAB::Analyzer(3pm), DTA::CAB::Chain(3pm), DTA::CAB(3pm), perl(1), ...
To install DTA::CAB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DTA::CAB
CPAN shell
perl -MCPAN -e shell install DTA::CAB
For more information on module installation, please visit the detailed CPAN module installation guide.