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

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

=head1 NAME

DiaColloDB::Corpus::Filters - collocation db, source corpus content filters

=cut

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

=head1 SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 
 use DiaColloDB::Corpus::Filters;
 
 ##========================================================================
 ## Methods
 
 $filters = $CLASS_OR_OBJECT->new(%opts);
 $filters = $CLASS_OR_OBJECT->null();
 $filters = $filters->clear();
 $bool = $filters1->equal($filters2);
 \%name2obj = $filters->compile();
 \%line2undef = $coldb->loadListFile($filename_or_undef);
 

=cut

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

=head1 DESCRIPTION

DiaColloDB::Corpus::Filters is a class representing corpus content filters
(e.g. stopword lists and regular expressions) used by
L<DiaColloDB::Corpus::Compiled|DiaColloDB::Corpus::Compiled> and implicitly
by the C<DiaColloDB::create()|DiaColloDB/create> method as called by
the top-level command-line utility L<dcdb-corpus-create.perl(1)|dcdb-corpus-create.perl>.

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Corpus::Filters: Administrivia
=pod

=head2 Administrivia

=over 4

=item Variable: @ISA

DiaColloDB::Corpus::Filters inherits from
L<DiaColloDB::Persistent|DiaColloDB::Persistent>.
It also uses L<Exporter|Exporter> for compatibility
with older versions of the L<DiaColloDB|DiaColloDB> distribution
in which the package-global L<default variables|/Defaults>
resided directly in the L<DiaColloDB|DiaColloDB> package itself.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Corpus::Filters: Defaults (formerly in DiaColloDB.pm)
=pod

=head2 Defaults

(formerly defined in DiaColloDB.pm)

Don't use C<qr//> for regex defaults,
because L<Storable|Storable> doesn't like pre-compiled Regexps.

=over 4

=item Variable: $PGOOD_DEFAULT

Default positive PoS-regex for document parsing.
Default = C<q/^(?:N|TRUNC|VV|ADJ)/>.

=item Variable: $PBAD_DEFAULT

Default negative PoS-regex for document parsing.
Default = undef (none).

=item Variable: $WGOOD_DEFAULT

Default positive word regex for document parsing.
Default = C<q/[[:alpha:]]/>

=item Variable: $WBAD_DEFAULT

Default negative word regex for document parsing.
Default = C<q/[\.]/>.

=item Variable: $LGOOD_DEFAULT

Default positive lemma regex for document parsing.
Default = undef (none).

=item Variable: $LBAD_DEFAULT

Default negative lemma regex for document parsing.
Default = undef (none).

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Corpus::Filters: Methods
=pod

=head2 Methods

=over 4

=item new

 $filters = $CLASS_OR_OBJECT->new(%opts);

Returns a new DiaColloDB::Corpus::Filters object, which is
a simple HASH-ref wrapping C<%opts>:

 ##-- part-of-speech filters
 pgood     => $re,    ##-- PoS whitelist regex
 pgoodfile => $file,  ##-- PoS whitelist filename
 pbad      => $re,    ##-- PoS blacklist regex
 pbadfile  => $file,  ##-- PoS blacklist filename
 
 ##-- word surface text filters
 wgood     => $re,    ##-- word whitelist regex
 wgoodfile => $file,  ##-- word whitelist filename
 wbad      => $re,    ##-- word blacklist regex
 wbadfile  => $file,  ##-- word blacklkist filename (= "stopword list")
 
 ##-- lemma filters
 lgood     => $re,    ##-- lemma whitelist regex
 lgoodfile => $file,  ##-- lemma whitelist filename
 lbad      => $re,    ##-- lemma blacklist regex
 lbadfile  => $file,  ##-- lemma blacklist filename

See L</Defaults> for the default values.

=item null

 $filters = $CLASS_OR_OBJECT->null();

Returns a new DiaColloDB::Corpus::Filters object representing
a "null-filter", i.e. with all filter properties undefined.

=item clear

 $filters = $filters->clear();

Deletes all filter properties (white- and blacklist regexes and filenames)
from the C<$filters> object.

=item isnull

 $bool = $filters->isnull();

Returns true iff $filters does not define any supported filter properties at all
(i.e. application of $filters would be a no-op).

=item equal

 $bool = $filters1->equal($filters2);
 $bool = $CLASS->equal($filters1,$filters2)

Returns true iff filter object operands define the all and only the same supported filter properties
with identical values.

=item compile

 \%name2obj = $filters->compile();
 \%name2obj = $CLASS->compile(\%filters);

Returns a HASH-ref of compiled filter regexes and (stop|go)-hashes of the form

 ${NAME}     => $REGEXP,
 ${NAME}file => \%HASHREF,

=item loadListFile

 \%line2undef = $coldb->loadListFile($filename_or_undef);

Low-level utility method used to load (stop|go)-list files.

=back

=cut

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

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

=head1 AUTHOR

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

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2015-2020 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<dcdb-corpus-compile.per(1)|dcdb-corpus-compile.perl>,
L<DiaColloDB::Corpus::Compiled(3pm)|DiaColloDB::Corpus::Compiled>,
L<DiaColloDB(3pm)|DiaColloDB>,
L<perl(1)|perl>,
...


=cut
