1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
# -*- Mode: Perl -*- |
# -*- Mode: Perl -*- |
3 |
# $Basename$ |
# $Basename$ |
4 |
# $Revision: 1.1 $ |
# $Revision: 1.4 $ |
5 |
# Author : Ulrich Pfeifer |
# Author : Ulrich Pfeifer |
6 |
# Created On : Mon Dec 31 13:57:11 2001 |
# Created On : Mon Dec 31 13:57:11 2001 |
7 |
# Last Modified By: Ulrich Pfeifer |
# Last Modified By: Ulrich Pfeifer |
8 |
# Last Modified On: Mon Dec 31 14:37:43 2001 |
# Last Modified On: Fri Jan 4 15:59:20 2002 |
9 |
# Language : CPerl |
# Language : CPerl |
10 |
# |
# |
11 |
# (C) Copyright 2001, UUNET Deutschland GmbH, Germany |
# (C) Copyright 2001, UUNET Deutschland GmbH, Germany |
79 |
or die "Couldn't tie to file: $!\n"; |
or die "Couldn't tie to file: $!\n"; |
80 |
|
|
81 |
my $tb = $db->create_table(name => $OPT{table}, |
my $tb = $db->create_table(name => $OPT{table}, |
82 |
attr => ['text', 'author', 'title', |
attr => ['author', 'isbn', 'title', |
83 |
'headline', 'docid'], |
'headline', 'docid'], |
84 |
layout => $layout, |
layout => $layout, |
85 |
access => $access, |
access => $access, |
86 |
invindex => |
invindex => |
87 |
[ |
[ |
88 |
'title' => $stem, |
'title' => $stem, |
89 |
|
'about' => $stem, |
90 |
'text' => $text, |
'text' => $text, |
91 |
'author' => $text, |
'author' => $text, |
92 |
|
'colophon' => $text, |
93 |
|
'author' => $sound, |
94 |
|
'isbn' => $text, |
95 |
] |
] |
96 |
); |
); |
97 |
die "Couldn't create table $OPT{table}: $@\n" unless $tb; |
die "Couldn't create table $OPT{table}: $@\n" unless $tb; |
101 |
my $record = $layout->split($value); |
my $record = $layout->split($value); |
102 |
my $headline = $record->{title}; |
my $headline = $record->{title}; |
103 |
$headline =~ s/\s+/ /sg; |
$headline =~ s/\s+/ /sg; |
104 |
printf "%s\n", substr($headline,0,80); |
printf "%15s %s\n", $record->{isbn}, substr($headline,0,60); |
105 |
$tb->insert('docid' => $did, |
$tb->insert('docid' => $did, |
106 |
headline => $headline, |
headline => $headline, |
107 |
%{$record}); |
%{$record}); |