DTA::CAB::Client - abstract class for DTA::CAB server clients
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);
Abstract base class / API specification for generic DTA::CAB clients.
DTA::CAB::Client inherits from DTA::CAB::Logger.
$obj = CLASS_OR_OBJ->new(%args);
%args, %$obj: none here; see subclass documentation for details.
undef = $obj->initialize();
Called to initialize new objects after new(). Default implementation does nothing.
$bool = $cli->connected;
Returns true iff a connection to the selected server has been established. Default implementation always returns false.
$bool = $cli->connect();
Establish a connection to the selected sever; returns true on success, false otherwise. Default implementation just calls "connected"().
$bool = $cli->disconnect();
Close current connection, if any. Default implementation just calls "connected"().
@analyzers = $cli->analyzers();
Return a list of analyzers known by the server. Default implementation just returns an empty list.
$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.
$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.
$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.
$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.
Bryan Jurish <moocow@cpan.org>
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.