##========================================================================
## POD DOCUMENTATION, auto-generated by podextract.perl

##========================================================================
## NAME
=pod

=head1 NAME

DiaColloDB::Document::JSON - diachronic collocation db, source document, raw JSON

=cut

##========================================================================
## SYNOPSIS
=pod

=head1 SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 
 use DiaColloDB::Document::JSON;
 
 ##========================================================================
 ## Constructors etc.
 
 $doc = CLASS_OR_OBJECT->new(%args);
 
 ##========================================================================
 ## API: I/O: parse
 
 $bool = $doc->fromFile($filename_or_fh, %opts);
 

=cut

##========================================================================
## DESCRIPTION
=pod

=head1 DESCRIPTION

DiaColloDB::Document::JSON
provides a L<DiaColloDB::Document|DiaColloDB::Document>-compliant API
for parsing corpus files in raw L<JSON|http://www.json.org> format,
assuming the stored data maps 1:1 onto the
L<DiaColloDB::Document|DiaColloDB::Document> structure.

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Document::JSON: Globals & Constants
=pod

=head2 Globals & Constants

=over 4

=item Variable: @ISA

DiaColloDB::Document::JSON inherits from L<DiaColloDB::Document|DiaColloDB::Document>
and supports the L<DiaColloDB::Document|DiaColloDB::Document> API.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Document::JSON: Constructors etc.
=pod

=head2 Constructors etc.

=over 4

=item new

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

%args, object structure:

 ##-- document data
 date   =>$date,     ##-- year
 tokens =>\@tokens,  ##-- tokens, including undef for EOS
 meta   =>\%meta,    ##-- document metadata (e.g. author, title, collection, ...)

Each token in @tokens is a HASH-ref {w=E<gt>$word,p=E<gt>$pos,l=E<gt>$lemma,...}, or undef for EOS.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Document::JSON: API: I/O: parse
=pod

=head2 API: I/O: parse

=over 4

=item fromFile

 $bool = $doc->fromFile($filename_or_fh, %opts);

parse tokens from $filename_or_fh.
%opts: clobbers %$doc.

=back

=cut

##========================================================================
## END POD DOCUMENTATION, auto-generated by podextract.perl

##========================================================================
## Example
=pod

=head1 EXAMPLE

The following is an example file in the format accepted by this module:

 {
    "date" : "2016",
    "meta" : {
       "author" : "Jurish, Bryan",
       "collection" : "tiny",
       "date_" : "2016-02-25",
       "genre" : "dummy",
       "textClass" : "dummy:test-data",
       "title" : "test document"
    },
    "tokens" : [
       "#s",
       "#p",
       "#file",
       {
          "l" : "this",
          "p" : "DT",
          "w" : "This"
       },
       {
          "l" : "be",
          "p" : "VBZ",
          "w" : "is"
       },
       {
          "l" : "a",
          "p" : "DT",
          "w" : "a"
       },
       {
          "l" : "test",
          "p" : "NN",
          "w" : "test"
       },
       {
          "l" : ".",
          "p" : "SENT",
          "w" : "."
       },
       null,
       "#s",
       {
          "l" : "this",
          "p" : "DT",
          "w" : "This"
       },
       {
          "l" : "be",
          "p" : "VBZ",
          "w" : "is"
       },
       {
          "l" : "only",
          "p" : "RB",
          "w" : "only"
       },
       {
          "l" : "a",
          "p" : "DT",
          "w" : "a"
       },
       {
          "l" : "test",
          "p" : "NN",
          "w" : "test"
       },
       {
          "l" : ".",
          "p" : "SENT",
          "w" : "."
       },
       null,
       "#s",
       "#p",
       {
          "l" : "this",
          "p" : "DT",
          "w" : "This"
       },
       {
          "l" : "be",
          "p" : "VBZ",
          "w" : "is"
       },
       {
          "l" : "still",
          "p" : "RB",
          "w" : "still"
       },
       {
          "l" : "a",
          "p" : "DT",
          "w" : "a"
       },
       {
          "l" : "test",
          "p" : "NN",
          "w" : "test"
       },
       {
          "l" : ".",
          "p" : "SENT",
          "w" : "."
       },
       null
    ]
 }


=cut

##======================================================================
## Footer
##======================================================================
=pod

=head1 AUTHOR

Bryan Jurish E<lt>moocow@cpan.orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2016 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.14.2 or,
at your option, any later version of Perl 5 you may have available.

=head1 SEE ALSO

L<DiaColloDB::Document(3pm)|DiaColloDB::Document>,
L<DiaColloDB(3pm)|DiaColloDB>,
L<perl(1)|perl>,
...



=cut
