Taxi::Mysql::Grimm - Grimm index subclass of Taxi::Mysql |
Taxi::Mysql::Grimm - Grimm index subclass of Taxi::Mysql (v1)
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::Grimm;
##======================================================================== ## Constructors etc.
$q = $CLASS_OR_OBJ->new(%args);
##======================================================================== ## Overrides: analysis
$bool = $ix->analyzeDataFiles(%loadDataArgs);
##======================================================================== ## Miscellaneous data-file utilities
$filename = $ix->_loadDataFilename($table_or_name,%loadDataArgs);
##======================================================================== ## Analysis: Files: LTS (Phonetic)
$lts = $ix->ltsAutomaton(); $bool = $ix->analyzeLTS(%loadDataArgs); ($rc,@ARGV) = $ix->admin_analyzeLTS(@ARGV); $undef = $ix->ltsSummary($lts,$elapsed_secs);
##======================================================================== ## Analysis: Files: Morph (morphological)
$morph = $ix->morphAutomaton(); $bool = $ix->analyzeMorph(%loadDataArgs); ($rc,@ARGV) = $ix->admin_analyzeMorph(@ARGV); $undef = $ix->morphSummary($morph,$elapsed_secs);
##======================================================================== ## Analysis: database-global
$bool = $ix->insertCoverageRow($typClass, $whereConds);
##======================================================================== ## Word Type Details
$xmlDoc = $ix->wordInfoXml($word,%options); $htmlDoc = $ix->wordInfoHtml($xmlDoc);
##======================================================================== ## Index Status Details
$ixStatusDoc = $ix->indexStatusXml(%args); $coverageElt = $ix->indexStatusTypeElement($eltName); $typeElt = $ix->indexStatusSubTypeElement($eltName,$coverageTypClassKey); $dbStatusElt = $ix->indexStatusDbElement(); $htmlDoc = $ix->indexStatusHtml($xmlDoc);
##======================================================================== ## URI package: Word Information
$uri = $class_or_obj->new(%options); \%clientRequest = $uri->parseClientRequest($server, $localPath, $clientSocket, $clientHttpRequest); $rc = $uri->processClientRequest($server, $clientRequest);
##======================================================================== ## URI package: Database Info
$uri = $class_or_obj->new(%options); \%clientRequest = $uri->parseClientRequest($server, $localPath, $clientSocket, $clientHttpRequest); $rc = $uri->processClientRequest($server, $clientRequest);
The Taxi::Mysql::Grimm module includes all derived classes for the Taxi/Grimm server version pre-1.
The Taxi::Mysql::Grimm class is a Taxi::Mysql subclass for indexing a corpus of quotation evidence drawn from the electronic sources of the Deutsches Woerterbuch (DWB) by Jacob and Wilhelm Grimm.
It is useable ``out-of-the-box'', once you have set the relevant database connection flags in 'handleArgs', 'prefix', 'dbEncoding', as well as the automaton locations in 'ltsFstFiles' and 'morphFstFiles'.
Taxi::Mysql::Grimm inherits from Taxi::Mysql and supports all Taxi::Mysql mthods.
Set this to false if you don't want to index metadata attributes in the backend DB.
SQL string datatype definition for UTF-8 strings.
SQL string datatype definition for Latin-1 strings (currently unused).
SQL string datatype definition.
$q = $CLASS_OR_OBJ->new(%args);
Constructor supports all Taxi::Mysql %args, but most of these have sensible defaults implemented in the Grimm subclass already. New %args (optional):
ltsFstFiles => { fst =>'lts-grimm.gfst', ##-- LTS transducer filename lab =>'lts-grimm-latin1.lab', ##-- LTS labels filename dict =>'lts-grimm.dict', ##-- LTS dictionary filename },
morphFstFiles => { fst=>'morph-grimm.gfst', ##-- morphology transducer filename lab=>'morph-grimm.lab', ##-- morphology labels filename dict=>'morph-grimm.dict', ##-- morphology dictionary filename },
Filenames for all automata, labels, and dictionaries may be undef
to disable acquisition and indexing of the relevant attributes.
$bool = $ix->analyzeDataFiles(%loadDataArgs);
Data file preprocessor:
calls $ix->analyzeLTS(%args)
and $ix->analyzeMorph(%args)
$filename = $ix->_loadDataFilename($table_or_name,%loadDataArgs);
Returns filename for $table_or_name according to %loadDataArgs. This should really live somewhere else.
$lts = $ix->ltsAutomaton();
Returns $ix->{ltsFst} (a Lingua::LTS::Gfsm object) if present, otherwise returns a new Lingua::LTS::Gfsm created & loaded using $ix->{ltsFstArgs}, $ix->{ltsFstFiles}.
$bool = $ix->analyzeLTS(%loadDataArgs);
Performs phonetic analysis on all orthographic types in the 'type' table. Additional %loadDataArgs:
keepall => $bool, ##-- set to true to keep temporary (renamed) files
($rc,@ARGV) = $ix->admin_analyzeLTS(@ARGV);
taxi-admin.perl wrapper for the analyzeLTS()
method.
undef = $ix->ltsSummary($lts,$elapsed_secs);
Prints out a summary of a completed LTS analysis run.
$morph = $ix->morphAutomaton();
Returns $ix->{morphFst} (a Lingua::LTS::Gfsm object) if present, otherwise returns a new Lingua::LTS::Gfsm created & loaded using $ix->{morphFstArgs}, $ix->{morphFstFiles}.
$bool = $ix->analyzeMorph(%loadDataArgs);
Performs morphological analysis on all orthographic types in the 'type' table. Additional %loadDataArgs:
keepall => $bool, ##-- keep temporary (renamed) files
($rc,@ARGV) = $ix->admin_analyzeMorph(@ARGV);
taxi-admin.perl wrapper for the analyzeMorph()
method.
undef = $ix->morphSummary($morph,$elapsed_secs);
Prints out a summary of a completed morphological analysis run.
Updates types table 'haspmorph', 'freq', 'isalpha', columns with backend destructive SQL queries. Also populates 'coverage' table.
$bool = $ix->insertCoverageRow($typClass, $whereConds);
Inserts a row into the index 'coverage' table for symbolic $typClass, identified by $whereConds.
The following methods may be used to retrieve information on a single word type.
$xmlDoc = $ix->wordInfoXml($word,%options);
%options: encoding => $xmlEncoding, client => \%eltNameToText, ## particularly 'detailURL', 'contextURL', 'homeURL'
$htmlDoc = $ix->wordInfoHtml($xmlDoc);
Links require XPaths ``/*/client/detailURL'' and ``/*/client/contextURL''.
The following methods may be used to retrieve global information on the status and structure of the backend index.
$ixStatusDoc = $ix->indexStatusXml(%args);
Get index status / coverage information as an XML document.
$coverageElt = $ix->indexStatusTypeElement($eltName); $coverageElt = $ix->indexStatusTypeElement($eltName,$typClassBasename);
Coverage XML generation utility. $eltName defaults to 'all', $typClassBasename defaults to $eltName
$typeElt = $ix->indexStatusSubTypeElement($eltName,$coverageTypClassKey);
Coverage XML generation utility. $eltName defaults to 'all', $coverageTypClassKey defaults to $eltName
$dbStatusElt = $ix->indexStatusDbElement(); $dbStatusElt = $ix->indexStatusDbElement($eltName)
Returns an element representing the database structure. $eltName defaults to 'db'
$htmlDoc = $ix->indexStatusHtml($xmlDoc);
Returns an HTML document representing database structure and information.
Links require XPath ``/*/client/homeURL''.
CGI-like URI class for type-wise word information.
Inherits from Taxi::Mysql::URI.
$uri = $class_or_obj->new(%options);
%options:
encoding => 'UTF-8', ##-- query encoding homeURL => '/index.html', ##-- URL for 'Home' navigation link contextURL => '/grimm', ##-- base URL for context query links detailURL => '', ##-- base URL for wordInfo (detail) query links
\%clientRequest = $uri->parseClientRequest($server, $localPath, $clientSocket, $clientHttpRequest);
$rc = $uri->processClientRequest($server, $clientRequest);
CGI-like URI class for database-global information and coverage statistics.
Inherits from Taxi::Mysql::URI.
$uri = $class_or_obj->new(%options);
New %options: (?)
xmlStatusOptions => { encoding => 'UTF-8', homeURL => '/index.html', contextURL => '/grimm', detailURL => '', }
\%clientRequest = $uri->parseClientRequest($server, $localPath, $clientSocket, $clientHttpRequest);
$rc = $uri->processClientRequest($server, $clientRequest);
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 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.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Grimm2(3perl).
Taxi::Mysql::Grimm - Grimm index subclass of Taxi::Mysql |