Scroll to navigation

DBIx::FullTextSearch::StopList(3pm) User Contributed Perl Documentation DBIx::FullTextSearch::StopList(3pm)

NAME

DBIx::FullTextSearch::StopList - Stopwords for DBIx::FullTextSearch

SYNOPSIS

  use DBIx::FullTextSearch::StopList;
  # connect to database (regular DBI)
  my $dbh = DBI->connect('dbi:mysql:database', 'user', 'passwd');
  # create a new empty stop word list
  my $sl1 = DBIx::FullTextSearch::StopList->create_empty($dbh, 'sl_web_1');
  # or create a new one with default stop words
  my $sl2 = DBIx::FullTextSearch::StopList->create_default($dbh, 'sl_web_2', 'english');
  # or open an existing one
  my $sl3 = DBIx::FullTextSearch::StopList->open($dbh, 'sl_web_3');
  # add stop words
  $sl1->add_stop_word(['a','in','on','the']);
  # remove stop words
  $sl2->remove_stop_word(['be','because','been','but','by']);
  # check if word is in stoplist
  $bool = $sl1->is_stop_word('in');
  # empty stop words
  $sl3->empty;
  # drop stop word table
  $sl2->drop;

DESCRIPTION

DBIx::FullTextSearch::StopList provides stop lists that can be used -DBIx::FullTextSearch. StopList objects can be reused accross several FullTextSearch objects.

METHODS

CONSTRUCTERS

  my $sl = DBIx::FullTextSearch::StopList->create_empty($dbh, $sl_name);
    

This class method creates a new StopList object.

  my $sl = DBIx::FullTextSearch::StopList->create_default($dbh, $sl_name, $language);
    

This class method creates a new StopList object, with default words loaded in for the given language. Supported languages include Czech, Danish, Dutch, English, Finnish, French, German, Italian, Portuguese, Spanish, and Swedish.

  my $sl = DBIx::FullTextSearch::StopList->open($dbh, $sl_name);
    

Opens and returns StopList object

OBJECT METHODS

  $sl->add_stop_word(\@stop_words);
    

Adds stop words to StopList object. Expects array reference as argument.

  $sl->remove_stop_word(\@stop_words);
    

Remove stop words from StopList object.

  $bool = $sl->is_stop_word($stop_word);
    

Returns true iff stop_word is StopList object

  $sl->empty;
    

Removes all stop words in StopList object.

  $sl->drop;
    

Removes table associated with the StopList object.

AUTHOR

T.J. Mather, tjmather@tjmather.com, http://www.tjmather.com/

COPYRIGHT

All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

DBIx::FullTextSearch

POD ERRORS

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

You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
2018-04-02 perl v5.26.1