NAME
DTA::CAB::Analyzer::LangId - Lingua::LangId::Map wrapper
SYNOPSIS
##========================================================================
## 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);
DESCRIPTION
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.
Globals
- Variable: @ISA
-
DTA::CAB::Analyzer::LangId inherits from DTA::CAB::Analyzer and implements the DTA::CAB::Analyzer API.
Constructors etc.
- new
-
$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 )
- clear
-
$lid = $lid->clear();
(undocumented)
Methods: Generic
- mapOk
-
$bool = $lid->mapOk();
should return false iff map is undefined or "empty"
default version checks for non-empty 'map' and 'sigs'
Methods: I/O: Input: all
- ensureLoaded
-
$bool = $lid->ensureLoaded();
ensures model data is loaded from default files (if available)
Methods: I/O: Input: Map
- loadMap
-
$lid = $lid->loadMap($map_file);
(undocumented)
Methods: Persistence: Perl
- noSaveKeys
-
@keys = $class_or_obj->noSaveKeys();
returns list of keys not to be saved
- loadPerlRef
-
$loadedObj = $CLASS_OR_OBJ->loadPerlRef($ref);
implicitly calls $obj->clear()
Methods: Analysis: Generic
- canAnalyze
-
$bool = $anl->canAnalyze();
returns true if analyzer can perform its function (e.g. data is loaded & non-empty)
Methods: Analysis: Generic
- analyzeThingy
-
$thingy = $lid->analyzeThingy($thingy, \$str, \%opts);
(undocumented)
Methods: Analysis: v1.x: API
- analyzeDocument
-
$doc = $anl->analyzeDocument($doc,\%opts);
analyze a DTA::CAB::Document $doc
top-level API routine
AUTHOR
Bryan Jurish <moocow@cpan.org>
COPYRIGHT AND LICENSE
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.
SEE ALSO
dta-cab-analyze.perl(1), DTA::CAB::Analyzer(3pm), DTA::CAB::Chain(3pm), DTA::CAB(3pm), perl(1), ...