NAME

DTA::CAB::Analyzer::TextPhonetic - phonetic digest analysis using Text::Phonetic

SYNOPSIS

 use DTA::CAB::Analyzer::TextPhonetic;
 
 ##========================================================================
 ## Methods: Constructors etc.
 
 $obj = CLASS_OR_OBJ->new(%args);
 $bool = $anl->ensureLoaded();
 @keys = $class_or_obj->noSaveKeys();
 
 ##========================================================================
 ## Methods: Analysis
 
 $bool = $anl->canAnalyze();
 $doc = $anl->analyzeTypes($doc,\%types,\%opts);
 

DESCRIPTION

DTA::CAB::Analyzer::TextPhonetic is an abstract class for phonetic digest analyzers using the Text::Phonetic API.

Globals

Variable: $DEFAULT_ANALYZE_GET

$DEFAULT_ANALYZE_GET

Default coderef or eval-able string for {analyzeGet}; eval()d in list context, may return multiples.

Parameters:

 $_[0] => token object being analyzed

Closure vars:

 $anl  => analyzer

Methods: Constructors etc.

new
 $obj = CLASS_OR_OBJ->new(%args);

%$obj, %args:

 alg => $alg,            ##-- Text::Phonetic subclass, e.g. 'Soundex','Koeln','Metaphone' (default='Soundex')
 tpo => $obj,            ##-- underlying Text::Phonetic::Whatever object
 analyzeGet => $codestr, ##-- accessor: coderef or string: source text (default=$DEFAULT_ANALYZE_GET)
ensureLoaded
 $bool = $anl->ensureLoaded();

Ensures analysis data is loaded from default files Override attempts to use() the appropriate Text::Phonetic algorithm class and instantiates $tp->{tpo} as a new object of that class, if not already defined.

noSaveKeys
 @keys = $class_or_obj->noSaveKeys();

Returns list of keys not to be saved. Override appends key 'tpo'.

Methods: Analysis

canAnalyze
 $bool = $anl->canAnalyze();

Returns true iff analyzer can perform its function (e.g. data is loaded & non-empty) Override checks for $anl->{tpo}.

analyzeTypes
 $doc = $anl->analyzeTypes($doc,\%types,\%opts);

Perform type-wise analysis of all (text) types in $doc->{types}. Override calls $anl->{tpo}->encode() on source text of each type as returned by $anl->{analyzeGet}, and sets the $anl->{label} field to contain the resulting string.

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::Koeln(3pm), DTA::CAB::Analyzer::Metaphone(3pm), DTA::CAB::Analyzer::Phonem(3pm), DTA::CAB::Analyzer::Phonix(3pm), DTA::CAB::Analyzer::Soundex(3pm), DTA::CAB::Analyzer(3pm), DTA::CAB::Chain(3pm), DTA::CAB(3pm), Text::Phonetic(3pm), Text::Soundex(3pm), Text::Metaphone(3pm), perl(1), ...

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 221:

'=item' outside of any '=over'