NAME

DTA::CAB::Client - abstract class for DTA::CAB server clients

SYNOPSIS

 use DTA::CAB::Client;
 
 ##========================================================================
 ## Constructors etc.
 
 $cli = DTA::CAB::Client->new(%args);
 undef = $cli->initialize();
 
 ##========================================================================
 ## Methods: Generic Client API: Connections
 
 $bool = $cli->connected;
 $bool = $cli->connect();
 $bool = $cli->disconnect();
 @analyzers = $cli->analyzers();
 
 ##========================================================================
 ## Methods: Generic Client API: Queries
 
 $tok  = $cli->analyzeToken($analyzer, $tok, \%opts);
 $sent = $cli->analyzeSentence($analyzer, $sent, \%opts);
 $doc  = $cli->analyzeDocument($analyzer, $doc, \%opts);
 $str  = $cli->analyzeData($analyzer, $str, \%opts);
 

DESCRIPTION

Abstract base class / API specification for generic DTA::CAB clients.

Globals

Variable: @ISA

DTA::CAB::Client inherits from DTA::CAB::Logger.

Constructors etc.

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

%args, %$obj: none here; see subclass documentation for details.

initialize
 undef = $obj->initialize();

Called to initialize new objects after new(). Default implementation does nothing.

Methods: Generic Client API: Connections

connected
 $bool = $cli->connected;

Returns true iff a connection to the selected server has been established. Default implementation always returns false.

connect
 $bool = $cli->connect();

Establish a connection to the selected sever; returns true on success, false otherwise. Default implementation just calls "connected"().

disconnect
 $bool = $cli->disconnect();

Close current connection, if any. Default implementation just calls "connected"().

analyzers
 @analyzers = $cli->analyzers();

Return a list of analyzers known by the server. Default implementation just returns an empty list.

Methods: Generic Client API: Queries

analyzeToken
 $tok = $cli->analyzeToken($analyzer, $tok, \%opts);

Server-side token (type) analysis. $analyzer is the name of an analyzer known to the server.

Default implementation just croak()s.

analyzeSentence
 $sent = $cli->analyzeSentence($analyzer, $sent, \%opts);

Server-side sentence analysis. $analyzer is the name of an analyzer known to the server.

Default implementation just croak()s.

analyzeDocument
 $doc = $cli->analyzeDocument($analyzer, $doc, \%opts);

Server-side document analysis. $analyzer is the name of an analyzer known to the server.

Default implementation just croak()s.

analyzeData
 $data = $cli->analyzeData($analyzer, $data, \%opts);

Server-side raw data analysis. $analyzer is the name of an analyzer known to the server, and $data is a string buffer to be analyzed, in some format parseable by the server. Depending on the client and server used, the data format must be specified in %opts.

Default implementation just croak()s.

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2009-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.