/[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.10 - (hide annotations)
Mon Sep 23 18:46:21 2002 UTC (16 years, 11 months ago) by dpavlin
Branch: MAIN
Changes since 1.9: +2 -1 lines
changes for perl 5.8 and new mjesec

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

  ViewVC Help
Powered by ViewVC 1.1.26