/[webpac]/trunk2/lib/WebPAC/jsFind.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/lib/WebPAC/jsFind.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 491 by dpavlin, Sat Oct 9 21:47:42 2004 UTC revision 706 by dpavlin, Wed Jul 13 23:35:59 2005 UTC
# Line 4  use warnings; Line 4  use warnings;
4  use strict;  use strict;
5    
6  use Carp;  use Carp;
7  use jsFind 0.04;  use jsFind 0.06;
8  use Log::Log4perl qw(get_logger :levels);  use Log::Log4perl qw(get_logger :levels);
9    
10  =head1 NAME  =head1 NAME
# Line 29  Create new index object Line 29  Create new index object
29          log => 'log4perl.conf',          log => 'log4perl.conf',
30   );   );
31    
32  C<index> is path to location where jsFind index should be created.  C<index_path> is path to location where jsFind index should be created.
33    
34  C<keys> is optional parametar which specify number of keys in each node  C<keys> is optional parametar which specify number of keys in each node
35  (which has to be even number). Default is 10.  (which has to be even number). Default is 10.
# Line 102  sub insert { Line 102  sub insert {
102                  carp "no headline for ",$args->{'path'}," ?";                  carp "no headline for ",$args->{'path'}," ?";
103                  $args->{'headline'} = "no headline: ".$args->{'path'};                  $args->{'headline'} = "no headline: ".$args->{'path'};
104          }          }
105          return unless (defined($args->{'words'}));          if (! defined($args->{'words'})) {
106                    $log->warn("no words to insert for headline ",$args->{'headline'});
107                    return;
108            }
109    
110          my $words = lc($args->{'words'});          my $words = lc($args->{'words'});
111    
# Line 166  sub close { Line 169  sub close {
169                    
170                  $log->debug("saving index '$index_name' xml files to '$path'");                  $log->debug("saving index '$index_name' xml files to '$path'");
171    
172                  $self->tree($index_name)->to_jsfind($path,'ISO-8859-2','UTF-8');                  $self->tree($index_name)->to_jsfind(
173                            dir => $path,
174                            data_codepage => 'ISO-8859-2',
175                            index_codepage => 'UTF-8'
176                    );
177    
178                  if ($log->is_debug()) {                  if ($log->is_debug()) {
179                          my $dot_file = $index_name.".dot";                          my $dot_file = $index_name.".dot";

Legend:
Removed from v.491  
changed lines
  Added in v.706

  ViewVC Help
Powered by ViewVC 1.1.26