/[webpac-proto]/common.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

Annotation of /common.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations)
Mon Jun 24 15:36:40 2002 UTC (16 years, 11 months ago) by dpavlin
Branch: MAIN
Changes since 1.5: +15 -1 lines
preglasi

1 dpavlin 1.3 #!/usr/bin/perl
2 dpavlin 1.1
3 dpavlin 1.2 #package common;
4    
5 dpavlin 1.1 use strict;
6 dpavlin 1.2
7     $common::install_dir="/local/index";
8     $common::mpsindex="/local/mps-5.3/bin/mpsindex -l 9 -b";
9     $common::isis_data="/var/autofs/misc/isis_data/";
10     #$common::isis_data="/mnt/20020606/Isis/Data/"; # doma
11    
12     $common::mps_header="V 5 3
13     L hr-HR
14     F 700+ 1 Autor
15     F 200+ 2 Naslov
16 dpavlin 1.3 F 210+ 3 Izdavanje
17 dpavlin 1.2 F 225 4 Nakladnièka cjelina
18     F 300+ 5 Napomene
19     F 330 6 Sadr¾aj
20     F 464 7 Analitièki radovi
21     F 610 8 Kljuène rijeèi
22     F 675 9 UDK
23     F 686 10 CC
24     F 990 11 Signatura
25     F 991 12 Inventarni broj
26 dpavlin 1.4 F ISBN 13 ISBN
27 dpavlin 1.3 F MFN 14 MFN
28     F 215+ 15 Materijalni opis
29 dpavlin 1.2 ";
30 dpavlin 1.1
31 dpavlin 1.5 $common::database_cf="/local/search/databases.cf";
32    
33 dpavlin 1.1 #--------------------------------------------------------------------
34     #
35     # mps_expand(nr,"space separated string");
36     #
37    
38     sub mps_expand {
39     my $nr = shift @_;
40     my $out = "";
41     while (my $fld = shift @_) {
42     if ($fld =~ s/\s*[,;\.!?'"<>\[\]]*\s+/ /g) {
43 dpavlin 1.6 $fld =~ s/></ /g;
44 dpavlin 1.1 foreach my $w (split(/\s+/,$fld)) {
45     # FIX: this should be replaced by stemmer!
46 dpavlin 1.6 # remove chars from beginning of word
47     $w =~ s/^['"<(\[]//g;
48     # remove chars from end of word
49     $w =~ s/[,;\.!?'">)\]]$//g;
50     # preglasi öÖäÄüÜ -> ”™„Žš
51     if ($w =~ m/[”™„Žš]/) {
52     $out .= "W $w $nr\n";
53     $w =~ s/[”™]/oe/g;
54     $w =~ s/[„Ž]/ae/g;
55     $w =~ s/[š]/ue/g;
56     $out .= "W $w $nr\n";
57     } else {
58     $out .= "W $w $nr\n";
59     }
60 dpavlin 1.1 }
61     } else {
62     $out .= "W $fld $nr\n";
63     }
64     }
65     return c_852_czs($out);
66     }
67    
68     1;
69    

  ViewVC Help
Powered by ViewVC 1.1.26