18 |
); |
); |
19 |
|
|
20 |
my $nr = 1; |
my $nr = 1; |
21 |
|
my $max = 0; # no limit |
22 |
|
|
23 |
parse_trivia($t, sub { |
parse_trivia($t, sub { |
24 |
|
|
39 |
|
|
40 |
$doc->add_attr('year', $a->{year}) if ($a->{year}); |
$doc->add_attr('year', $a->{year}) if ($a->{year}); |
41 |
foreach my $q ( $a->{qv} ) { |
foreach my $q ( $a->{qv} ) { |
42 |
|
$q = join(' ', @$q) if (ref($q) eq 'ARRAY'); |
43 |
|
next unless ($q); |
44 |
$doc->add_attr('quote', $q); |
$doc->add_attr('quote', $q); |
45 |
$doc->add_hidden_text($q); |
$doc->add_hidden_text($q); |
46 |
} |
} |
48 |
# add the body text to the document object |
# add the body text to the document object |
49 |
$doc->add_text($a->{trivia}); |
$doc->add_text($a->{trivia}); |
50 |
|
|
|
|
|
51 |
# register the document object to the database |
# register the document object to the database |
52 |
$node->put_doc($doc); |
$node->put_doc($doc); |
53 |
|
|
54 |
|
$nr++; |
55 |
|
last if ($max && $nr > $max); |
56 |
|
|
57 |
}); |
}); |