DTA::CAB::Analyzer::LangId - Lingua::LangId::Map wrapper
##========================================================================
## PRELIMINARIES
use DTA::CAB::Analyzer::LangId;
##========================================================================
## Constructors etc.
$obj = CLASS_OR_OBJ->new(%args);
$lid = $lid->clear();
##========================================================================
## Methods: I/O
$bool = $lid->mapOk();
$bool = $lid->ensureLoaded();
$lid = $lid->loadMap($map_file);
##========================================================================
## Methods: Persistence: Perl
@keys = $class_or_obj->noSaveKeys();
$loadedObj = $CLASS_OR_OBJ->loadPerlRef($ref);
##========================================================================
## Methods: Analysis
$bool = $anl->canAnalyze();
$thingy = $lid->analyzeThingy($thingy, \$str, \%opts);
$doc = $anl->analyzeDocument($doc,\%opts);
DTA::CAB::Analyzer::LangId provides a DTA::CAB::Analyzer interface to the Lingua::LangId language-guessing library. Its current implementation only has proof-of-concept status.
DTA::CAB::Analyzer::LangId inherits from DTA::CAB::Analyzer and implements the DTA::CAB::Analyzer API.
$obj = CLASS_OR_OBJ->new(%args);
object structure:
(
##-- Filename Options
mapFile => $filename, ##-- default: none (REQUIRED)
##-- Analysis Options
analyzeWhich => $which, ##-- one of 'token', 'sentence', 'document'; default='document'
vlabel => $label, ##-- verbose destination key (default='langid')
label => $label, ##-- simple destination key (default='lang')
##-- Analysis Objects
map => $map, ##-- a Lingua::LangId::Map object
)
$lid = $lid->clear();
(undocumented)
$bool = $lid->mapOk();
should return false iff map is undefined or "empty"
default version checks for non-empty 'map' and 'sigs'
$bool = $lid->ensureLoaded();
ensures model data is loaded from default files (if available)
$lid = $lid->loadMap($map_file);
(undocumented)
@keys = $class_or_obj->noSaveKeys();
returns list of keys not to be saved
$loadedObj = $CLASS_OR_OBJ->loadPerlRef($ref);
implicitly calls $obj->clear()
$bool = $anl->canAnalyze();
returns true if analyzer can perform its function (e.g. data is loaded & non-empty)
$thingy = $lid->analyzeThingy($thingy, \$str, \%opts);
(undocumented)
$doc = $anl->analyzeDocument($doc,\%opts);
analyze a DTA::CAB::Document $doc
top-level API routine
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), ...