NAME

DTA::CAB::Format::CSV - Datum I/O: concise minimal-output human-readable text

SYNOPSIS

 use DTA::CAB::Format::CSV;
 
 ##========================================================================
 ## Methods: Constructors etc.
 
 $fmt = CLASS_OR_OBJ->new(%args)
 
 ##========================================================================
 ## Methods: Input
 
 $fmt = $fmt->parseCsvString($string);
 
 ##========================================================================
 ## Methods: Output
 
 $type = $fmt->mimeType();
 $ext = $fmt->defaultExtension();
 $fmt = $fmt->putToken($tok);
 

DESCRIPTION

DTA::CAB::Format::CSV is a DTA::CAB::Format subclass for representing the minimal "interesting" results of a DTA::CAB::Chain::DTA canonicalization in a (more or less) human- and machine-friendly TAB-separated format. As for DTA::CAB::Format::TT (from which this class inherits), each token is represented by a single line and sentence boundaries are represented by blank lines. Token lines have the format:

 OLD_TEXT   XLIT_TEXT   NEW_TEXT    POS_TAG    LEMMA    ?DETAILS

Methods: Constructors etc.

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

Recognized %args:

 ##---- Input
 doc => $doc,                    ##-- buffered input document
 
 ##---- Output
 level    => $formatLevel,      ##-- output formatting level:
                                ##   0: text, xlit, canon, tag, lemma
                                ##   1: text, xlit, canon, tag, lemma, details
 
 #outbuf    => $stringBuffer,     ##-- buffered output
 
 ##---- Common
 utf8  => $bool,                 ##-- default: 1

Methods: Input: Local

parseCsvString
 $fmt = $fmt->parseCsvString($string);

Hack which converts a CSV string to a TT string and passes it to DTA::CAB::Format::TT::parseTTString().

Methods: Output

mimeType
 $type = $fmt->mimeType();

Default returns text/plain.

defaultExtension
 $ext = $fmt->defaultExtension();

Deturns default filename extension for this format. Override returns '.csv'.

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

Appends $tok to output buffer.

EXAMPLE

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

 %% $s:lang=de
 wie    wie     wie     PWAV    wie
 oede   oede    öde     ADJD    öde
 !      !       !       $.      !
 

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-convert.perl(1), DTA::CAB::Format::TT(3pm), DTA::CAB::Format(3pm), DTA::CAB(3pm), perl(1), ...

POD ERRORS

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

Around line 256:

Non-ASCII character seen before =encoding in 'öde'. Assuming UTF-8