NAME

DTA::CAB::Format::Text - Datum parser: verbose human-readable text

SYNOPSIS

 use DTA::CAB::Format::Text;
 
 ##========================================================================
 ## Constructors etc.
 
 $fmt = DTA::CAB::Format::Text->new(%args);
 
 ##========================================================================
 ## Methods: Input
 
 $doc = $fmt->parseTextString();
 
 ##========================================================================
 ## Methods: Output
 
 $fmt = $fmt->putToken($tok);

DESCRIPTION

Human-readable wrapper for DTA::CAB::Format::TT.

Globals

Variable: @ISA

DTA::CAB::Format::Text inherits from DTA::CAB::Format via DTA::CAB::Format::TT.

Filenames

This module registers the filename regex:

 /\.(?i:txt|text)$/

with DTA::CAB::Format.

Constructors etc.

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

Constructor. Inherited from DTA::CAB::Format::TT.

%args, %$fmt:

 ##---- Input
 doc => $doc,                    ##-- buffered input document
 ##
 ##---- Output
 #level    => $formatLevel,      ##-- output formatting level: n/a
 outbuf    => $stringBuffer,     ##-- buffered output
 ##
 ##---- Common
 encoding  => $encoding,         ##-- default: 'UTF-8'

Methods: Input

parseTextString
 $fmt = $fmt->parseTextString($str);

Guts for document parsing: parse string $str into local document buffer $fmt->{doc}.

parseTTString
 $fmt = $fmt->parseTTString($str);

Alias for parseTextString().

Methods: Output

putToken
 $fmt = $fmt->putToken($tok);

Override: append formatted token $tok to output buffer.

EXAMPLE

An example file in the format accepted/generated by this module is:

 %% $s:lang=de
 wie
        +[exlex] wie
        +[errid] ec
        +[lang] de
        +[xlit] l1=1 lx=1 l1s=wie
        +[hasmorph] 1
        +[morph/safe] 1
        +[moot/word] wie
        +[moot/tag] PWAV
        +[moot/lemma] wie
 oede
        +[xlit] l1=1 lx=1 l1s=oede
        +[morph/safe] 0
        +[moot/word] öde
        +[moot/tag] ADJD
        +[moot/lemma] öde
 !
        +[exlex] !
        +[errid] ec
        +[xlit] l1=1 lx=1 l1s=!
        +[morph/safe] 1
        +[moot/word] !
        +[moot/tag] $.
        +[moot/lemma] !
 

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.